modules/graphics/src/main/java/javafx/stage/Window.java

Print this page

        

@@ -65,10 +65,11 @@
 import com.sun.javafx.tk.Toolkit;
 import javafx.beans.property.BooleanProperty;
 import javafx.beans.property.SimpleBooleanProperty;
 
 import static com.sun.javafx.FXPermissions.ACCESS_WINDOW_LIST_PERMISSION;
+import com.sun.javafx.scene.SceneHelper;
 
 
 /**
  * <p>
  *     A top level window within which a scene is hosted, and with which the user

@@ -277,11 +278,11 @@
      * Set the width and height of this Window to match the size of the content
      * of this Window's Scene.
      */
     public void sizeToScene() {
         if (getScene() != null && peer != null) {
-            getScene().impl_preferredSize();
+            SceneHelper.preferredSize(getScene());
             adjustSize(false);
         } else {
             // Remember the request to reapply it later if needed
             sizeToScene = true;
         }

@@ -769,11 +770,11 @@
             }
             // First, detach scene peer from this window
             updatePeerScene(null);
             // Second, dispose scene peer
             if (oldScene != null) {
-                oldScene.impl_setWindow(null);
+                SceneHelper.setWindow(oldScene, null);
                 StyleManager.getInstance().forget(oldScene);
             }
             if (newScene != null) {
                 final Window oldWindow = newScene.getWindow();
                 if (oldWindow != null) {

@@ -783,22 +784,22 @@
                     oldWindow.setScene(null);
                 }
 
                 // Set the "window" on the new scene. This will also trigger
                 // scene's peer creation.
-                newScene.impl_setWindow(Window.this);
+                SceneHelper.setWindow(newScene, Window.this);
                 // Set scene impl on stage impl
-                updatePeerScene(newScene.impl_getPeer());
+                updatePeerScene(SceneHelper.getPeer(newScene));
 
                 // Fix for RT-15432: we should update new Scene's stylesheets, if the
                 // window is already showing. For not yet shown windows, the update is
                 // performed in doVisibleChanging()
                 if (isShowing()) {
                     newScene.getRoot().impl_reapplyCSS();
 
                     if (!widthExplicit || !heightExplicit) {
-                        getScene().impl_preferredSize();
+                        SceneHelper.preferredSize(getScene());
                         adjustSize(true);
                     }
                 }
             }
 

@@ -1064,13 +1065,13 @@
                     peer.setTKStageListener(peerListener);
                     // Register pulse listener
                     tk.addStageTkPulseListener(peerBoundsConfigurator);
 
                     if (getScene() != null) {
-                        getScene().impl_initPeer();
-                        peer.setScene(getScene().impl_getPeer());
-                        getScene().impl_preferredSize();
+                        SceneHelper.initPeer(getScene());
+                        peer.setScene(SceneHelper.getPeer(getScene()));
+                        SceneHelper.preferredSize(getScene());
                     }
 
                     updateOutputScales(peer.getOutputScaleX(), peer.getOutputScaleY());
                     // updateOutputScales may cause an update to the render
                     // scales in many cases, but if the scale has not changed

@@ -1111,11 +1112,11 @@
                     // Call listener
                     fireEvent(new WindowEvent(Window.this, WindowEvent.WINDOW_HIDDEN));
 
                     if (getScene() != null) {
                         peer.setScene(null);
-                        getScene().impl_disposePeer();
+                        SceneHelper.disposePeer(getScene());
                         StyleManager.getInstance().forget(getScene());
                     }
 
                     // Remove toolkit pulse listener
                     tk.removeStageTkPulseListener(peerBoundsConfigurator);