changeset 8040:cf836d5d76d2

RT-38480: [CSS] ProgressIndicator does not spin anymore since 8u20 Reviewed by: kevin, steve, jonathan
author David Grieve<david.grieve@oracle.com>
date Thu, 11 Sep 2014 10:23:42 -0400
parents 65b41355c1af
children b0a08e558789
files apps/toys/Hello/src/main/java/hello/HelloProgressIndicator.java modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/caspian/caspian.css
diffstat 2 files changed, 16 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/apps/toys/Hello/src/main/java/hello/HelloProgressIndicator.java	Thu Sep 11 10:19:45 2014 -0400
+++ b/apps/toys/Hello/src/main/java/hello/HelloProgressIndicator.java	Thu Sep 11 10:23:42 2014 -0400
@@ -29,8 +29,11 @@
 import javafx.animation.KeyValue;
 import javafx.animation.Timeline;
 import javafx.application.Application;
+import javafx.beans.binding.Bindings;
+import javafx.beans.property.BooleanProperty;
 import javafx.scene.Group;
 import javafx.scene.Scene;
+import javafx.scene.control.CheckBox;
 import javafx.scene.control.ProgressIndicator;
 import javafx.scene.paint.Color;
 import javafx.scene.shape.Circle;
@@ -112,17 +115,16 @@
         pInd6.setProgress(0.5);
         root.getChildren().add(pInd6);
 
+        // busy indicator - indeterminate and spin are enabled by default
+        // See https://wiki.openjdk.java.net/display/OpenJFX/ProgressIndicator+User+Experience+Documentation
         ProgressIndicator pInd7 = new ProgressIndicator();
         pInd7.setLayoutX(300);
         pInd7.setLayoutY(250);
-        pInd7.setProgress(-1);
-        pInd7.setStyle("-fx-spin-enabled:true;");
         root.getChildren().add(pInd7);
 
         ProgressIndicator pInd8 = new ProgressIndicator();
         pInd8.setLayoutX(360);
         pInd8.setLayoutY(250);
-        pInd8.setProgress(-1);
         pInd8.setStyle("-fx-spin-enabled:false;");
         root.getChildren().add(pInd8);
 
@@ -195,6 +197,16 @@
         }
         //System.out.println("<path d=\""+circles+"\" />");
 
+        CheckBox checkBox = new CheckBox("Use caspian theme");
+        checkBox.selectedProperty().addListener(observable -> {
+            if (((BooleanProperty)observable).get()) Application.setUserAgentStylesheet(STYLESHEET_CASPIAN);
+            else Application.setUserAgentStylesheet(STYLESHEET_MODENA);
+        });
+        checkBox.setLayoutX(5);
+        checkBox.setLayoutY(425);
+
+
+        root.getChildren().add(checkBox);
         stage.setScene(scene);
         stage.show();
     }
--- a/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/caspian/caspian.css	Thu Sep 11 10:19:45 2014 -0400
+++ b/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/caspian/caspian.css	Thu Sep 11 10:23:42 2014 -0400
@@ -1996,6 +1996,7 @@
 
 .progress-indicator {
     -fx-indeterminate-segment-count: 8;
+    -fx-spin-enabled: true;
 }
 
 .progress-indicator > .determinate-indicator > .indicator {