diff --git a/modules/javafx.controls/src/main/java/javafx/scene/control/skin/ProgressIndicatorSkin.java b/modules/javafx.controls/src/main/java/javafx/scene/control/skin/ProgressIndicatorSkin.java index d365215c4be..a9ae503ad7b 100644 --- a/modules/javafx.controls/src/main/java/javafx/scene/control/skin/ProgressIndicatorSkin.java +++ b/modules/javafx.controls/src/main/java/javafx/scene/control/skin/ProgressIndicatorSkin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ package javafx.scene.control.skin; import com.sun.javafx.scene.NodeHelper; +import com.sun.javafx.scene.TreeShowingExpression; import com.sun.javafx.scene.control.skin.Utils; import java.util.ArrayList; import java.util.Collections; @@ -104,6 +105,7 @@ public class ProgressIndicatorSkin extends SkinBase { private IndeterminateSpinner spinner; private DeterminateIndicator determinateIndicator; private ProgressIndicator control; + private TreeShowingExpression treeShowingExpression; Animation indeterminateTransition; @@ -125,12 +127,13 @@ public ProgressIndicatorSkin(ProgressIndicator control) { super(control); this.control = control; + this.treeShowingExpression = new TreeShowingExpression(control); // register listeners registerChangeListener(control.indeterminateProperty(), e -> initialize()); registerChangeListener(control.progressProperty(), e -> updateProgress()); - registerChangeListener(NodeHelper.treeShowingProperty(control), e -> updateAnimation()); registerChangeListener(control.sceneProperty(), e->updateAnimation()); + registerChangeListener(treeShowingExpression, e -> updateAnimation()); initialize(); updateAnimation(); @@ -232,6 +235,8 @@ Paint getProgressColor() { @Override public void dispose() { super.dispose(); + treeShowingExpression.dispose(); + if (indeterminateTransition != null) { indeterminateTransition.stop(); indeterminateTransition = null; diff --git a/modules/javafx.graphics/src/main/java/com/sun/javafx/scene/NodeHelper.java b/modules/javafx.graphics/src/main/java/com/sun/javafx/scene/NodeHelper.java index dd79d09a602..a10952ba462 100644 --- a/modules/javafx.graphics/src/main/java/com/sun/javafx/scene/NodeHelper.java +++ b/modules/javafx.graphics/src/main/java/com/sun/javafx/scene/NodeHelper.java @@ -294,10 +294,6 @@ public static boolean isTreeShowing(Node node) { return nodeAccessor.isTreeShowing(node); } - public static BooleanExpression treeShowingProperty(Node node) { - return nodeAccessor.treeShowingProperty(node); - } - public static List