Exemplo n.º 1
0
 private void finishScalingUpdate(
     AxisRangeControl axisRangeControl, ValueAxis newAxis, ValueAxis oldAxis) {
   if (axisRangeControl.isAutoMinMax()) {
     newAxis.setAutoRange(false);
     acceptableDeviationDataset.removeAllSeries();
     regressionDataset.removeAllSeries();
     getPlot().removeAnnotation(r2Annotation);
     newAxis.setAutoRange(true);
     axisRangeControl.adjustComponents(newAxis, 3);
     newAxis.setAutoRange(false);
     computeRegressionAndAcceptableDeviationData();
   } else {
     newAxis.setAutoRange(false);
     newAxis.setRange(oldAxis.getRange());
   }
 }
Exemplo n.º 2
0
 private void handleAxisRangeControlChanges(
     PropertyChangeEvent evt,
     AxisRangeControl axisRangeControl,
     ValueAxis valueAxis,
     Range computedAutoRange) {
   final String propertyName = evt.getPropertyName();
   switch (propertyName) {
     case AxisRangeControl.PROPERTY_NAME_AUTO_MIN_MAX:
       if (axisRangeControl.isAutoMinMax()) {
         final double min = computedAutoRange.getLowerBound();
         final double max = computedAutoRange.getUpperBound();
         axisRangeControl.adjustComponents(min, max, 3);
       }
       break;
     case AxisRangeControl.PROPERTY_NAME_MIN:
       valueAxis.setLowerBound(axisRangeControl.getMin());
       break;
     case AxisRangeControl.PROPERTY_NAME_MAX:
       valueAxis.setUpperBound(axisRangeControl.getMax());
       break;
   }
 }