src/macosx/classes/sun/lwawt/LWToolkit.java

Print this page

        

@@ -51,11 +51,16 @@
     private int runState = STATE_NONE;
 
     private Clipboard clipboard;
     private MouseInfoPeer mouseInfoPeer;
 
-    public LWToolkit() {
+    /**
+     * Dynamic Layout Resize client code setting.
+     */
+    private volatile boolean dynamicLayoutSetting = true;
+
+    protected LWToolkit() {
     }
 
     /*
      * This method is called by subclasses to start this toolkit
      * by launching the message loop.

@@ -559,6 +564,39 @@
     public void ungrab(Window w) {
         if (w.getPeer() != null) {
             ((LWWindowPeer)w.getPeer()).ungrab(false);
         }
     }
+
+    @Override
+    protected final Object lazilyLoadDesktopProperty(final String name) {
+        if (name.equals("awt.dynamicLayoutSupported")) {
+            return isDynamicLayoutSupported();
+        }
+        return super.lazilyLoadDesktopProperty(name);
+    }
+
+    @Override
+    public final void setDynamicLayout(final boolean dynamic) {
+        dynamicLayoutSetting = dynamic;
+    }
+
+    @Override
+    protected final boolean isDynamicLayoutSet() {
+        return dynamicLayoutSetting;
+    }
+
+    @Override
+    public final boolean isDynamicLayoutActive() {
+        // "Live resizing" is active by default and user's data is ignored.
+        return isDynamicLayoutSupported();
+    }
+
+    /**
+     * Returns true if dynamic layout of Containers on resize is supported by
+     * the underlying operating system and/or window manager.
+     */
+    protected final boolean isDynamicLayoutSupported() {
+        // "Live resizing" is supported by default.
+        return true;
+    }
 }