diff options
author | Anthony Balkissoon <abalkiss@redhat.com> | 2005-11-17 20:56:37 +0000 |
---|---|---|
committer | Anthony Balkissoon <abalkiss@redhat.com> | 2005-11-17 20:56:37 +0000 |
commit | e8df1aa9e2293f87eb4b27e30012206be507063e (patch) | |
tree | 38f39764493c33f5b3dd6ec8338ed28b184abcd3 | |
parent | 84a98fbb140d95f40590611670c4ede4748faabf (diff) | |
download | classpath-e8df1aa9e2293f87eb4b27e30012206be507063e.tar.gz |
2005-11-17 Anthony Balkissoon <abalkiss@redhat.com>
* javax/swing/text/BoxView.java:
(modelToView): New API method.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | javax/swing/text/BoxView.java | 18 |
2 files changed, 23 insertions, 0 deletions
@@ -1,3 +1,8 @@ +2005-11-17 Anthony Balkissoon <abalkiss@redhat.com> + + * javax/swing/text/BoxView.java: + (modelToView): New API method. + 2005-11-17 Lillian Angel <langel@redhat.com> Fixes PR classpath/PR24721 diff --git a/javax/swing/text/BoxView.java b/javax/swing/text/BoxView.java index 0bdd14d0a..5c9587dfe 100644 --- a/javax/swing/text/BoxView.java +++ b/javax/swing/text/BoxView.java @@ -740,4 +740,22 @@ public class BoxView yLayoutValid = false; super.preferenceChanged(child, width, height); } + + /** + * Maps the document model position <code>pos</code> to a Shape + * in the view coordinate space. This method overrides CompositeView's + * method to make sure the children are allocated properly before + * calling the super's behaviour. + */ + public Shape modelToView(int pos, Shape a, Position.Bias bias) + throws BadLocationException + { + // Make sure everything is allocated properly and then call super + if (!isAllocationValid()) + { + Rectangle bounds = a.getBounds(); + setSize(bounds.width, bounds.height); + } + return super.modelToView(pos, a, bias); + } } |