summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAudrius Meskauskas <audriusa@Bioinformatics.org>2006-04-28 19:07:33 +0000
committerAudrius Meskauskas <audriusa@Bioinformatics.org>2006-04-28 19:07:33 +0000
commit3116d4f1e7c18e596d665c9b90f974bb04a586cc (patch)
tree3d7c9bc65acd500d5a1bcd0aa62082d60120ed1e
parentc9f456d1935e0d5aa9611ddc6287697bb76aafb7 (diff)
downloadclasspath-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--ChangeLog10
-rw-r--r--javax/swing/ScrollPaneLayout.java2
-rw-r--r--javax/swing/ViewportLayout.java14
3 files changed, 16 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index f28507c22..4677998e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.