changeset 7762:191aab1d374d

RT-38329 [LineChart] Calling setForceZeroInRange doesn't update LineChart Reviewed by: jgiles
author Martin Sladecek <martin.sladecek@oracle.com>
date Fri, 22 Aug 2014 10:12:43 +0200
parents 0b9b9d26f990
children 4c2f04e9e358
files modules/controls/src/main/java/javafx/scene/chart/Axis.java modules/controls/src/main/java/javafx/scene/chart/NumberAxis.java modules/controls/src/main/java/javafx/scene/chart/ValueAxis.java
diffstat 3 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/javafx/scene/chart/Axis.java	Fri Aug 22 09:48:22 2014 +0200
+++ b/modules/controls/src/main/java/javafx/scene/chart/Axis.java	Fri Aug 22 10:12:43 2014 +0200
@@ -87,7 +87,7 @@
     private double oldLength = 0;
     /** True when the current range invalid and all dependent calculations need to be updated */
     boolean rangeValid = false;
-    private boolean measureInvalid = false;
+    boolean measureInvalid = false;
 
     private BitSet labelsToSkip = new BitSet();
 
--- a/modules/controls/src/main/java/javafx/scene/chart/NumberAxis.java	Fri Aug 22 09:48:22 2014 +0200
+++ b/modules/controls/src/main/java/javafx/scene/chart/NumberAxis.java	Fri Aug 22 10:12:43 2014 +0200
@@ -74,7 +74,10 @@
     private BooleanProperty forceZeroInRange = new BooleanPropertyBase(true) {
         @Override protected void invalidated() {
             // This will effect layout if we are auto ranging
-            if(isAutoRanging()) requestAxisLayout();
+            if(isAutoRanging()) {
+                requestAxisLayout();
+                invalidateRange();
+            }
         }
 
         @Override
--- a/modules/controls/src/main/java/javafx/scene/chart/ValueAxis.java	Fri Aug 22 09:48:22 2014 +0200
+++ b/modules/controls/src/main/java/javafx/scene/chart/ValueAxis.java	Fri Aug 22 10:12:43 2014 +0200
@@ -104,7 +104,13 @@
 
     
     /** The scale factor from data units to visual units */
-    private ReadOnlyDoubleWrapper scale = new ReadOnlyDoubleWrapper(this, "scale", 0);
+    private ReadOnlyDoubleWrapper scale = new ReadOnlyDoubleWrapper(this, "scale", 0) {
+        @Override
+        protected void invalidated() {
+            requestAxisLayout();
+            measureInvalid = true;
+        }
+    };
     public final double getScale() { return scale.get(); }
     protected final void setScale(double scale) { this.scale.set(scale); }
     public final ReadOnlyDoubleProperty scaleProperty() { return scale.getReadOnlyProperty(); }