((OMRangeRings) circle).setIntervalUnits(Length.get((String) jcb.getSelectedItem())); updateInterval(intervalField.getText());
OMRangeRings rr = (OMRangeRings) circle; Length newLength = Length.get((String) jcb.getSelectedItem()); Length oldLength = rr.getIntervalUnits();    int value = interpretValue(intervalField.getText()); if (value <= 0) { value = 4; }   if (newLength != null && oldLength != null) { value = (int) newLength.fromRadians(oldLength.toRadians(value)); } else { int numSubCircles; if (rr.subCircles == null || rr.subCircles.length == 0) { numSubCircles = 1; } else { numSubCircles = rr.subCircles.length; }  if (newLength == null) { value = numSubCircles; } else if (oldLength == null) { value = (int) newLength.fromRadians(Length.DECIMAL_DEGREE.toRadians(rr.getRadius())) / numSubCircles; } }  ((OMRangeRings) circle).setIntervalUnits(newLength); updateInterval(value);
                public void actionPerformed(ActionEvent e) {                    JComboBox jcb = (JComboBox) e.getSource();                    ((OMRangeRings) circle).setIntervalUnits(Length.get((String) jcb.getSelectedItem()));                    updateInterval(intervalField.getText());                }