harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r479240 [26/28] - /harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/
Date Sun, 26 Nov 2006 00:04:16 GMT
Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpinnerDateModelTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpinnerDateModelTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpinnerDateModelTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpinnerDateModelTest.java Sat Nov 25 16:04:10 2006
@@ -18,7 +18,6 @@
  * @author Dennis Ushakov
  * @version $Revision$
  */
-
 package javax.swing;
 
 import java.util.Calendar;
@@ -27,17 +26,20 @@
 
 public class SpinnerDateModelTest extends BasicSwingTestCase {
     private SpinnerDateModel model;
+
     private ChangeController chl;
 
     private Date now;
+
     private Date past;
+
     private Date future;
 
+    @Override
     public void setUp() {
         model = new SpinnerDateModel();
         chl = new ChangeController(false);
         model.addChangeListener(chl);
-
         Calendar calendar = new GregorianCalendar();
         calendar.add(Calendar.DAY_OF_MONTH, -1);
         now = calendar.getTime();
@@ -47,6 +49,7 @@
         future = calendar.getTime();
     }
 
+    @Override
     public void tearDown() {
         model = null;
         chl = null;
@@ -60,23 +63,26 @@
         assertEquals(Calendar.DAY_OF_MONTH, model.getCalendarField());
         assertNull(model.getStart());
         assertNull(model.getEnd());
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model = new SpinnerDateModel(null, null, null, Calendar.DAY_OF_MONTH);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model = new SpinnerDateModel(now, future, null, Calendar.DAY_OF_MONTH);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model = new SpinnerDateModel(now, null, past, Calendar.DAY_OF_MONTH);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model = new SpinnerDateModel(now, null, null, 666);
             }
@@ -87,10 +93,8 @@
         model.setStart(past);
         assertTrue(chl.isChanged());
         assertSame(past, model.getStart());
-
         model.setValue(now);
         model.setStart(future);
-
         model.setStart(now);
         chl.reset();
         model.setStart(now);
@@ -101,10 +105,8 @@
         model.setEnd(future);
         assertTrue(chl.isChanged());
         assertSame(future, model.getEnd());
-
         model.setValue(now);
         model.setEnd(past);
-
         model.setEnd(now);
         chl.reset();
         model.setEnd(now);
@@ -117,21 +119,20 @@
         assertNotSame(now, model.getValue());
         assertEquals(now, model.getValue());
         assertNotSame(model.getValue(), model.getValue());
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model.setValue(null);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model.setValue("test");
             }
         });
-
         model.setEnd(past);
         model.setValue(now);
-
         model.setValue(now);
         chl.reset();
         model.setValue(now);
@@ -148,13 +149,12 @@
         model.setCalendarField(Calendar.ERA);
         assertTrue(chl.isChanged());
         assertEquals(Calendar.ERA, model.getCalendarField());
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model.setCalendarField(666);
             }
         });
-
         model.setCalendarField(Calendar.DAY_OF_WEEK);
         chl.reset();
         model.setCalendarField(Calendar.DAY_OF_WEEK);
@@ -166,12 +166,10 @@
         model.setEnd(future);
         now.setDate(now.getDate() + 1);
         assertEquals(now, model.getNextValue());
-
         now.setDate(now.getDate() - 1);
         model.setCalendarField(Calendar.MINUTE);
         now.setMinutes(now.getMinutes() + 1);
         assertEquals(now, model.getNextValue());
-
         model.setCalendarField(Calendar.YEAR);
         assertNull(model.getNextValue());
     }
@@ -181,14 +179,11 @@
         model.setStart(past);
         now.setDate(now.getDate() - 1);
         assertEquals(now, model.getPreviousValue());
-
         now.setDate(now.getDate() + 1);
         model.setCalendarField(Calendar.MINUTE);
         now.setMinutes(now.getMinutes() - 1);
         assertEquals(now, model.getPreviousValue());
-
         model.setCalendarField(Calendar.YEAR);
         assertNull(model.getPreviousValue());
     }
 }
-

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpinnerListModelTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpinnerListModelTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpinnerListModelTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpinnerListModelTest.java Sat Nov 25 16:04:10 2006
@@ -18,7 +18,6 @@
  * @author Dennis Ushakov
  * @version $Revision$
  */
-
 package javax.swing;
 
 import java.util.ArrayList;
@@ -27,14 +26,17 @@
 
 public class SpinnerListModelTest extends BasicSwingTestCase {
     private SpinnerListModel model;
+
     private ChangeController chl;
 
+    @Override
     public void setUp() {
         model = new SpinnerListModel();
         chl = new ChangeController();
         model.addChangeListener(chl);
     }
 
+    @Override
     public void tearDown() {
         model = null;
         chl = null;
@@ -44,7 +46,6 @@
         List list = model.getList();
         assertNotNull(list);
         assertEquals(1, list.size());
-
         list = new ArrayList();
         list.add("listline1");
         list.add("listline2");
@@ -52,16 +53,17 @@
         model = new SpinnerListModel(list);
         assertSame(list, model.getList());
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
-                model = new SpinnerListModel((Object[])null);
+                model = new SpinnerListModel((Object[]) null);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model = new SpinnerListModel(new ArrayList());
             }
         });
-
         list.clear();
         list.add(null);
         list.add(null);
@@ -71,11 +73,11 @@
         assertNull(model.getValue());
         assertNull(model.getPreviousValue());
         assertNull(model.getNextValue());
-
-        Object[] values = {"arrline1", "arrline2", new Integer(3)};
+        Object[] values = { "arrline1", "arrline2", new Integer(3) };
         model = new SpinnerListModel(values);
         assertEquals(model.getList(), Arrays.asList(values));
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model = new SpinnerListModel(new Object[0]);
             }
@@ -86,7 +88,6 @@
         List list = model.getList();
         assertNotNull(list);
         assertEquals(1, list.size());
-
         list = new ArrayList();
         list.add(null);
         list.add(null);
@@ -107,19 +108,19 @@
         assertSame(list, model.getList());
         assertTrue(chl.isChanged());
         chl.reset();
-
         list.clear();
         list.add(new Integer(1));
         assertEquals(new Integer(1), model.getValue());
         assertFalse(chl.isChanged());
         chl.reset();
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model.setList(null);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model.setList(new ArrayList());
             }
@@ -128,7 +129,6 @@
         assertFalse(chl.isChanged());
     }
 
-
     public void testSetGetValue() {
         List list = new ArrayList();
         list.add(new Integer(1));
@@ -137,13 +137,12 @@
         model.setList(list);
         assertEquals(new Integer(1), model.getValue());
         chl.reset();
-
         Object obj = new Integer(3);
         model.setValue(obj);
         assertEquals(obj, model.getValue());
         assertTrue(chl.isChanged());
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 Object obj = new Integer(13);
                 model.setValue(obj);
@@ -158,17 +157,13 @@
         list.add(new Integer(3));
         model.setList(list);
         assertEquals(new Integer(1), model.getValue());
-
         assertNull(model.getPreviousValue());
         assertEquals(new Integer(2), model.getNextValue());
         assertEquals(new Integer(1), model.getValue());
-
         model.setValue(model.getNextValue());
         assertEquals(new Integer(3), model.getNextValue());
-
         model.setValue(model.getNextValue());
         assertEquals(new Integer(3), model.getValue());
         assertNull(model.getNextValue());
     }
 }
-

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpinnerNumberModelTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpinnerNumberModelTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpinnerNumberModelTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpinnerNumberModelTest.java Sat Nov 25 16:04:10 2006
@@ -18,20 +18,21 @@
  * @author Dennis Ushakov
  * @version $Revision$
  */
-
 package javax.swing;
 
-
 public class SpinnerNumberModelTest extends BasicSwingTestCase {
     private SpinnerNumberModel model;
+
     private ChangeController chl;
 
+    @Override
     public void setUp() {
         model = new SpinnerNumberModel();
         chl = new ChangeController();
         model.addChangeListener(chl);
     }
 
+    @Override
     public void tearDown() {
         model = null;
         chl = null;
@@ -42,25 +43,26 @@
         assertNull(model.getMinimum());
         assertEquals(new Integer(0), model.getValue());
         assertEquals(new Integer(1), model.getStepSize());
-
         final Integer val = new Integer(10);
         model = new SpinnerNumberModel(10, 10, 10, 10);
         assertEquals(val, model.getValue());
         assertEquals(val, model.getStepSize());
         assertEquals(val, model.getValue());
         assertEquals(val, model.getStepSize());
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model = new SpinnerNumberModel(null, val, val, val);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model = new SpinnerNumberModel(val, val, val, null);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model = new SpinnerNumberModel(val, val, new Integer(-1), val);
             }
@@ -72,9 +74,7 @@
         model.setMinimum(min);
         assertTrue(chl.isChanged());
         assertSame(min, model.getMinimum());
-
         model.setMinimum(new Integer(10));
-
         model.setMinimum(min);
         chl.reset();
         model.setMinimum(min);
@@ -86,9 +86,7 @@
         model.setMaximum(max);
         assertTrue(chl.isChanged());
         assertSame(max, model.getMaximum());
-
         model.setMaximum(new Integer(-10));
-
         model.setMaximum(max);
         chl.reset();
         model.setMaximum(max);
@@ -101,11 +99,11 @@
         assertTrue(chl.isChanged());
         assertSame(step, model.getStepSize());
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model.setStepSize(null);
             }
         });
-
         model.setStepSize(step);
         chl.reset();
         model.setStepSize(step);
@@ -117,19 +115,18 @@
         model.setValue(value);
         assertTrue(chl.isChanged());
         assertSame(value, model.getValue());
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model.setValue(null);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 model.setValue("test");
             }
         });
-
-
         model.setValue(value);
         chl.reset();
         model.setValue(value);
