diff options
author | Roman Kennke <roman@kennke.org> | 2006-10-18 10:01:30 +0000 |
---|---|---|
committer | Roman Kennke <roman@kennke.org> | 2006-10-18 10:01:30 +0000 |
commit | 49c937afb1162a2579a3bd12302d152f2017d5c4 (patch) | |
tree | 4fd5b1a17e605e8c321854a4928593ee0e658506 | |
parent | 04349d7540f6b8b504f5123624c62a7074fa3c26 (diff) | |
download | classpath-49c937afb1162a2579a3bd12302d152f2017d5c4.tar.gz |
2006-10-18 Roman Kennke <kennke@aicas.com>
* javax/swing/RepaintManager.java
(RepaintWorkerEvent): Pass full set of params to super.
(RepaintWorker.dispatch): Overridden to allow apps to call this
via reflection.
(addDirtyRegion): Synchronize a little more to protect the
dirtyComponents field and avoid NPEs.
(invokeLater): Pass full set of params to RepaintWorkerEvent
constructor.
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | javax/swing/RepaintManager.java | 36 |
2 files changed, 36 insertions, 11 deletions
@@ -1,5 +1,16 @@ 2006-10-18 Roman Kennke <kennke@aicas.com> + * javax/swing/RepaintManager.java + (RepaintWorkerEvent): Pass full set of params to super. + (RepaintWorker.dispatch): Overridden to allow apps to call this + via reflection. + (addDirtyRegion): Synchronize a little more to protect the + dirtyComponents field and avoid NPEs. + (invokeLater): Pass full set of params to RepaintWorkerEvent + constructor. + +2006-10-18 Roman Kennke <kennke@aicas.com> + * javax/swing/JEditorPane.java (page): Removed field. The page is now stored in the correct document property. diff --git a/javax/swing/RepaintManager.java b/javax/swing/RepaintManager.java index c2b9935c6..026fbe305 100644 --- a/javax/swing/RepaintManager.java +++ b/javax/swing/RepaintManager.java @@ -69,6 +69,7 @@ import java.util.WeakHashMap; * <p>See <a * href="http://java.sun.com/products/jfc/tsc/articles/painting/index.html">this * document</a> for more details.</p> + * document</a> for more details.</p> * * @author Roman Kennke (kennke@aicas.com) * @author Graydon Hoare (graydon@redhat.com) @@ -96,9 +97,21 @@ public class RepaintManager * @param source the source * @param runnable the runnable to execute */ - public RepaintWorkerEvent(Object source, Runnable runnable) + public RepaintWorkerEvent(Object source, Runnable runnable, + Object notifier, boolean catchEx) + { + super(source, runnable, notifier, catchEx); + } + + /** + * An application that I met implements its own event dispatching and + * calls dispatch() via reflection, and only checks declared methods, + * that is, it expects this method to be in the event's class, not + * in a superclass. So I put this in here... sigh. + */ + public void dispatch() { - super(source, runnable); + super.dispatch(); } } @@ -419,15 +432,16 @@ public class RepaintManager if (! rectCache.isEmpty()) { - if (dirtyComponents.containsKey(component)) - { - SwingUtilities.computeUnion(rectCache.x, rectCache.y, - rectCache.width, rectCache.height, - (Rectangle) dirtyComponents.get(component)); - } - else + synchronized (dirtyComponents) { - synchronized (dirtyComponents) + Rectangle dirtyRect = (Rectangle)dirtyComponents.get(component); + if (dirtyRect != null) + { + SwingUtilities.computeUnion(rectCache.x, rectCache.y, + rectCache.width, rectCache.height, + dirtyRect); + } + else { dirtyComponents.put(component, rectCache.getBounds()); } @@ -838,7 +852,7 @@ public class RepaintManager { Toolkit tk = Toolkit.getDefaultToolkit(); EventQueue evQueue = tk.getSystemEventQueue(); - InvocationEvent ev = new RepaintWorkerEvent(this, runnable); + InvocationEvent ev = new RepaintWorkerEvent(evQueue, runnable, null, false); evQueue.postEvent(ev); } } |