I introduced a slight error, that skipped child components, that were
actually in the current clip and painted all others. Of course, it must
be the other way around, we must skip child components that don't hit
the current clip.

I also added another small fix, that immediately returns from setVisible,
if the actual value does not change. Most importantly this avoids some
revalidations which are usually quite expensive.

2005-10-10  Roman Kennke  <[EMAIL PROTECTED]>

        * javax/swing/JComponent.java
        (paintChildren): Skip children if their clip _doesn't_ hit the
        current clip.
        (setVisible): Do nothing if the actual value didn't change.

/Roman
Index: javax/swing/JComponent.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JComponent.java,v
retrieving revision 1.66
diff -u -r1.66 JComponent.java
--- javax/swing/JComponent.java	10 Oct 2005 08:53:27 -0000	1.66
+++ javax/swing/JComponent.java	10 Oct 2005 12:21:02 -0000
@@ -1536,6 +1536,7 @@
 
         if (g.hitClip(bounds.x, bounds.y, bounds.width, bounds.height))
           continue;
+
         boolean translated = false;
         try
           {
@@ -2333,6 +2334,10 @@
    */
   public void setVisible(boolean v)
   {
+    // No need to do anything if the actual value doesn't change.
+    if (isVisible() == v)
+      return;
+
     super.setVisible(v);
     Container parent = getParent();
     if (parent != null)
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to