@@ -144,16 +141,13 @@
 
     public void testGetPreviousValue() {
         model.getPreviousValue();
-
         Integer value = new Integer(10);
         model.setValue(value);
         Integer min = new Integer(8);
         model.setMinimum(min);
         Integer step = new Integer(2);
         model.setStepSize(step);
-
         assertEquals(min, model.getPreviousValue());
-
         step = new Integer(3);
         model.setStepSize(step);
         assertNull(model.getPreviousValue());
@@ -161,17 +155,13 @@
 
     public void testNextValue() {
         model.getNextValue();
-
         Double value = new Double(10);
         Double max = new Double(12);
         Integer step = new Integer(2);
         model = new SpinnerNumberModel(value, null, max, step);
-
         assertEquals(max, model.getNextValue());
-
         step = new Integer(3);
         model.setStepSize(step);
         assertNull(model.getNextValue());
     }
 }
-

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpringLayoutTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpringLayoutTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpringLayoutTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpringLayoutTest.java Sat Nov 25 16:04:10 2006
@@ -22,186 +22,126 @@
 
 import java.awt.Component;
 import java.awt.Container;
-import java.awt.Rectangle;
-
 import javax.swing.SpringLayout.Constraints;
 
 public class SpringLayoutTest extends SwingTestCase {
     private Component component;
+
     private SpringLayout layout;
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
-
         layout = new SpringLayout();
         component = new JLabel("label");
     }
 
     public void testSpringLayout() {
         SpringLayout.Constraints constrains = new SpringLayout.Constraints();
-//        assertNull(constrains.getX());
-//        assertNull(constrains.getY());
+        //        assertNull(constrains.getX());
+        //        assertNull(constrains.getY());
         assertNull(constrains.getWidth());
         assertNull(constrains.getHeight());
-
-
-        constrains = new SpringLayout.Constraints(Spring.width(component),
-                                                  Spring.constant(0));
+        constrains = new SpringLayout.Constraints(Spring.width(component), Spring.constant(0));
         assertNull(constrains.getWidth());
         assertNull(constrains.getHeight());
         SpringTest.assertSizes(0, 0, 0, 0, constrains.getY());
         SpringTest.assertSizes(component.getMinimumSize().width,
-                                component.getPreferredSize().width,
-                                component.getMaximumSize().width,
-                                constrains.getX());
+                component.getPreferredSize().width, component.getMaximumSize().width,
+                constrains.getX());
         assertNull(constrains.getWidth());
         assertNull(constrains.getHeight());
-
-
         constrains = new SpringLayout.Constraints(component);
         SpringTest.assertSizes(0, 0, 0, 0, constrains.getX());
         SpringTest.assertSizes(0, 0, 0, 0, constrains.getY());
         SpringTest.assertSizes(component.getMinimumSize().width,
-                                component.getPreferredSize().width,
-                                component.getMaximumSize().width,
-                                constrains.getWidth());
+                component.getPreferredSize().width, component.getMaximumSize().width,
+                constrains.getWidth());
         SpringTest.assertSizes(component.getMinimumSize().height,
-                                component.getPreferredSize().height,
-                                component.getMaximumSize().height,
-                                constrains.getHeight());
-
-
-        constrains = new SpringLayout.Constraints(Spring.constant(1),
-                                                  Spring.constant(2),
-                                                  Spring.constant(3),
-                                                  Spring.constant(4));
+                component.getPreferredSize().height, component.getMaximumSize().height,
+                constrains.getHeight());
+        constrains = new SpringLayout.Constraints(Spring.constant(1), Spring.constant(2),
+                Spring.constant(3), Spring.constant(4));
         SpringTest.assertSizes(1, 1, 1, 1, constrains.getX());
         SpringTest.assertSizes(2, 2, 2, 2, constrains.getY());
         SpringTest.assertSizes(3, 3, 3, 3, constrains.getWidth());
         SpringTest.assertSizes(4, 4, 4, 4, constrains.getHeight());
-
         constrains = new SpringLayout.Constraints(Spring.constant(1), null);
         SpringTest.assertSizes(1, 1, 1, 1, constrains.getX());
-      //  assertNull(constrains.getY());
-
-
+        //  assertNull(constrains.getY());
         Container container = new JPanel();
         container.setLayout(layout);
         container.add(new JLabel(""));
-        constrains =  layout.getConstraints(component);
-
+        constrains = layout.getConstraints(component);
         SpringTest.assertSizes(0, 0, 0, 0, constrains.getX());
         SpringTest.assertSizes(0, 0, 0, 0, constrains.getY());
         SpringTest.assertSizes(component.getMinimumSize().width,
-                                component.getPreferredSize().width,
-                                component.getMaximumSize().width,
-                                constrains.getWidth());
+                component.getPreferredSize().width, component.getMaximumSize().width,
+                constrains.getWidth());
         SpringTest.assertSizes(component.getMinimumSize().height,
-                                component.getPreferredSize().height,
-                                component.getMaximumSize().height,
-                                constrains.getHeight());
+                component.getPreferredSize().height, component.getMaximumSize().height,
+                constrains.getHeight());
     }
 
-
     public void testRemoveLayoutComponent() {
         layout.removeLayoutComponent(null);
         layout.removeLayoutComponent(new JLabel());
-
-        layout.addLayoutComponent(component,
-                                  new SpringLayout.Constraints(component));
+        layout.addLayoutComponent(component, new SpringLayout.Constraints(component));
         layout.removeLayoutComponent(null);
         layout.removeLayoutComponent(new JLabel());
-
         JPanel panel = new JPanel();
         panel.add(component);
         assertSame(panel, component.getParent());
         layout.removeLayoutComponent(component);
         assertNotNull(component.getParent());
-
         Constraints constraints = layout.getConstraints(component);
         SpringTest.assertSizes(0, 0, 0, 0, constraints.getX());
         SpringTest.assertSizes(0, 0, 0, 0, constraints.getY());
     }
 
-   public void testGetLayoutAlignmentX() {
+    public void testGetLayoutAlignmentX() {
         new JPanel().add(component);
-
         assertEquals(0.5f, layout.getLayoutAlignmentX(null), 0.01);
-        assertEquals(0.5f, layout.getLayoutAlignmentX(component.getParent()),
-                     0.01);
+        assertEquals(0.5f, layout.getLayoutAlignmentX(component.getParent()), 0.01);
     }
 
     public void testGetLayoutAlignmentY() {
         new JPanel().add(component);
         assertEquals(0.5f, layout.getLayoutAlignmentY(null), 0.01);
-        assertEquals(0.5f, layout.getLayoutAlignmentY(component.getParent()),
-                     0.01);
-    }
-
-    private void assertLocation(final int x, final int y,
-                              final Rectangle bounds) {
-
-        assertEquals(x, bounds.x);
-        assertEquals(y, bounds.y);
-    }
-
-    private void assertSize(final int width, final int height,
-                            final Rectangle bounds) {
-
-        assertEquals(width, bounds.width);
-        assertEquals(height, bounds.height);
+        assertEquals(0.5f, layout.getLayoutAlignmentY(component.getParent()), 0.01);
     }
 
-    private void assertBounds(final int x, final int y,
-                              final int width, final int height,
-                              final Rectangle bounds) {
-        assertLocation(x, y, bounds);
-        assertSize(x, y, bounds);
-    }
     public void testGetConstraints_ForComponent() {
         layout.addLayoutComponent(component, "not_constraints");
         Constraints constraints = layout.getConstraints(component);
-
         assertNotNull(constraints);
         SpringTest.assertSizes(0, 0, 0, constraints.getX());
         SpringTest.assertSizes(0, 0, 0, constraints.getY());
         SpringTest.assertSizes(component.getMinimumSize().width,
-                                component.getPreferredSize().width,
-                                component.getMaximumSize().width,
-                                constraints.getWidth());
+                component.getPreferredSize().width, component.getMaximumSize().width,
+                constraints.getWidth());
         SpringTest.assertSizes(component.getMinimumSize().height,
-                                component.getPreferredSize().height,
-                                component.getMaximumSize().height,
-                                constraints.getHeight());
-
+                component.getPreferredSize().height, component.getMaximumSize().height,
+                constraints.getHeight());
         layout = new SpringLayout();
         layout.addLayoutComponent(component, null);
         constraints = layout.getConstraints(component);
-
         assertNotNull(constraints);
         SpringTest.assertSizes(0, 0, 0, constraints.getX());
         SpringTest.assertSizes(0, 0, 0, constraints.getY());
         SpringTest.assertSizes(component.getMinimumSize().width,
-                                component.getPreferredSize().width,
-                                component.getMaximumSize().width,
-                                constraints.getWidth());
+                component.getPreferredSize().width, component.getMaximumSize().width,
+                constraints.getWidth());
         SpringTest.assertSizes(component.getMinimumSize().height,
-                                component.getPreferredSize().height,
-                                component.getMaximumSize().height,
-                                constraints.getHeight());
-
-        Constraints componentConstraints =
-            new SpringLayout.Constraints(component);
+                component.getPreferredSize().height, component.getMaximumSize().height,
+                constraints.getHeight());
+        Constraints componentConstraints = new SpringLayout.Constraints(component);
         layout.addLayoutComponent(component, constraints);
         constraints = layout.getConstraints(component);
         assertFalse(componentConstraints.equals(constraints));
-        SpringTest.assertValues(componentConstraints.getX(),
-                                constraints.getX());
-        SpringTest.assertValues(componentConstraints.getY(),
-                                constraints.getY());
-        SpringTest.assertValues(componentConstraints.getWidth(),
-                                constraints.getWidth());
-        SpringTest.assertValues(componentConstraints.getHeight(),
-                                constraints.getHeight());
+        SpringTest.assertValues(componentConstraints.getX(), constraints.getX());
+        SpringTest.assertValues(componentConstraints.getY(), constraints.getY());
+        SpringTest.assertValues(componentConstraints.getWidth(), constraints.getWidth());
+        SpringTest.assertValues(componentConstraints.getHeight(), constraints.getHeight());
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpringTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpringTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpringTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpringTest.java Sat Nov 25 16:04:10 2006
@@ -41,25 +41,22 @@
 
     final Marker componentGetMaximumSizeCalled = new Marker();
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         componentGetMinimumSizeCalled.reset();
         componentGetPreferedSizeCalled.reset();
         componentGetMaximumSizeCalled.reset();
