Change AbstractManagedWindowContainer's background color to white?

Clemens Eisserer linuxhippy at gmail.com
Tue Aug 16 11:18:32 PDT 2011


Hi Roman

not sure. What about configurable with default to white?
>
What do you think about the patch?
FullScreenWindowFactory.screenSize is also initialized this way, I think a
sys-property isn't that bad?


> Will deploy the latest code today. I also have some small modifications
> to commit, and some enhancements to code. Overall I am totally impressed
> by the whole project.
>

Looking forward to see your changes =)

Thanks, Clemens


---
old/src/share/classes/sun/awt/peer/cacio/managed/AbstractManagedWindowContainer.java
2011-08-16 20:00:59.834391838 +0200
+++
new/src/share/classes/sun/awt/peer/cacio/managed/AbstractManagedWindowContainer.java
2011-08-16 20:00:59.746392939 +0200
@@ -33,9 +33,11 @@
 import java.awt.event.MouseEvent;
 import java.awt.event.KeyEvent;
 import java.awt.geom.Rectangle2D;
+import java.security.*;
 import java.util.LinkedList;
 import java.util.Iterator;
 import sun.awt.peer.cacio.CacioComponent;
+import sun.security.action.*;

 /**
  * A base implementation of {@link ManagedWindowContainer}. This can be
@@ -46,6 +48,19 @@
 abstract class AbstractManagedWindowContainer
     implements ManagedWindowContainer {

+    private static final Color backgroundColor;
+    static {
+    String bgString = AccessController.doPrivileged(new GetPropertyAction("
cacio.managed.bg", "WHITE")).toUpperCase();
+
+    Color bgColor = Color.WHITE;
+    try {
+        bgColor = (Color) Color.class.getField(bgString).get(null);
+    } catch (Exception ex) {
+        System.out.println("Color specified in cacio.managed.bg not found,
defaulting to WHITE");
+    }
+    backgroundColor = bgColor;
+    }
+
     /**
      * The child windows of this container.
      */
@@ -220,7 +235,7 @@
                 }
             }
         }
-        Graphics2D g = getClippedGraphics(Color.BLACK, Color.BLACK,
+        Graphics2D g = getClippedGraphics(backgroundColor, backgroundColor,
                                           new Font(Font.DIALOG, Font.BOLD,
12),
                                           rects);
         g.clearRect(x, y, w, h);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/caciocavallo-dev/attachments/20110816/c5f81ecb/attachment.html 


More information about the caciocavallo-dev mailing list