Revision: 4041
          http://vexi.svn.sourceforge.net/vexi/?rev=4041&view=rev
Author:   clrg
Date:     2011-02-24 00:43:58 +0000 (Thu, 24 Feb 2011)

Log Message:
-----------
Add dynamic layout check/set and remove debugging System.out.println

Modified Paths:
--------------
    trunk/org.vexi-core.main/src/main/java/org/vexi/plat/Swing.java

Modified: trunk/org.vexi-core.main/src/main/java/org/vexi/plat/Swing.java
===================================================================
--- trunk/org.vexi-core.main/src/main/java/org/vexi/plat/Swing.java     
2011-02-22 01:01:50 UTC (rev 4040)
+++ trunk/org.vexi-core.main/src/main/java/org/vexi/plat/Swing.java     
2011-02-24 00:43:58 UTC (rev 4041)
@@ -55,6 +55,7 @@
 import java.awt.image.PixelGrabber;
 import java.io.File;
 import java.io.InputStream;
+import java.lang.reflect.Method;
 
 import javax.swing.ImageIcon;
 import javax.swing.JFrame;
@@ -74,6 +75,18 @@
 
 /** Platform subclass for all VM's providing AWT+Swing 1.4 functionality */
 public class Swing extends JVM {
+    
+    static {
+        try {
+            Toolkit t = java.awt.Toolkit.getDefaultToolkit();
+            if (t.getDesktopProperty("awt.dynamicLayoutSupported") == 
Boolean.TRUE) {
+                t.setDynamicLayout(true);
+            }
+        } catch (Exception e) {
+            Log.system.warn(Swing.class, "Exception while trying to enable AWT 
Dynamic Layout");
+            Log.system.warn(Swing.class, e);
+        }
+    }
 
     protected String getDescriptiveName() {
         return "Generic JDK 1.4+ with AWT+Swing";
@@ -514,8 +527,8 @@
         class InnerIcon extends ImageIcon {
             public InnerIcon(Image buffer) { super(buffer); }
             public void paintIcon(Component c, Graphics g, int x, int y) {
-                // need to synchronize as painting may occur during
-                // render() which will result in ugly flicker
+                // need to synchronize to prevent painting during render()
+                // which results in ugly flicker when resizing frames
                 synchronized (buffersync) {
                     super.paintIcon(c, g, x, y);
                 }
@@ -827,7 +840,7 @@
             } catch (UnsupportedOperationException e) {
                 Log.system.warn(this, "setCompositionEnabled() failed. Are you 
running OS X?");
             }
-            System.out.println(toString()+" constructed");
+            //System.out.println(toString()+" constructed");
         }
 
         // IMPORTANT: makeVisible must be called before render()


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to