-
         component = new JButton("test");
         initComponentSizes(component);
-
     }
 
     public void testConstant() throws Exception {
         Spring spring;
-
         spring = Spring.constant(5);
         assertSizes(5, 5, 5, 5, spring);
         spring.setValue(10);
         assertSizes(5, 5, 5, 10, spring);
-
         spring = Spring.constant(1, 2, 3);
         assertSizes(1, 2, 3, 2, spring);
         spring.setValue(10);
@@ -72,7 +69,6 @@
         assertEquals(1, spring.getValue());
         spring.setValue(Spring.UNSET);
         assertEquals(5, spring.getValue());
-
         spring = Spring.constant(2, 5, 6);
         spring.setValue(1);
         assertEquals(1, spring.getValue());
@@ -83,45 +79,33 @@
     public void testConstant_Overflow() throws Exception {
         spring = Spring.constant(4, 5, 6);
         spring.setValue(Integer.MAX_VALUE - 5);
-
-        assertEquals(Integer.MAX_VALUE - 5,  spring.getValue());
+        assertEquals(Integer.MAX_VALUE - 5, spring.getValue());
     }
 
     public void testMinus() throws Exception {
         testExceptionalCase(new NullPointerCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 Spring.minus(null).getValue();
             }
         });
-
         spring1 = Spring.constant(12, 13, 15);
         spring = Spring.minus(spring1);
-        assertSizes((-1) * spring1.getMaximumValue(), (-1)
-                * spring1.getPreferredValue(),
-                (-1) * spring1.getMinimumValue(), (-1) * spring1.getValue(),
-                spring);
-
+        assertSizes((-1) * spring1.getMaximumValue(), (-1) * spring1.getPreferredValue(), (-1)
+                * spring1.getMinimumValue(), (-1) * spring1.getValue(), spring);
         component = new JButton("Test");
         setComponentSizes(component, new Dimension(59, 25));
         spring1 = Spring.width(component);
-
         spring = Spring.minus(spring1);
-        assertSizes((-1) * spring1.getMaximumValue(), (-1)
-                * spring1.getPreferredValue(),
-                (-1) * spring1.getMinimumValue(), (-1) * spring1.getValue(),
-                spring);
+        assertSizes((-1) * spring1.getMaximumValue(), (-1) * spring1.getPreferredValue(), (-1)
+                * spring1.getMinimumValue(), (-1) * spring1.getValue(), spring);
         assertFalse(spring.getMinimumValue() == component.getMinimumSize().width);
-
         component.setMinimumSize(new Dimension(111, 112));
-        assertEquals((-1) * spring.getMaximumValue(), component
-                .getMinimumSize().width);
-
+        assertEquals((-1) * spring.getMaximumValue(), component.getMinimumSize().width);
         spring.setValue(333);
         assertEquals(-333, spring1.getValue());
-
         spring1.setValue(1);
         assertSizes(-59, -59, -111, spring);
-
         component.setMinimumSize(new Dimension(101, 201));
         component.setPreferredSize(new Dimension(102, 202));
         component.setMaximumSize(new Dimension(103, 203));
