A small fix for BasicText which removes one unnecessary call to
setParent(null) on the new root view. This would possible confuse the
view that is set, setParent(null) is usually the last call to a view,
here it would have been one of the first calls.
2006-02-21 Roman Kennke <[EMAIL PROTECTED]>
* javax/swing/plaf/basic/BasicTextUI.java
(RootView.setView): Call setParent() on the view with this as
argument instead of null.
(setView): Don't set root view's parent here.
/Roman
Index: javax/swing/plaf/basic/BasicTextUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicTextUI.java,v
retrieving revision 1.70
diff -u -r1.70 BasicTextUI.java
--- javax/swing/plaf/basic/BasicTextUI.java 21 Feb 2006 10:57:43 -0000 1.70
+++ javax/swing/plaf/basic/BasicTextUI.java 21 Feb 2006 14:01:30 -0000
@@ -179,7 +179,7 @@
view.setParent(null);
if (v != null)
- v.setParent(null);
+ v.setParent(this);
view = v;
}
@@ -964,7 +964,7 @@
// The reference implementation does not throw an exception, too.
p0 = Math.min(p0, t.getDocument().getLength());
p1 = Math.min(p1, t.getDocument().getLength());
-
+
Rectangle l1 = modelToView(t, p0, firstBias);
Rectangle l2 = modelToView(t, p1, secondBias);
if (l1.y == l2.y)
@@ -1217,7 +1217,6 @@
protected final void setView(View view)
{
rootView.setView(view);
- view.setParent(rootView);
textComponent.revalidate();
textComponent.repaint();
}