diff options
author | Audrius Meskauskas <audriusa@Bioinformatics.org> | 2006-04-28 19:07:33 +0000 |
---|---|---|
committer | Audrius Meskauskas <audriusa@Bioinformatics.org> | 2006-04-28 19:07:33 +0000 |
commit | 3116d4f1e7c18e596d665c9b90f974bb04a586cc (patch) | |
tree | 3d7c9bc65acd500d5a1bcd0aa62082d60120ed1e /javax/swing/ViewportLayout.java | |
parent | c9f456d1935e0d5aa9611ddc6287697bb76aafb7 (diff) | |
download | classpath-3116d4f1e7c18e596d665c9b90f974bb04a586cc.tar.gz |
2006-04-28 Audrius Meskauskas <AudriusA@Bioinformatics.org>
PR 27296
* javax/swing/ScrollPaneLayout.java (layoutContainer):
Decide about scroll bars from the preferred view size, not
the current size.
* javax/swing/ViewportLayout.java (layoutContainer):
Do not change returned preferred size. Do not treat JScrollPane
specially.
Diffstat (limited to 'javax/swing/ViewportLayout.java')
-rw-r--r-- | javax/swing/ViewportLayout.java | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/javax/swing/ViewportLayout.java b/javax/swing/ViewportLayout.java index 67b69eb28..b61834e9e 100644 --- a/javax/swing/ViewportLayout.java +++ b/javax/swing/ViewportLayout.java @@ -158,7 +158,7 @@ public class ViewportLayout implements LayoutManager, Serializable // the viewport require inputs in view space. Rectangle portBounds = port.getViewRect(); - Dimension viewPref = view.getPreferredSize(); + Dimension viewPref = new Dimension(view.getPreferredSize()); Point portLowerRight = new Point(portBounds.x + portBounds.width, portBounds.y + portBounds.height); @@ -182,14 +182,10 @@ public class ViewportLayout implements LayoutManager, Serializable } } - // The scroll pane manages the view size itself. - if (! (port.getParent() instanceof JScrollPane) ) - { - if (viewPref.width < portBounds.width) - viewPref.width = portBounds.width; - if (viewPref.height < portBounds.height) - viewPref.height = portBounds.height; - } + if (viewPref.width < portBounds.width) + viewPref.width = portBounds.width; + if (viewPref.height < portBounds.height) + viewPref.height = portBounds.height; // If the view is larger than the port, the port is top and right // aligned. |