@@ -131,28 +115,21 @@
     public void testMinus_Overflow() throws Exception {
         initComponentSizes(component);
         spring = Spring.minus(Spring.width(component));
-
         spring.setValue(Integer.MAX_VALUE - 5);
         if (isHarmony()) {
-           assertEquals(Short.MAX_VALUE, spring.getValue());
+            assertEquals(Short.MAX_VALUE, spring.getValue());
         } else {
             assertEquals(Integer.MAX_VALUE - 5, spring.getValue());
         }
-
         spring = Spring.minus(Spring.width(component));
-        component.setMinimumSize(new Dimension(Integer.MAX_VALUE,
-                                               Integer.MAX_VALUE));
-
+        component.setMinimumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
         if (isHarmony()) {
-             assertEquals(Spring.TRIMMED_MIN_VALUE, spring.getMaximumValue());
+            assertEquals(Spring.TRIMMED_MIN_VALUE, spring.getMaximumValue());
         } else {
             assertEquals(Integer.MAX_VALUE * (-1), spring.getMaximumValue());
         }
-
         spring = Spring.minus(Spring.width(component));
-        component.setMinimumSize(new Dimension(Integer.MIN_VALUE,
-                                               Integer.MIN_VALUE));
-
+        component.setMinimumSize(new Dimension(Integer.MIN_VALUE, Integer.MIN_VALUE));
         if (isHarmony()) {
             assertEquals(Spring.TRIMMED_MAX_VALUE, spring.getMaximumValue());
         } else {
@@ -166,16 +143,13 @@
         if (isHarmony()) {
             assertSizes(Short.MIN_VALUE, -75, -2, spring);
         } else {
-             assertSizes(-1 * Short.MAX_VALUE, -75, -2, spring);
+            assertSizes(-1 * Short.MAX_VALUE, -75, -2, spring);
         }
-
         setComponentSizes(component, new Dimension(1, 1));
         assertSizes(-1, -1, -1, spring);
-
         spring1.setValue(0);
         assertEquals(0, spring.getValue());
         assertEquals(0, spring1.getValue());
-
         spring.setValue(3);
         assertEquals(3, spring.getValue());
         assertEquals(-3, spring1.getValue());
@@ -184,20 +158,15 @@
     public void testMinus_UNSET() throws Exception {
         spring1 = Spring.constant(4, 5, 6);
         spring1.setValue(1);
-
         spring = Spring.minus(spring1);
-
         spring.setValue(Spring.UNSET);
         assertSizes(4, 5, 6, 5, spring1);
-
         spring1 = Spring.constant(4, 5, 6);
         spring2 = Spring.sum(Spring.constant(5), spring1);
-
         spring = Spring.minus(spring2);
         spring.setValue(Spring.UNSET);
         spring.getMaximumValue();
         spring.setValue(Spring.UNSET);
-
         spring.setValue(10);
         assertEquals(-15, spring1.getValue());
         spring1.setValue(100);
@@ -208,203 +177,79 @@
 
     public void testSum() throws Exception {
         testExceptionalCase(new NullPointerCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 Spring.max(null, Spring.constant(11)).getValue();
             }
         });
-
-        checkStrains(Spring.constant(2),
-                      Spring.constant(1, 2, 3),
-                      2, 2, 0);
-        checkStrains(Spring.constant(1, 2, 3),
-                      Spring.constant(2),
-                      2, 0, 2);
-
-        checkStrains(Spring.constant(2),
-                      Spring.constant(1, 2, 3),
-                      4, 2, 2);
-        checkStrains(Spring.constant(1, 2, 3),
-                      Spring.constant(2),
-                      4, 2, 2);
-
-        checkStrains(Spring.constant(2),
-                      Spring.constant(1, 2, 3),
-                      6, 2, 4);
-        checkStrains(Spring.constant(1, 2, 3),
-                      Spring.constant(2),
-                      6, 4, 2);
-
-        checkStrains(Spring.constant(2, 2, 1),
-                      Spring.constant(2, 2, 4),
-                      2, 2, 0);
-        checkStrains(Spring.constant(2, 2, 4),
-                      Spring.constant(2, 2, 1),
-                      2, 2, 0);
-
-        checkStrains(Spring.constant(2, 2, 1),
-                      Spring.constant(2, 2, 4),
-                      4, 2, 2);
-        checkStrains(Spring.constant(2, 2, 4),
-              Spring.constant(2, 2, 1),
-              4, 2, 2);
-
-        checkStrains(Spring.constant(2, 2, 1),
-              Spring.constant(2, 2, 4),
-              6, 0, 6);
-        checkStrains(Spring.constant(2, 2, 4),
-              Spring.constant(2, 2, 1),
-              6, 6, 0);
-
-        checkStrains(Spring.constant(2, 2, 2),
-                Spring.constant(2, 2, 2),
-                2, 2, 0);
-        checkStrains(Spring.constant(2, 2, 2),
-              Spring.constant(2, 2, 2),
-              4, 2, 2);
-        checkStrains(Spring.constant(2, 2, 2),
-              Spring.constant(2, 2, 2),
-                6, 2, 4);
-
-        checkStrains(Spring.constant(1, 3, 3),
-                      Spring.constant(1, 2, 2),
-                      3, 2, 1);
-        checkStrains(Spring.constant(1, 2, 2),
-                Spring.constant(1, 3, 3),
-                3, 2, 1);
-
-        checkStrains(Spring.constant(1, 3, 3),
-                Spring.constant(1, 2, 2),
-                5, 3, 2);
-        checkStrains(Spring.constant(1, 2, 2),
-                Spring.constant(1, 3, 3),
-                5, 2, 3);
-
-        checkStrains(Spring.constant(1, 3, 3),
-                Spring.constant(1, 2, 2),
-                7, 3, 4);
-        checkStrains(Spring.constant(1, 2, 2),
-                Spring.constant(1, 3, 3),
-                7, 2, 5);
-
-        checkStrains(Spring.constant(1, 3, 1),
-                      Spring.constant(1, 1, 3),
-                      2, 1, 1);
-        checkStrains(Spring.constant(1, 1, 3),
-                Spring.constant(1, 3, 1),
-                2, 1, 1);
-
-        checkStrains(Spring.constant(1, 3, 1),
-                Spring.constant(1, 1, 3),
-                4, 3, 1);
-        checkStrains(Spring.constant(1, 1, 3),
-                Spring.constant(1, 3, 1),
-                4, 1, 3);
-
-        checkStrains(Spring.constant(1, 3, 1),
-                Spring.constant(1, 1, 3),
-                6, Spring.UNSET + 3, 6 - Spring.UNSET - 3);
-        checkStrains(Spring.constant(1, 1, 3),
-                Spring.constant(1, 3, 1),
-                6, 1, 5);
-
-        checkStrains(Spring.constant(1, 3, 1),
-                     Spring.constant(0, 1, 3),
-                     2, 2, 0);
-        checkStrains(Spring.constant(0, 1, 3),
-                Spring.constant(1, 3, 1),
-                2, 1, 1);
-
-        checkStrains(Spring.constant(1, 3, 1),
-                Spring.constant(0, 1, 3),
-                4, 3, 1);
-        checkStrains(Spring.constant(0, 1, 3),
-                Spring.constant(1, 3, 1),
-                4, 1, 3);
-        checkStrains(Spring.constant(0, 3, 1),
-                      Spring.constant(1, 1, 3),
-                      4, 3, 1);
-
-        checkStrains(Spring.constant(1, 3, 1),
-                Spring.constant(0, 1, 3),
-                6, Spring.UNSET + 3, 6 - Spring.UNSET - 3);
-        checkStrains(Spring.constant(0, 1, 3),
-                Spring.constant(1, 3, 1),
-                6, 1, 5);
-        checkStrains(Spring.constant(0, 3, 1),
-                Spring.constant(1, 1, 3),
-                6, Spring.UNSET + 3, 6 - Spring.UNSET - 3);
-
-        checkStrains(Spring.constant(3, 1, 3),
-                Spring.constant(1, 3, 1),
-                2, 1, 1);
-        checkStrains(Spring.constant(1, 3, 1),
-                Spring.constant(3, 1, 3),
-                2, Spring.UNSET + 3, 2 - Spring.UNSET - 3);
-
-        checkStrains(Spring.constant(3, 1, 3),
-                Spring.constant(1, 3, 1),
-                4, 1, 3);
-        checkStrains(Spring.constant(1, 3, 1),
-                Spring.constant(3, 1, 3),
-                4, 3, 1);
-
-        checkStrains(Spring.constant(3, 1, 3),
-                Spring.constant(1, 3, 1),
-                6, 1, 5);
-        checkStrains(Spring.constant(1, 3, 1),
-                Spring.constant(3, 1, 3),
-                6, Spring.UNSET + 3, 6 - Spring.UNSET - 3);
-
-        checkStrains(Spring.constant(2, 2, 5),
-                Spring.constant(3),
-                3, 2, 1);
-        checkStrains(Spring.constant(3),
-                Spring.constant(2, 2, 5),
-                3, 3, 0);
-
-        checkStrains(Spring.constant(2, 2, 5),
-                Spring.constant(3),
-                5, 2, 3);
-        checkStrains(Spring.constant(3),
-                Spring.constant(2, 2, 5),
-                5, 3, 2);
-
-        checkStrains(Spring.constant(2, 2, 5),
-                      Spring.constant(3),
-                      7, 4, 3);
-        checkStrains(Spring.constant(3),
-                      Spring.constant(2, 2, 5),
-                      7, 3, 4);
-
-        checkStrains(Spring.constant(2, 4, 3),
-                      Spring.constant(3, 1, 0),
-                      2,
-                      Spring.UNSET + 4,
-                      2 - Spring.UNSET - 4);
-
-        checkStrains(Spring.constant(2, 3, 4),
-                      Spring.constant(3, 1, 1),
-                      2, 5, -3);
-
-      if (isHarmony()) {
-           checkStrains(Spring.constant(2, 3, 3),
-                         Spring.constant(3, 1, 0),
-                         2, 5, -3);
-      } else {
-          checkStrains(Spring.constant(2, 3, 3),
-                        Spring.constant(3, 1, 0),
-                        2, 3, -1);
-      }
+        checkStrains(Spring.constant(2), Spring.constant(1, 2, 3), 2, 2, 0);
+        checkStrains(Spring.constant(1, 2, 3), Spring.constant(2), 2, 0, 2);
+        checkStrains(Spring.constant(2), Spring.constant(1, 2, 3), 4, 2, 2);
+        checkStrains(Spring.constant(1, 2, 3), Spring.constant(2), 4, 2, 2);
+        checkStrains(Spring.constant(2), Spring.constant(1, 2, 3), 6, 2, 4);
+        checkStrains(Spring.constant(1, 2, 3), Spring.constant(2), 6, 4, 2);
+        checkStrains(Spring.constant(2, 2, 1), Spring.constant(2, 2, 4), 2, 2, 0);
+        checkStrains(Spring.constant(2, 2, 4), Spring.constant(2, 2, 1), 2, 2, 0);
+        checkStrains(Spring.constant(2, 2, 1), Spring.constant(2, 2, 4), 4, 2, 2);
+        checkStrains(Spring.constant(2, 2, 4), Spring.constant(2, 2, 1), 4, 2, 2);
+        checkStrains(Spring.constant(2, 2, 1), Spring.constant(2, 2, 4), 6, 0, 6);
+        checkStrains(Spring.constant(2, 2, 4), Spring.constant(2, 2, 1), 6, 6, 0);
+        checkStrains(Spring.constant(2, 2, 2), Spring.constant(2, 2, 2), 2, 2, 0);
+        checkStrains(Spring.constant(2, 2, 2), Spring.constant(2, 2, 2), 4, 2, 2);
+        checkStrains(Spring.constant(2, 2, 2), Spring.constant(2, 2, 2), 6, 2, 4);
+        checkStrains(Spring.constant(1, 3, 3), Spring.constant(1, 2, 2), 3, 2, 1);
+        checkStrains(Spring.constant(1, 2, 2), Spring.constant(1, 3, 3), 3, 2, 1);
+        checkStrains(Spring.constant(1, 3, 3), Spring.constant(1, 2, 2), 5, 3, 2);
+        checkStrains(Spring.constant(1, 2, 2), Spring.constant(1, 3, 3), 5, 2, 3);
+        checkStrains(Spring.constant(1, 3, 3), Spring.constant(1, 2, 2), 7, 3, 4);
+        checkStrains(Spring.constant(1, 2, 2), Spring.constant(1, 3, 3), 7, 2, 5);
+        checkStrains(Spring.constant(1, 3, 1), Spring.constant(1, 1, 3), 2, 1, 1);
+        checkStrains(Spring.constant(1, 1, 3), Spring.constant(1, 3, 1), 2, 1, 1);
+        checkStrains(Spring.constant(1, 3, 1), Spring.constant(1, 1, 3), 4, 3, 1);
+        checkStrains(Spring.constant(1, 1, 3), Spring.constant(1, 3, 1), 4, 1, 3);
+        checkStrains(Spring.constant(1, 3, 1), Spring.constant(1, 1, 3), 6, Spring.UNSET + 3,
+                6 - Spring.UNSET - 3);
+        checkStrains(Spring.constant(1, 1, 3), Spring.constant(1, 3, 1), 6, 1, 5);
+        checkStrains(Spring.constant(1, 3, 1), Spring.constant(0, 1, 3), 2, 2, 0);
+        checkStrains(Spring.constant(0, 1, 3), Spring.constant(1, 3, 1), 2, 1, 1);
+        checkStrains(Spring.constant(1, 3, 1), Spring.constant(0, 1, 3), 4, 3, 1);
+        checkStrains(Spring.constant(0, 1, 3), Spring.constant(1, 3, 1), 4, 1, 3);
+        checkStrains(Spring.constant(0, 3, 1), Spring.constant(1, 1, 3), 4, 3, 1);
+        checkStrains(Spring.constant(1, 3, 1), Spring.constant(0, 1, 3), 6, Spring.UNSET + 3,
+                6 - Spring.UNSET - 3);
+        checkStrains(Spring.constant(0, 1, 3), Spring.constant(1, 3, 1), 6, 1, 5);
+        checkStrains(Spring.constant(0, 3, 1), Spring.constant(1, 1, 3), 6, Spring.UNSET + 3,
+                6 - Spring.UNSET - 3);
+        checkStrains(Spring.constant(3, 1, 3), Spring.constant(1, 3, 1), 2, 1, 1);
+        checkStrains(Spring.constant(1, 3, 1), Spring.constant(3, 1, 3), 2, Spring.UNSET + 3,
+                2 - Spring.UNSET - 3);
+        checkStrains(Spring.constant(3, 1, 3), Spring.constant(1, 3, 1), 4, 1, 3);
+        checkStrains(Spring.constant(1, 3, 1), Spring.constant(3, 1, 3), 4, 3, 1);
+        checkStrains(Spring.constant(3, 1, 3), Spring.constant(1, 3, 1), 6, 1, 5);
+        checkStrains(Spring.constant(1, 3, 1), Spring.constant(3, 1, 3), 6, Spring.UNSET + 3,
+                6 - Spring.UNSET - 3);
+        checkStrains(Spring.constant(2, 2, 5), Spring.constant(3), 3, 2, 1);
+        checkStrains(Spring.constant(3), Spring.constant(2, 2, 5), 3, 3, 0);
+        checkStrains(Spring.constant(2, 2, 5), Spring.constant(3), 5, 2, 3);
+        checkStrains(Spring.constant(3), Spring.constant(2, 2, 5), 5, 3, 2);
+        checkStrains(Spring.constant(2, 2, 5), Spring.constant(3), 7, 4, 3);
+        checkStrains(Spring.constant(3), Spring.constant(2, 2, 5), 7, 3, 4);
+        checkStrains(Spring.constant(2, 4, 3), Spring.constant(3, 1, 0), 2, Spring.UNSET + 4,
+                2 - Spring.UNSET - 4);
+        checkStrains(Spring.constant(2, 3, 4), Spring.constant(3, 1, 1), 2, 5, -3);
+        if (isHarmony()) {
+            checkStrains(Spring.constant(2, 3, 3), Spring.constant(3, 1, 0), 2, 5, -3);
+        } else {
+            checkStrains(Spring.constant(2, 3, 3), Spring.constant(3, 1, 0), 2, 3, -1);
+        }
     }
 
     public void testSum_Overflow() throws Exception {
         spring1 = Spring.constant(0);
         spring2 = Spring.width(component);
         spring = Spring.sum(spring1, spring2);
-        component.setMaximumSize(new Dimension(Integer.MAX_VALUE,
-                                               Integer.MAX_VALUE));
+        component.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
         assertEquals(Short.MAX_VALUE, spring.getMaximumValue());
-
         spring1 = Spring.constant(4, 5, 6);
         spring = Spring.sum(spring1, spring2);
         if (isHarmony()) {
@@ -412,18 +257,14 @@
         } else {
             assertEquals(Short.MAX_VALUE + 6, spring.getMaximumValue());
         }
-
         spring1 = Spring.constant(4, 5, Integer.MAX_VALUE);
         spring = Spring.sum(spring1, spring2);
         if (isHarmony()) {
             assertEquals(Spring.TRIMMED_MAX_VALUE, spring.getMaximumValue());
         } else {
-            assertEquals(Integer.MAX_VALUE +  Short.MAX_VALUE,
-                         spring.getMaximumValue());
+            assertEquals(Integer.MAX_VALUE + Short.MAX_VALUE, spring.getMaximumValue());
         }
-
-        component.setMaximumSize(new Dimension(Integer.MIN_VALUE,
-                                               Integer.MIN_VALUE));
+        component.setMaximumSize(new Dimension(Integer.MIN_VALUE, Integer.MIN_VALUE));
         spring1 = Spring.constant(4, 5, -6);
         spring = Spring.sum(spring1, spring2);
         if (isHarmony()) {
@@ -431,7 +272,6 @@
         } else {
             assertEquals(Integer.MIN_VALUE - 6, spring.getMaximumValue());
         }
-
         spring1 = Spring.constant(4, 5, Integer.MIN_VALUE);
         spring = Spring.sum(spring1, spring2);
         if (isHarmony()) {
@@ -450,26 +290,22 @@
         } else {
             assertSizes(6, 80, Short.MAX_VALUE + 6, spring);
         }
-
         setComponentSizes(component, new Dimension(1, 1));
         if (isHarmony()) {
             assertSizes(6, 80, Short.MAX_VALUE, spring);
         } else {
             assertSizes(6, 80, Short.MAX_VALUE + 6, spring);
         }
-
         spring2.setValue(0);
         assertEquals(5, spring.getValue());
         assertEquals(5, spring1.getValue());
         assertEquals(0, spring2.getValue());
-
         spring.setValue(3);
         if (isHarmony()) {
             assertSizes(6, 80, Short.MAX_VALUE, spring);
         } else {
             assertSizes(6, 80, Short.MAX_VALUE + 6, spring);
         }
-
         assertEquals(3, spring.getValue());
         assertEquals(4, spring1.getValue());
         assertEquals(-1, spring2.getValue());
@@ -478,7 +314,6 @@
         } else {
             assertSizes(6, 80, Short.MAX_VALUE + 6, spring);
         }
-
         spring1.setValue(3);
         assertEquals(3, spring.getValue());
         if (isHarmony()) {
@@ -486,30 +321,25 @@
         } else {
             assertSizes(6, 80, Short.MAX_VALUE + 6, spring);
         }
-
         spring.setValue(Spring.UNSET);
         assertSizes(5, 6, 7, 6, spring);
         spring1.setValue(10);
         assertSizes(5, 6, 7, 6, spring);
-
         spring.setValue(Spring.UNSET);
         spring1.setValue(10);
         assertSizes(5, 6, 7, 11, spring);
         spring1.setValue(100);
         assertSizes(5, 6, 7, 11, spring);
-
         spring.setValue(Spring.UNSET);
         component.setPreferredSize(new Dimension(10, 20));
         assertSizes(5, 15, 7, 15, spring);
         component.setPreferredSize(new Dimension(100, 200));
         assertSizes(5, 15, 7, 15, spring);
-
         spring.setValue(Spring.UNSET);
         component.setMinimumSize(new Dimension(10, 20));
         assertSizes(14, 105, 7, 105, spring);
         component.setMinimumSize(new Dimension(100, 200));
         assertSizes(14, 105, 7, 105, spring);
-
         spring.setValue(Spring.UNSET);
         component.setPreferredSize(new Dimension(10, 20));
         component.setMinimumSize(new Dimension(30, 40));
@@ -519,13 +349,11 @@
         spring.getValue();
         component.setMinimumSize(new Dimension(300, 400));
         assertSizes(34, 15, 7, 105, spring);
-
         spring.setValue(Spring.UNSET);
         spring.getValue();
         assertEquals(105, spring.getPreferredValue());
         component.setMinimumSize(new Dimension(30, 40));
         assertEquals(34, spring.getMinimumValue());
-
         spring.setValue(Spring.UNSET);
         component.setPreferredSize(new Dimension(10, 20));
         component.setMinimumSize(new Dimension(30, 40));
@@ -538,7 +366,6 @@
     public void testSum_UNSET() throws Exception {
         spring1 = Spring.constant(2, 4, 5);
         spring2 = Spring.constant(5);
-
         spring1.setValue(1);
         spring2.setValue(1);
         spring = Spring.sum(spring1, spring2);
@@ -551,7 +378,6 @@
         assertSizes(2, 4, 5, 95, spring1);
         assertSizes(5, 5, 5, 5, spring2);
         assertSizes(7, 9, 10, 100, spring);
-
         spring1.setValue(1);
         spring2.setValue(1);
         spring.setValue(Spring.UNSET);
@@ -559,7 +385,6 @@
         assertSizes(2, 4, 5, -15, spring1);
         assertSizes(5, 5, 5, 5, spring2);
         assertSizes(7, 9, 10, -10, spring);
-
         spring = Spring.sum(spring1, spring2);
         spring1.setValue(1);
         spring2.setValue(1);
@@ -569,7 +394,6 @@
         assertSizes(2, 4, 5, 1, spring1);
         assertSizes(5, 5, 5, 1, spring2);
         assertSizes(7, 9, 10, 2, spring);
-
         spring1 = Spring.constant(4, 5, 6);
         spring2 = Spring.width(component);
         component.setMinimumSize(new Dimension(4, 14));
@@ -578,12 +402,10 @@
         spring = Spring.sum(spring1, spring2);
         spring1.setValue(1);
         spring2.setValue(2);
-
         spring.setValue(3);
         assertEquals(2, spring1.getValue());
         assertEquals(1, spring2.getValue());
         component.setMaximumSize(new Dimension(60, 160));
-
         spring.setValue(3);
         assertEquals(2, spring1.getValue());
         assertEquals(1, spring2.getValue());
@@ -591,21 +413,17 @@
 
     public void testMax() throws Exception {
         testExceptionalCase(new NullPointerCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 Spring.max(null, Spring.constant(11)).getValue();
             }
         });
-
         spring1 = Spring.constant(12, 13, 15);
         spring2 = Spring.constant(11, 12, 13);
         spring = Spring.max(spring1, spring2);
-
-        assertEquals(spring.getMaximumValue(), Math.max(spring1
-                .getMaximumValue(), spring2.getMaximumValue()));
-
-        assertEquals(spring.getValue(), Math.max(spring1.getValue(), spring2
-                .getValue()));
-
+        assertEquals(spring.getMaximumValue(), Math.max(spring1.getMaximumValue(), spring2
+                .getMaximumValue()));
+        assertEquals(spring.getValue(), Math.max(spring1.getValue(), spring2.getValue()));
         spring.setValue(335);
         assertEquals(335, spring.getValue());
         if (spring1.getValue() > spring2.getValue()) {
@@ -620,47 +438,38 @@
         spring2 = Spring.width(component);
         spring = Spring.max(spring1, spring2);
         assertSizes(5, 75, Short.MAX_VALUE, spring);
-
         setComponentSizes(component, new Dimension(1, 1));
         assertSizes(5, 75, Short.MAX_VALUE, spring);
-
         spring2.setValue(0);
         assertEquals(5, spring.getValue());
         assertEquals(5, spring1.getValue());
         assertEquals(0, spring2.getValue());
-
         spring.setValue(3);
         assertSizes(5, 75, Short.MAX_VALUE, spring);
-
         assertEquals(3, spring.getValue());
         assertEquals(3, spring1.getValue());
         assertEquals(1, spring2.getValue());
         assertSizes(5, 75, Short.MAX_VALUE, spring);
-
         spring.setValue(Spring.UNSET);
         assertSizes(5, 5, 5, 5, spring);
         spring1.setValue(10);
         spring2.setValue(10);
         assertSizes(5, 5, 5, 5, spring);
-
         spring.setValue(Spring.UNSET);
         spring1.setValue(10);
         assertSizes(5, 5, 5, 10, spring);
         spring1.setValue(100);
         assertSizes(5, 5, 5, 10, spring);
-
         spring.setValue(Spring.UNSET);
         component.setPreferredSize(new Dimension(10, 20));
         assertSizes(5, 10, 5, 10, spring);
         component.setPreferredSize(new Dimension(100, 200));
         assertSizes(5, 10, 5, 10, spring);
-
         spring.setValue(Spring.UNSET);
         component.setMinimumSize(new Dimension(10, 20));
         assertSizes(10, 100, 5, 100, spring);
         component.setMinimumSize(new Dimension(100, 200));
         assertSizes(10, 100, 5, 100, spring);
-
         spring.setValue(Spring.UNSET);
         component.setPreferredSize(new Dimension(10, 20));
         component.setMinimumSize(new Dimension(30, 40));
@@ -670,13 +479,11 @@
         spring.getValue();
         component.setMinimumSize(new Dimension(300, 400));
         assertSizes(30, 10, 5, 100, spring);
-
         spring.setValue(Spring.UNSET);
         spring.getValue();
         assertEquals(100, spring.getPreferredValue());
         component.setMinimumSize(new Dimension(30, 40));
         assertEquals(30, spring.getMinimumValue());
-
         spring.setValue(Spring.UNSET);
         component.setPreferredSize(new Dimension(10, 20));
         component.setMinimumSize(new Dimension(30, 40));
@@ -689,7 +496,6 @@
     public void testMax_UNSET() throws Exception {
         spring1 = Spring.constant(5);
         spring2 = Spring.constant(4);
-
         spring1.setValue(1);
         spring2.setValue(1);
         spring = Spring.max(spring1, spring2);
@@ -701,7 +507,6 @@
         spring.setValue(10);
         assertSizes(5, 5, 5, 10, spring1);
         assertSizes(4, 4, 4, 4, spring2);
-
         spring1.setValue(1);
         spring2.setValue(1);
         spring = Spring.max(spring1, spring2);
@@ -709,17 +514,14 @@
         spring.setValue(Spring.UNSET);
         assertSizes(5, 5, 5, 1, spring1);
         assertSizes(4, 4, 4, 1, spring2);
-
         spring1 = Spring.constant(4, 4, 6);
         spring2 = Spring.constant(4, 5, 5);
         spring = Spring.max(spring1, spring2);
         spring1.setValue(2);
         spring2.setValue(1);
-        spring.setValue(Math.max(spring1.getPreferredValue(), spring2
-                .getPreferredValue()) + 5);
+        spring.setValue(Math.max(spring1.getPreferredValue(), spring2.getPreferredValue()) + 5);
         assertEquals(spring1.getPreferredValue(), spring1.getValue());
         assertEquals(10, spring2.getValue());
-
         spring1 = Spring.constant(4, 5, 6);
         spring2 = Spring.width(component);
         component.setMinimumSize(new Dimension(4, 14));
@@ -728,11 +530,9 @@
         spring = Spring.max(spring1, spring2);
         spring1.setValue(2);
         spring2.setValue(1);
-
         spring.setValue(6);
         assertSizes(4, 5, 6, 6, spring1);
         assertSizes(4, 5, 6, 5, spring2);
-
         component.setPreferredSize(new Dimension(25, 35));
         spring.setValue(6);
         assertSizes(4, 5, 6, 5, spring1);
@@ -741,58 +541,48 @@
 
     public void testScale() {
         testExceptionalCase(new NullPointerCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 Spring.scale(null, 1).getValue();
             }
         });
-
         testScale(1);
         testScale(0);
-
         testScale(5);
         testScale(1.3f);
         testScale(1.5f);
         testScale(1.7f);
-
         testScale(-5);
         testScale(-1.3f);
         testScale(-1.5f);
         testScale(-1.7f);
-
-       //testScale(Spring.UNSET);
+        //testScale(Spring.UNSET);
     }
 
     public void testScale_Overflow() throws Exception {
         component = new JTextField();
         spring = Spring.scale(Spring.width(component), 2f);
-
         spring.setValue(2147483642);
         if (isHarmony()) {
             assertEquals(Spring.TRIMMED_MAX_VALUE, spring.getValue());
         } else {
             assertEquals(2147483647, spring.getValue());
         }
-
-        component.setMaximumSize(new Dimension(Integer.MAX_VALUE,
-                                               Integer.MAX_VALUE));
+        component.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
         if (isHarmony()) {
             assertEquals(Spring.TRIMMED_MAX_VALUE, spring.getMaximumValue());
         } else {
             assertEquals(2 * Short.MAX_VALUE, spring.getMaximumValue());
         }
-
         spring = Spring.scale(Spring.width(component), 2f);
-        component.setMaximumSize(new Dimension(Integer.MIN_VALUE,
-                                               Integer.MIN_VALUE));
+        component.setMaximumSize(new Dimension(Integer.MIN_VALUE, Integer.MIN_VALUE));
         if (isHarmony()) {
             assertEquals(Spring.TRIMMED_MIN_VALUE, spring.getMaximumValue());
         } else {
             assertEquals(Integer.MIN_VALUE, spring.getMaximumValue());
         }
-
         spring = Spring.scale(Spring.width(component), -2f);
-        component.setMaximumSize(new Dimension(Integer.MIN_VALUE,
-                                               Integer.MIN_VALUE));
+        component.setMaximumSize(new Dimension(Integer.MIN_VALUE, Integer.MIN_VALUE));
         assertEquals(-8, spring.getMaximumValue());
     }
 
@@ -804,19 +594,15 @@
         } else {
             assertSizes(4, 150, 2 * Short.MAX_VALUE, spring);
         }
