This is the mail archive of the
mauve-patches@sourceware.org
mailing list for the Mauve project.
FYI: New BoxLayout test
- From: "Roman Kennke" <kennke at aicas dot com>
- To: mauve-patches at sources dot redhat dot com
- Date: Fri, 04 Nov 2005 11:05:46 +0000
- Subject: FYI: New BoxLayout test
- Bounce-to: "Roman Kennke" <kennke@aicas.com>
I added a new test to the BoxLayout testsuite which covers an overflow
case that I have here.
2005-11-04 Roman Kennke <kennke@aicas.com>
* gnu/testlet/javax/swing/BoxLayout/layoutContainer.java: Added
new
test for overflow case.
/Roman
Index: javax/swing/BoxLayout.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/BoxLayout.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- javax/swing/BoxLayout.java 24 Oct 2005 08:59:54 -0000 1.24
+++ javax/swing/BoxLayout.java 2 Nov 2005 11:47:57 -0000 1.25
@@ -141,6 +141,9 @@
*/
public BoxLayout(Container container, int way)
{
+ if (way != X_AXIS && way != Y_AXIS && way != LINE_AXIS && way != PAGE_AXIS)
+ throw new AWTError("Invalid axis");
+
int width = 0;
int height = 0;
this.container = container;
@@ -216,7 +219,9 @@
throw new AWTError("BoxLayout can't be shared");
checkTotalRequirements();
- return new Dimension(xTotal.minimum, yTotal.minimum);
+ Insets i = container.getInsets();
+ return new Dimension(xTotal.minimum + i.left + i.right,
+ yTotal.minimum + i.top + i.bottom);
}
}
@@ -297,6 +302,9 @@
*/
public void invalidateLayout(Container parent)
{
+ if (container != parent)
+ throw new AWTError("BoxLayout can't be shared");
+
synchronized (container.getTreeLock())
{
xChildren = null;
@@ -326,7 +334,9 @@
throw new AWTError("BoxLayout can't be shared");
checkTotalRequirements();
- return new Dimension(xTotal.maximum, yTotal.maximum);
+ Insets i = container.getInsets();
+ return new Dimension(xTotal.maximum + i.left + i.right,
+ yTotal.maximum + i.top + i.bottom);
}
}