This is the mail archive of the mauve-patches@sourceware.org mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: New BoxLayout test


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);
       }
   }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]