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 | |
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.
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | javax/swing/ScrollPaneLayout.java | 2 | ||||
-rw-r--r-- | javax/swing/ViewportLayout.java | 14 |
3 files changed, 16 insertions, 10 deletions
@@ -1,3 +1,13 @@ +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. + 2006-04-28 Sven de Marothy <sven@physto.se> * java/awt/image/ReplicateScaleFilter.java: Fix comment. diff --git a/javax/swing/ScrollPaneLayout.java b/javax/swing/ScrollPaneLayout.java index 9f6829f4d..da8f03afb 100644 --- a/javax/swing/ScrollPaneLayout.java +++ b/javax/swing/ScrollPaneLayout.java @@ -328,7 +328,7 @@ public class ScrollPaneLayout // parent is no JScrollPane, so do we. JScrollPane sc = (JScrollPane) parent; JViewport viewport = sc.getViewport(); - Dimension viewSize = viewport.getViewSize(); + Dimension viewSize = viewport.getView().getPreferredSize(); int x1 = 0, x2 = 0, x3 = 0, x4 = 0; int y1 = 0, y2 = 0, y3 = 0, y4 = 0; 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. |