changeset 1055:3f79febcea11

revert fix for RT-21289, as it causes performance test problems
author mickf
date Wed, 16 May 2012 17:36:05 +0100
parents c6d0fedcdca2
children 19dcd1df2147
files javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/ScrollBarBehavior.java
diffstat 1 files changed, 19 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/ScrollBarBehavior.java	Wed May 16 00:55:20 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/ScrollBarBehavior.java	Wed May 16 17:36:05 2012 +0100
@@ -186,8 +186,9 @@
         timeline = new Timeline();
         timeline.setCycleCount(Timeline.INDEFINITE);
 
-        final EventHandler<ActionEvent> step =
-                new EventHandler<ActionEvent>() {
+        final KeyFrame kf1 = new KeyFrame(
+            Duration.millis(0),
+            new EventHandler<ActionEvent>() {
                 @Override
                 public void handle(ActionEvent event) {
                     boolean i = (pos > ((bar.getValue() - bar.getMin())/(bar.getMax() - bar.getMin())));
@@ -202,12 +203,10 @@
                         timeline = null;
                     }
                 }
-            };
-
-        final KeyFrame kf = new KeyFrame(Duration.millis(200), step);
-        timeline.getKeyFrames().add(kf);
-        // do the first step immediately
-        step.handle(null);
+            }
+        );
+        final KeyFrame kf2 = new KeyFrame(Duration.millis(200));
+        timeline.getKeyFrames().addAll(kf1, kf2);
         timeline.play();
 
     }
@@ -236,7 +235,8 @@
         timeline = new Timeline();
         timeline.setCycleCount(Timeline.INDEFINITE);
 
-        final EventHandler<ActionEvent> dec =
+        final KeyFrame kf1 = new KeyFrame(
+            Duration.millis(0),
             new EventHandler<ActionEvent>() {
                 @Override
                 public void handle(ActionEvent event) {
@@ -248,12 +248,10 @@
                         timeline = null;
                     }
                 }
-            };
-
-        final KeyFrame kf = new KeyFrame(Duration.millis(200), dec);
-        timeline.getKeyFrames().add(kf);
-        // do the first step immediately
-        dec.handle(null);
+            }
+        );
+        final KeyFrame kf2 = new KeyFrame(Duration.millis(200));
+        timeline.getKeyFrames().addAll(kf1, kf2);
         timeline.play();
     }
 
@@ -280,7 +278,8 @@
         timeline = new Timeline();
         timeline.setCycleCount(Timeline.INDEFINITE);
 
-        final EventHandler<ActionEvent> inc =
+        final KeyFrame kf1 = new KeyFrame(
+            Duration.millis(0),
             new EventHandler<ActionEvent>() {
                 @Override
                 public void handle(ActionEvent event) {
@@ -292,12 +291,10 @@
                         timeline = null;
                     }
                 }
-            };
-
-        final KeyFrame kf = new KeyFrame(Duration.millis(200), inc);
-        timeline.getKeyFrames().add(kf);
-        // do the first step immediately
-        inc.handle(null);
+            }
+        );
+        final KeyFrame kf2 = new KeyFrame(Duration.millis(200));
+        timeline.getKeyFrames().addAll(kf1, kf2);
         timeline.play();
     }