-
         setComponentSizes(component, new Dimension(1, 1));
         assertSizes(2, 2, 2, spring);
-
         spring1.setValue(1);
         assertEquals(2, spring.getValue());
         assertEquals(1, spring1.getValue());
-
         spring.setValue(6);
         assertSizes(2, 2, 2, spring);
         assertEquals(6, spring.getValue());
         assertEquals(3, spring1.getValue());
-
         spring.setValue(Spring.UNSET);
         assertSizes(2, 2, 2, spring);
         assertEquals(spring.getPreferredValue(), spring.getValue());
@@ -827,53 +613,51 @@
         spring1 = Spring.width(component);
         spring1.setValue(10);
         spring = Spring.scale(spring1, 2);
-
         component.setMinimumSize(new Dimension(11, 12));
         component.setPreferredSize(new Dimension(13, 14));
         component.setMaximumSize(new Dimension(15, 16));
         assertSizes(22, 26, 30, 20, spring);
-
         spring.setValue(Spring.UNSET);
         assertSizes(22, 26, 30, 2 * spring1.getPreferredValue(), spring);
-
         component.setPreferredSize(new Dimension(101, 102));
         assertEquals(101, spring1.getValue());
         assertEquals(202, spring.getValue());
-
         component.setPreferredSize(new Dimension(201, 202));
         assertEquals(201, spring1.getValue());
         assertEquals(402, spring.getValue());
