Hi there,
I fixed a bug in the RepaintManager. Until now, the RepaintManager
iterated over all invalid components and simply called validate() on it.
However, it should not validate() the invalid components directly, but
instead search the component's validate root (see
JComponent.isValidateRoot() for details) and validate that. This is
fixed by this patch. This should give us some performance gain, since it
avoids unnecessary multiple validations.
2006-01-05 Roman Kennke <[EMAIL PROTECTED]>
* javax/swing/RepaintManager.java
(validateInvalidComponents): Search for the validate root
and start validating there.
/Roman
Index: javax/swing/RepaintManager.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/RepaintManager.java,v
retrieving revision 1.19
diff -u -r1.19 RepaintManager.java
--- javax/swing/RepaintManager.java 21 Nov 2005 14:01:43 -0000 1.19
+++ javax/swing/RepaintManager.java 5 Jan 2006 16:25:14 -0000
@@ -534,7 +534,14 @@
}
for (Iterator i = workInvalidComponents.iterator(); i.hasNext(); )
{
- JComponent comp = (JComponent) i.next();
+ Component comp = (Component) i.next();
+ // Find validate root.
+ while (!(comp instanceof JComponent)
+ || !((JComponent) comp).isValidateRoot()
+ && comp.getParent() != null)
+ comp = comp.getParent();
+
+ // Validate the validate root.
if (! (comp.isVisible() && comp.isShowing()))
continue;
comp.validate();
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches