changeset 1440:74b5a4b24935

fix RT-21295 Setting chart data to null disables chart animation
author Paru Somashekar <paru.somashekar@oracle.com>
date Thu, 12 Jul 2012 15:54:27 -0700
parents dcc106432347
children 6c543a637228
files javafx-ui-charts/src/javafx/scene/chart/XYChart.java
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-charts/src/javafx/scene/chart/XYChart.java	Thu Jul 12 15:53:03 2012 -0700
+++ b/javafx-ui-charts/src/javafx/scene/chart/XYChart.java	Thu Jul 12 15:54:27 2012 -0700
@@ -169,8 +169,9 @@
             if(old != null) {
                 old.removeListener(seriesChanged);
                 // Set animated to false so we don't animate both remove and add
-                // at the same time. RT-14163
-                if (old.size() > 0) {
+                // at the same time. RT-14163 
+                // RT-21295 - disable animated only when current is also not null. 
+                if (current != null && old.size() > 0) {
                     saveAnimationState = (old.get(0).getChart().getAnimated()) ? 1 : 2;
                     old.get(0).getChart().setAnimated(false);
                 }