summaryrefslogtreecommitdiff
path: root/javax/swing/plaf/basic
diff options
context:
space:
mode:
authorRoman Kennke <roman@kennke.org>2006-12-06 20:21:06 +0000
committerRoman Kennke <roman@kennke.org>2006-12-06 20:21:06 +0000
commit5e741748dd0b54d0523d6f53602c706fc679f700 (patch)
tree937fc26596e43e8b84591423efedab05c3d7c9ee /javax/swing/plaf/basic
parent328fe8b0cb8191641275a4a43c426cb6ce88305f (diff)
downloadclasspath-5e741748dd0b54d0523d6f53602c706fc679f700.tar.gz
2006-12-06 Roman Kennke <kennke@aicas.com>
* javax/swing/JEditorPane.java (getStream): Buffer the stream for efficiency. (setPage): Don't scroll the view at this point. * javax/swing/plaf/basic/BasicTextUI.java (RootView.paint): Call RootView's setSize to get synchronization. (RootView.setSize): Synchronize to prevent race in layout code. * javax/swing/text/AbstractDocument.java (notifyListeners): New field. (fireChangedUpdate): Track notifyListener field. (fireRemoveUpdate): Track notifyListener field. (fireIndertUpdate): Track notifyListener field. (writeLock): Check notifyListener and throw IllegalStateException. * javax/swing/text/View.java (preferenceChanged): Create local var for better thread safety and more efficiency.
Diffstat (limited to 'javax/swing/plaf/basic')
-rw-r--r--javax/swing/plaf/basic/BasicTextUI.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/javax/swing/plaf/basic/BasicTextUI.java b/javax/swing/plaf/basic/BasicTextUI.java
index d4e43c60e..e152a3034 100644
--- a/javax/swing/plaf/basic/BasicTextUI.java
+++ b/javax/swing/plaf/basic/BasicTextUI.java
@@ -362,7 +362,12 @@ public abstract class BasicTextUI extends TextUI
return textComponent;
}
- public void setSize(float w, float h)
+ /**
+ * Sets the size of the renderer. This is synchronized because that
+ * potentially triggers layout and we don't want more than one thread
+ * playing with the layout information.
+ */
+ public synchronized void setSize(float w, float h)
{
if (view != null)
view.setSize(w, h);
@@ -379,7 +384,7 @@ public abstract class BasicTextUI extends TextUI
if (view != null)
{
Rectangle b = s instanceof Rectangle ? (Rectangle) s : s.getBounds();
- view.setSize(b.width, b.height);
+ setSize(b.width, b.height);
view.paint(g, s);
}
}