The attached patch makes painting in Swing a little more correct by
letting the JRootPane override isOptimizedDrawingEnabled. This is now
implemented to return true only when the glassPane is invisible.
Otherwise, the glassPane overlays the rest of the JRootPane and must
always be considered when painting.

2006-02-23  Roman Kennke  <[EMAIL PROTECTED]>

        * javax/swing/JRootPane.java
        (isOptimizedDrawingEnabled): Implemented to return true
        when the glassPane is not visible.

/Roman
Index: javax/swing/JRootPane.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JRootPane.java,v
retrieving revision 1.35
diff -u -r1.35 JRootPane.java
--- javax/swing/JRootPane.java	18 Feb 2006 14:01:16 -0000	1.35
+++ javax/swing/JRootPane.java	24 Feb 2006 00:11:45 -0000
@@ -660,4 +660,18 @@
     windowDecorationStyle = style;
     firePropertyChange("windowDecorationStyle", oldStyle, style);
   }
+
+  /**
+   * This returns <code>true</code> if the <code>glassPane</code> is not
+   * visible because then the root pane can guarantee to tile its children
+   * (the only other direct child is a JLayeredPane which must figure its
+   * <code>optimizeDrawingEnabled</code> state on its own).
+   *
+   * @return <code>true</code> if the <code>glassPane</code> is not
+   *         visible
+   */
+  public boolean isOptimizedDrawingEnable()
+  {
+    return ! glassPane.isVisible();
+  }
 }

Reply via email to