-
         component.setPreferredSize(new Dimension(201, 202));
         assertEquals(201, spring1.getValue());
         assertEquals(402, spring.getValue());
-
         spring1.setValue(11);
         assertEquals(22, spring.getValue());
     }
 
     public void testWidth() {
         testExceptionalCase(new NullPointerCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 Spring.width(null).getValue();
             }
         });
-
         final Marker getMinimumSizeCalled = new Marker();
         final Marker getMaximumSizeCalled = new Marker();
         final Marker getPreferedSizeCalled = new Marker();
-
         component = new JButton("Test") {
+            private static final long serialVersionUID = 1L;
+
+            @Override
             public java.awt.Dimension getMinimumSize() {
                 getMinimumSizeCalled.setOccurred();
                 return super.getMinimumSize();
             }
 
+            @Override
             public java.awt.Dimension getPreferredSize() {
                 getPreferedSizeCalled.setOccurred();
                 return super.getPreferredSize();
             }
 
+            @Override
             public java.awt.Dimension getMaximumSize() {
                 getMaximumSizeCalled.setOccurred();
                 return super.getMaximumSize();
@@ -884,36 +668,27 @@
         assertFalse(getPreferedSizeCalled.isOccurred());
         assertFalse(getMinimumSizeCalled.isOccurred());
         assertFalse(getMaximumSizeCalled.isOccurred());
-
         getPreferedSizeCalled.reset();
         spring.getPreferredValue();
         assertTrue(getPreferedSizeCalled.isOccurred());
         getPreferedSizeCalled.reset();
         spring.getPreferredValue();
         assertTrue(getPreferedSizeCalled.isOccurred());
-
         getMinimumSizeCalled.reset();
         spring.getMinimumValue();
         assertTrue(getMinimumSizeCalled.isOccurred());
-
         getMaximumSizeCalled.reset();
         spring.getMaximumValue();
         assertTrue(getMaximumSizeCalled.isOccurred());
-
-        assertSizes(component.getMinimumSize().width, component
-                .getPreferredSize().width, Short.MAX_VALUE,
-                component.getPreferredSize().width, spring);
-
+        assertSizes(component.getMinimumSize().width, component.getPreferredSize().width,
+                Short.MAX_VALUE, component.getPreferredSize().width, spring);
         spring.setValue(10);
-        assertSizes(component.getMinimumSize().width, component
-                .getPreferredSize().width, Short.MAX_VALUE,
-                10, spring);
-
+        assertSizes(component.getMinimumSize().width, component.getPreferredSize().width,
+                Short.MAX_VALUE, 10, spring);
         component.setMinimumSize(new Dimension(11, 12));
         component.setPreferredSize(new Dimension(13, 14));
         component.setMaximumSize(new Dimension(15, 16));
         assertSizes(11, 13, 15, 10, spring);
-
         component.setSize(new Dimension(100, 200));
         assertSizes(11, 13, 15, 10, spring);
     }
@@ -921,21 +696,16 @@
     public void testWidth_UNSET() throws Exception {
         spring = Spring.width(component);
         spring.setValue(10);
-
         component.setMinimumSize(new Dimension(11, 12));
         component.setPreferredSize(new Dimension(13, 14));
         component.setMaximumSize(new Dimension(15, 16));
         assertSizes(11, 13, 15, 10, spring);
-
         spring.setValue(Spring.UNSET);
         assertSizes(11, 13, 15, spring.getPreferredValue(), spring);
-
         component.setPreferredSize(new Dimension(101, 102));
         assertEquals(101, spring.getValue());
-
         component.setPreferredSize(new Dimension(201, 102));
         assertEquals(201, spring.getValue());
-
         component.setSize(new Dimension(500, 600));
         spring.setValue(Spring.UNSET);
         assertSizes(11, 201, 15, 201, spring);
@@ -943,80 +713,70 @@
 
     public void testWidth_Overflow() throws Exception {
         spring = Spring.width(component);
-
         spring.setValue(Integer.MAX_VALUE - 5);
         assertEquals(Integer.MAX_VALUE - 5, spring.getValue());
-
         spring.setValue(Integer.MAX_VALUE - 5);
-        component.setMaximumSize(new Dimension(Integer.MAX_VALUE,
-                                               Integer.MAX_VALUE));
+        component.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
         assertEquals(Short.MAX_VALUE, spring.getMaximumValue());
-
         spring = Spring.width(component);
-        component.setMaximumSize(new Dimension(Integer.MIN_VALUE,
-                                               Integer.MIN_VALUE));
+        component.setMaximumSize(new Dimension(Integer.MIN_VALUE, Integer.MIN_VALUE));
         if (isHarmony()) {
             assertEquals(Spring.TRIMMED_MIN_VALUE, spring.getMaximumValue());
         } else {
-            assertEquals(Integer.MIN_VALUE , spring.getMaximumValue());
+            assertEquals(Integer.MIN_VALUE, spring.getMaximumValue());
         }
     }
 
     public void testHeight() {
         testExceptionalCase(new NullPointerCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 Spring.height(null).getValue();
             }
         });
-
         component = new JButton("Test") {
+            private static final long serialVersionUID = 1L;
+
+            @Override
             public java.awt.Dimension getMinimumSize() {
                 componentGetMinimumSizeCalled.setOccurred();
                 return super.getMinimumSize();
             }
 
+            @Override
             public java.awt.Dimension getPreferredSize() {
                 componentGetPreferedSizeCalled.setOccurred();
                 return super.getPreferredSize();
             }
 
+            @Override
             public java.awt.Dimension getMaximumSize() {
                 componentGetMaximumSizeCalled.setOccurred();
                 return super.getMaximumSize();
             }
         };
-
         initComponentSizes(component);
         spring = Spring.height(component);
         assertFalse(componentGetPreferedSizeCalled.isOccurred());
         assertFalse(componentGetMinimumSizeCalled.isOccurred());
         assertFalse(componentGetMaximumSizeCalled.isOccurred());
-
         componentGetPreferedSizeCalled.reset();
         spring.getPreferredValue();
         assertTrue(componentGetPreferedSizeCalled.isOccurred());
         componentGetPreferedSizeCalled.reset();
         spring.getPreferredValue();
         assertTrue(componentGetPreferedSizeCalled.isOccurred());
-
         componentGetMinimumSizeCalled.reset();
         spring.getMinimumValue();
         assertTrue(componentGetMinimumSizeCalled.isOccurred());
-
         componentGetMaximumSizeCalled.reset();
         spring.getMaximumValue();
         assertTrue(componentGetMaximumSizeCalled.isOccurred());
-
-        assertSizes(component.getMinimumSize().height,
-                    component.getPreferredSize().height,
-                    Short.MAX_VALUE,
-                    component.getPreferredSize().height, spring);
-
+        assertSizes(component.getMinimumSize().height, component.getPreferredSize().height,
+                Short.MAX_VALUE, component.getPreferredSize().height, spring);
         spring.setValue(10);
-        assertSizes(component.getMinimumSize().height,
-                    component.getPreferredSize().height,
-                    Short.MAX_VALUE, 10, spring);
-
+        assertSizes(component.getMinimumSize().height, component.getPreferredSize().height,
+                Short.MAX_VALUE, 10, spring);
         component.setMinimumSize(new Dimension(11, 12));
         component.setPreferredSize(new Dimension(13, 14));
         component.setMaximumSize(new Dimension(15, 16));
@@ -1026,18 +786,14 @@
     public void testHeight_UNSET() throws Exception {
         spring = Spring.height(component);
         spring.setValue(10);
-
         component.setMinimumSize(new Dimension(11, 12));
         component.setPreferredSize(new Dimension(13, 14));
         component.setMaximumSize(new Dimension(15, 16));
         assertSizes(12, 14, 16, 10, spring);
-
         spring.setValue(Spring.UNSET);
         assertSizes(12, 14, 16, spring.getPreferredValue(), spring);
-
         component.setPreferredSize(new Dimension(101, 102));
         assertEquals(102, spring.getValue());
-
         component.setPreferredSize(new Dimension(201, 202));
         assertEquals(202, spring.getValue());
     }
@@ -1045,18 +801,13 @@
     public void testHeight_Overflow() throws Exception {
         component = new JTextField();
         spring = Spring.height(component);
-
         spring.setValue(Integer.MAX_VALUE - 5);
         assertEquals(Integer.MAX_VALUE - 5, spring.getValue());
-
         spring.setValue(Integer.MAX_VALUE - 5);
-        component.setMaximumSize(new Dimension(Integer.MAX_VALUE,
-                                               Integer.MAX_VALUE));
+        component.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
         assertEquals(Short.MAX_VALUE, spring.getMaximumValue());
-
         spring = Spring.height(component);
-        component.setMaximumSize(new Dimension(Integer.MIN_VALUE,
-                                               Integer.MIN_VALUE));
+        component.setMaximumSize(new Dimension(Integer.MIN_VALUE, Integer.MIN_VALUE));
         if (isHarmony()) {
             assertEquals(Spring.TRIMMED_MIN_VALUE, spring.getMaximumValue());
         } else {
@@ -1072,38 +823,34 @@
         if (isHarmony()) {
             assertEquals("[1, 2, 3]", spring1.toString());
             assertEquals("[5, 5, 5]", Spring.constant(5).toString());
-            assertEquals("Width of javax.swing.JButton: [59, 59, 59]", spring2
-                    .toString());
+            assertEquals("Width of javax.swing.JButton: [59, 59, 59]", spring2.toString());
             assertEquals("Height of javax.swing.JButton: [25, 25, 25]", Spring
                     .height(component).toString());
             assertEquals("-[[1, 2, 3]]", Spring.minus(spring1).toString());
-            assertEquals("[[1, 2, 3]] + [Width of javax.swing.JButton: "
-                    + "[59, 59, 59]]", Spring.sum(spring1, spring2).toString());
-            assertEquals("max([[1, 2, 3]], [Width of javax.swing.JButton: "
-                    + "[59, 59, 59]])", Spring.max(spring1, spring2).toString());
-            assertEquals("0.3 * [[1, 2, 3]]", Spring.scale(spring1, 0.3f)
-                    .toString());
+            assertEquals("[[1, 2, 3]] + [Width of javax.swing.JButton: " + "[59, 59, 59]]",
+                    Spring.sum(spring1, spring2).toString());
+            assertEquals("max([[1, 2, 3]], [Width of javax.swing.JButton: " + "[59, 59, 59]])",
+                    Spring.max(spring1, spring2).toString());
+            assertEquals("0.3 * [[1, 2, 3]]", Spring.scale(spring1, 0.3f).toString());
         }
     }
 
-    public static void assertSizes(final int min, final int pref,
-            final int max, final Spring spring) {
+    public static void assertSizes(final int min, final int pref, final int max,
+            final Spring spring) {
         assertEquals(min, spring.getMinimumValue());
         assertEquals(pref, spring.getPreferredValue());
         assertEquals(max, spring.getMaximumValue());
     }
 
-    public static void assertSizes(final int min, final int pref,
-            final int max, final int value, final Spring spring) {
+    public static void assertSizes(final int min, final int pref, final int max,
+            final int value, final Spring spring) {
         assertSizes(min, pref, max, spring);
         assertEquals(value, spring.getValue());
     }
 
-    public static void assertValues(final Spring expectedSpring,
-            final Spring spring) {
-        assertSizes(expectedSpring.getMinimumValue(), expectedSpring
-                .getPreferredValue(), expectedSpring.getMaximumValue(),
-                expectedSpring.getValue(), spring);
+    public static void assertValues(final Spring expectedSpring, final Spring spring) {
+        assertSizes(expectedSpring.getMinimumValue(), expectedSpring.getPreferredValue(),
+                expectedSpring.getMaximumValue(), expectedSpring.getValue(), spring);
     }
 
     private void initComponentSizes(Component c) {
@@ -1112,16 +859,13 @@
         c.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
     }
 
-    private void checkStrains(final Spring spring1, final Spring spring2,
-            final int newValue, final int val1, final int val2) {
+    private void checkStrains(final Spring spring1, final Spring spring2, final int newValue,
+            final int val1, final int val2) {
         Spring sum = Spring.sum(spring1, spring2);
-
-        assertSizes(spring1.getMinimumValue() + spring2.getMinimumValue(),
-                    spring1.getPreferredValue() + spring2.getPreferredValue(),
-                    spring1.getMaximumValue() + spring2.getMaximumValue(),
-                    spring1.getValue() + spring2.getValue(),
-                    sum);
-
+        assertSizes(spring1.getMinimumValue() + spring2.getMinimumValue(), spring1
+                .getPreferredValue()
+                + spring2.getPreferredValue(), spring1.getMaximumValue()
+                + spring2.getMaximumValue(), spring1.getValue() + spring2.getValue(), sum);
         sum.setValue(newValue);
         assertEquals(val1, spring1.getValue());
         assertEquals(val2, spring2.getValue());
@@ -1131,36 +875,31 @@
         spring1 = Spring.constant(12, 13, 15);
         spring = Spring.scale(spring1, factor);
         if (factor > 0) {
-            assertSizes(Math.round(factor * spring1.getMinimumValue()),
-                        Math.round(factor * spring1.getPreferredValue()),
-                        Math.round(factor * spring1.getMaximumValue()),
-                        Math.round(factor * spring1.getValue()), spring);
-        } else {
-            assertSizes(Math.round(factor * spring1.getMaximumValue()),
-                        Math.round(factor * spring1.getPreferredValue()),
-                        Math.round(factor * spring1.getMinimumValue()),
-                        Math.round(factor * spring1.getValue()), spring);
+            assertSizes(Math.round(factor * spring1.getMinimumValue()), Math.round(factor
+                    * spring1.getPreferredValue()), Math.round(factor
+                    * spring1.getMaximumValue()), Math.round(factor * spring1.getValue()),
+                    spring);
+        } else {
+            assertSizes(Math.round(factor * spring1.getMaximumValue()), Math.round(factor
+                    * spring1.getPreferredValue()), Math.round(factor
+                    * spring1.getMinimumValue()), Math.round(factor * spring1.getValue()),
+                    spring);
         }
-
         assertFalse(Integer.MAX_VALUE == spring1.getMinimumValue());
         assertFalse(Integer.MAX_VALUE == spring1.getMaximumValue());
         assertFalse(Integer.MAX_VALUE == spring1.getPreferredValue());
         spring.setValue(3);
         if (factor != 0) {
-            assertEquals(Math.round(spring.getValue() / factor), spring1
-                         .getValue());
+            assertEquals(Math.round(spring.getValue() / factor), spring1.getValue());
         } else {
             assertEquals(Integer.MAX_VALUE, spring1.getValue());
         }
-
         spring.setValue(0);
         assertEquals(0, spring1.getValue());
-
         assertFalse(spring1.getPreferredValue() == spring1.getValue());
         spring.setValue(-6);
         if (factor != 0) {
-            assertEquals(Math.round(spring.getValue() / factor), spring1
-                         .getValue());
+            assertEquals(Math.round(spring.getValue() / factor), spring1.getValue());
         } else {
             assertEquals(spring1.getPreferredValue(), spring1.getValue());
         }
@@ -1168,11 +907,9 @@
         assertEquals(spring.getPreferredValue(), spring.getValue());
     }
 
-
     private void setComponentSizes(Component component, Dimension size) {
         component.setMinimumSize(size);
         component.setPreferredSize(size);
         component.setMaximumSize(size);
-
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SwingUtilitiesRTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SwingUtilitiesRTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SwingUtilitiesRTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SwingUtilitiesRTest.java Sat Nov 25 16:04:10 2006
@@ -26,47 +26,57 @@
 import java.awt.FontMetrics;
 import java.awt.Frame;
 import java.awt.Rectangle;
+import java.awt.event.InputEvent;
 import java.awt.event.MouseEvent;
 
 public class SwingUtilitiesRTest extends SwingTestCase {
-
     public void testLayoutCompoundLabel() {
         JComponent c = new JButton();
         FontMetrics fm = c.getFontMetrics(c.getFont());
         Rectangle viewRectangle = new Rectangle(1000, 1000);
         Rectangle iconRectangle = new Rectangle();
         Rectangle textRectangle = new Rectangle();
-
-        SwingUtilities.layoutCompoundLabel(c, fm, "text", null,
-                                        SwingConstants.CENTER, SwingConstants.LEADING,
-                                        SwingConstants.CENTER, SwingConstants.TRAILING,
-                                        viewRectangle, iconRectangle, textRectangle, 0);
+        SwingUtilities.layoutCompoundLabel(c, fm, "text", null, SwingConstants.CENTER,
+                SwingConstants.LEADING, SwingConstants.CENTER, SwingConstants.TRAILING,
+                viewRectangle, iconRectangle, textRectangle, 0);
         int textHeight = fm.getHeight();
-        assertEquals(new Rectangle(0, (viewRectangle.height - textHeight)/2 + textHeight/2, 0, 0), iconRectangle);
+        assertEquals(new Rectangle(0, (viewRectangle.height - textHeight) / 2 + textHeight / 2,
+                0, 0), iconRectangle);
     }
 
     public void testIsLeftMiddleRightMouseButton() {
         JComponent panel = new JPanel();
         panel.setPreferredSize(new Dimension(100, 100));
-
-        MouseEvent button1DownEvent = new MouseEvent(panel, 100, 0, MouseEvent.BUTTON1_DOWN_MASK, 50, 50, 1, false);
-        MouseEvent button1PressedEvent = new MouseEvent(panel, MouseEvent.MOUSE_PRESSED, 0, 0, 50, 50, 1, false, MouseEvent.BUTTON1);
-        MouseEvent button1Released = new MouseEvent(panel, MouseEvent.MOUSE_RELEASED, 0, 0, 50, 50, 1, false, MouseEvent.BUTTON1);
-        MouseEvent button1Clicked = new MouseEvent(panel, MouseEvent.MOUSE_CLICKED, 0, 0, 50, 50, 1, false, MouseEvent.BUTTON1);
-        MouseEvent button1DraggedEvent = new MouseEvent(panel, MouseEvent.MOUSE_DRAGGED, 0, 0, 50, 50, 1, false, MouseEvent.BUTTON1);
-
-        MouseEvent button2DownEvent = new MouseEvent(panel, 100, 0, MouseEvent.BUTTON2_DOWN_MASK, 50, 50, 1, false);
-        MouseEvent button2PressedEvent = new MouseEvent(panel, MouseEvent.MOUSE_PRESSED, 0, 0, 50, 50, 1, false, MouseEvent.BUTTON2);
-        MouseEvent button2Released = new MouseEvent(panel, MouseEvent.MOUSE_RELEASED, 0, 0, 50, 50, 1, false, MouseEvent.BUTTON2);
-        MouseEvent button2Clicked = new MouseEvent(panel, MouseEvent.MOUSE_CLICKED, 0, 0, 50, 50, 1, false, MouseEvent.BUTTON2);
-        MouseEvent button2DraggedEvent = new MouseEvent(panel, MouseEvent.MOUSE_DRAGGED, 0, 0, 50, 50, 1, false, MouseEvent.BUTTON2);
-
-        MouseEvent button3DownEvent = new MouseEvent(panel, 100, 0, MouseEvent.BUTTON3_DOWN_MASK, 50, 50, 1, false);
-        MouseEvent button3PressedEvent = new MouseEvent(panel, MouseEvent.MOUSE_PRESSED, 0, 0, 50, 50, 1, false, MouseEvent.BUTTON3);
-        MouseEvent button3Released = new MouseEvent(panel, MouseEvent.MOUSE_RELEASED, 0, 0, 50, 50, 1, false, MouseEvent.BUTTON3);
-        MouseEvent button3Clicked = new MouseEvent(panel, MouseEvent.MOUSE_CLICKED, 0, 0, 50, 50, 1, false, MouseEvent.BUTTON3);
-        MouseEvent button3DraggedEvent = new MouseEvent(panel, MouseEvent.MOUSE_DRAGGED, 0, 0, 50, 50, 1, false, MouseEvent.BUTTON3);
-
+        MouseEvent button1DownEvent = new MouseEvent(panel, 100, 0,
+                InputEvent.BUTTON1_DOWN_MASK, 50, 50, 1, false);
+        MouseEvent button1PressedEvent = new MouseEvent(panel, MouseEvent.MOUSE_PRESSED, 0, 0,
+                50, 50, 1, false, MouseEvent.BUTTON1);
+        MouseEvent button1Released = new MouseEvent(panel, MouseEvent.MOUSE_RELEASED, 0, 0, 50,
+                50, 1, false, MouseEvent.BUTTON1);
+        MouseEvent button1Clicked = new MouseEvent(panel, MouseEvent.MOUSE_CLICKED, 0, 0, 50,
+                50, 1, false, MouseEvent.BUTTON1);
+        MouseEvent button1DraggedEvent = new MouseEvent(panel, MouseEvent.MOUSE_DRAGGED, 0, 0,
+                50, 50, 1, false, MouseEvent.BUTTON1);
+        MouseEvent button2DownEvent = new MouseEvent(panel, 100, 0,
+                InputEvent.BUTTON2_DOWN_MASK, 50, 50, 1, false);
+        MouseEvent button2PressedEvent = new MouseEvent(panel, MouseEvent.MOUSE_PRESSED, 0, 0,
+                50, 50, 1, false, MouseEvent.BUTTON2);
+        MouseEvent button2Released = new MouseEvent(panel, MouseEvent.MOUSE_RELEASED, 0, 0, 50,
+                50, 1, false, MouseEvent.BUTTON2);
+        MouseEvent button2Clicked = new MouseEvent(panel, MouseEvent.MOUSE_CLICKED, 0, 0, 50,
+                50, 1, false, MouseEvent.BUTTON2);
+        MouseEvent button2DraggedEvent = new MouseEvent(panel, MouseEvent.MOUSE_DRAGGED, 0, 0,
+                50, 50, 1, false, MouseEvent.BUTTON2);
+        MouseEvent button3DownEvent = new MouseEvent(panel, 100, 0,
+                InputEvent.BUTTON3_DOWN_MASK, 50, 50, 1, false);
+        MouseEvent button3PressedEvent = new MouseEvent(panel, MouseEvent.MOUSE_PRESSED, 0, 0,
+                50, 50, 1, false, MouseEvent.BUTTON3);
+        MouseEvent button3Released = new MouseEvent(panel, MouseEvent.MOUSE_RELEASED, 0, 0, 50,
+                50, 1, false, MouseEvent.BUTTON3);
+        MouseEvent button3Clicked = new MouseEvent(panel, MouseEvent.MOUSE_CLICKED, 0, 0, 50,
+                50, 1, false, MouseEvent.BUTTON3);
+        MouseEvent button3DraggedEvent = new MouseEvent(panel, MouseEvent.MOUSE_DRAGGED, 0, 0,
+                50, 50, 1, false, MouseEvent.BUTTON3);
         assertTrue(SwingUtilities.isLeftMouseButton(button1DownEvent));
         assertFalse(SwingUtilities.isLeftMouseButton(button2DownEvent));
         assertFalse(SwingUtilities.isLeftMouseButton(button3DownEvent));
@@ -74,7 +84,6 @@
         assertTrue(SwingUtilities.isLeftMouseButton(button1Released));
         assertTrue(SwingUtilities.isLeftMouseButton(button1Clicked));
         assertFalse(SwingUtilities.isLeftMouseButton(button1DraggedEvent));
-
         assertFalse(SwingUtilities.isMiddleMouseButton(button1DownEvent));
         assertTrue(SwingUtilities.isMiddleMouseButton(button2DownEvent));
         assertFalse(SwingUtilities.isMiddleMouseButton(button3DownEvent));
@@ -82,7 +91,6 @@
         assertTrue(SwingUtilities.isMiddleMouseButton(button2Released));
         assertTrue(SwingUtilities.isMiddleMouseButton(button2Clicked));
         assertFalse(SwingUtilities.isMiddleMouseButton(button2DraggedEvent));
-
         assertFalse(SwingUtilities.isRightMouseButton(button1DownEvent));
         assertFalse(SwingUtilities.isRightMouseButton(button2DownEvent));
         assertTrue(SwingUtilities.isRightMouseButton(button3DownEvent));
@@ -97,5 +105,4 @@
         final JDialog dialog = new JDialog(f);
         assertSame(f, SwingUtilities.getAncestorOfClass(Frame.class, dialog));
     }
-
 }



Mime
View raw message