diff options
author | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-17 18:09:40 +0000 |
---|---|---|
committer | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-17 18:09:40 +0000 |
commit | 2d8cf20d0d5ca6b1fbdefc22229d4b7cf1497ede (patch) | |
tree | c976ca91e3ef0bda3b34b37c0195145638d8d08e /libjava/classpath/javax/swing/RepaintManager.java | |
parent | a3ef37ddfeddcc5b0f1c5068d8fdeb25a302d5cd (diff) | |
download | ppe42-gcc-2d8cf20d0d5ca6b1fbdefc22229d4b7cf1497ede.tar.gz ppe42-gcc-2d8cf20d0d5ca6b1fbdefc22229d4b7cf1497ede.zip |
Imported GNU Classpath 0.20
* Makefile.am (AM_CPPFLAGS): Add classpath/include.
* java/nio/charset/spi/CharsetProvider.java: New override file.
* java/security/Security.java: Likewise.
* sources.am: Regenerated.
* Makefile.in: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109831 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/javax/swing/RepaintManager.java')
-rw-r--r-- | libjava/classpath/javax/swing/RepaintManager.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/libjava/classpath/javax/swing/RepaintManager.java b/libjava/classpath/javax/swing/RepaintManager.java index b857b126180..0be81053dc5 100644 --- a/libjava/classpath/javax/swing/RepaintManager.java +++ b/libjava/classpath/javax/swing/RepaintManager.java @@ -48,6 +48,7 @@ import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; +import java.util.WeakHashMap; /** * <p>The repaint manager holds a set of dirty regions, invalid components, @@ -68,7 +69,7 @@ public class RepaintManager /** * The current repaint managers, indexed by their ThreadGroups. */ - static HashMap currentRepaintManagers; + static WeakHashMap currentRepaintManagers; /** * <p>A helper class which is placed into the system event queue at @@ -286,7 +287,7 @@ public class RepaintManager public static RepaintManager currentManager(Component component) { if (currentRepaintManagers == null) - currentRepaintManagers = new HashMap(); + currentRepaintManagers = new WeakHashMap(); ThreadGroup threadGroup = Thread.currentThread().getThreadGroup(); RepaintManager currentManager = (RepaintManager) currentRepaintManagers.get(threadGroup); @@ -330,7 +331,7 @@ public class RepaintManager public static void setCurrentManager(RepaintManager manager) { if (currentRepaintManagers == null) - currentRepaintManagers = new HashMap(); + currentRepaintManagers = new WeakHashMap(); ThreadGroup threadGroup = Thread.currentThread().getThreadGroup(); currentRepaintManagers.put(threadGroup, manager); @@ -533,7 +534,14 @@ public class RepaintManager } 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(); |