< prev index next >

modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ProgressIndicatorSkin.java

Print this page

        

@@ -191,10 +191,13 @@
         registerChangeListener(control.indeterminateProperty(), "INDETERMINATE");
         registerChangeListener(control.progressProperty(), "PROGRESS");
         registerChangeListener(control.visibleProperty(), "VISIBLE");
         registerChangeListener(control.parentProperty(), "PARENT");
         registerChangeListener(control.sceneProperty(), "SCENE");
+        if ((control.getScene() != null) && (control.getScene().getWindow() != null)) {
+            registerChangeListener(control.getScene().getWindow().showingProperty(), "WINDOWSHOWING");
+        }
 
         initialize();
     }
 
 

@@ -215,10 +218,12 @@
             updateAnimation();
         } else if ("PARENT".equals(p)) {
             updateAnimation();
         } else if ("SCENE".equals(p)) {
             updateAnimation();
+        } else if ("WINDOWSHOWING".equals(p)) {
+            updateAnimation();
         }
     }
 
     protected void initialize() {
         boolean isIndeterminate = control.isIndeterminate();

@@ -291,11 +296,13 @@
 
     protected void updateAnimation() {
         ProgressIndicator control = getSkinnable();
         final boolean isTreeVisible = control.isVisible() &&
                                       control.getParent() != null &&
-                                      control.getScene() != null;
+                                      control.getScene() != null &&
+                                      control.getScene().getWindow() != null &&
+                                      control.getScene().getWindow().isShowing();
         if (indeterminateTransition != null) {
             pauseTimeline(! isTreeVisible);
         } else if (isTreeVisible) {
             createIndeterminateTimeline();
         }
< prev index next >