private double getValue(AxisBoundsPanel panel) {
try {
boolean maximum = panel == maxControls;
AxisBoundsPanel other = maximum ? minControls : maxControls;
if (temporal) {
TimeSpanTextField field = (TimeSpanTextField) spanControls.spanValue;
if (panel.auto.isSelected()) {
return maximum ? (field.getDurationInMillis() + getValue(other)) :
panel.autoValue.getValue(); // Now
} else if (panel.current.isSelected()) {
return panel.currentValue.getValue();
} else if (panel.manual.isSelected()) {
return ((ManualTimeEntryArea)panel.manualValue).getValue();
}
} else {
NumericTextField field = (NumericTextField) spanControls.spanValue;
if (panel.auto.isSelected()) {
return getValue(other) + (maximum ? 1 : -1) * field.getDoubleValue();
} else if (panel.current.isSelected()) {
return panel.currentValue.getValue();
} else if (panel.manual.isSelected()) {
field = (NumericTextField) panel.manualValue;
return field.getDoubleValue();
}
}
} catch (ParseException pe) {
logger.error("Parse exception in axis bounds panel.");
}