[Schmitzm-commits] r64 - trunk/src/schmitzm/swing

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sun Apr 19 13:30:03 CEST 2009


Author: alfonx
Date: 2009-04-19 13:30:02 +0200 (Sun, 19 Apr 2009)
New Revision: 64

Modified:
   trunk/src/schmitzm/swing/SpringUtilities.java
Log:
* Junst renamed a variable name, as it was misleading.

Modified: trunk/src/schmitzm/swing/SpringUtilities.java
===================================================================
--- trunk/src/schmitzm/swing/SpringUtilities.java	2009-04-17 18:59:10 UTC (rev 63)
+++ trunk/src/schmitzm/swing/SpringUtilities.java	2009-04-19 11:30:02 UTC (rev 64)
@@ -56,13 +56,13 @@
      * @param xPad x padding between cells
      * @param yPad y padding between cells
      */
-    public static void makeGrid(Container parent,
+    public static void makeGrid(Container container,
                                 int rows, int cols,
                                 int initialX, int initialY,
                                 int xPad, int yPad) {
         SpringLayout layout;
         try {
-            layout = (SpringLayout)parent.getLayout();
+            layout = (SpringLayout)container.getLayout();
         } catch (ClassCastException exc) {
             System.err.println("The first argument to makeGrid must use SpringLayout.");
             return;
@@ -74,17 +74,17 @@
         Spring initialYSpring = Spring.constant(initialY);
 //### SCHMITZM-01.sc
 //      int max = rows * cols;
-        int max = Math.min(rows*cols,parent.getComponentCount());
+        int max = Math.min(rows*cols,container.getComponentCount());
 //### SCHMITZM-01.ec
         //Calculate Springs that are the max of the width/height so that all
         //cells have the same size.
-        Spring maxWidthSpring = layout.getConstraints(parent.getComponent(0)).
+        Spring maxWidthSpring = layout.getConstraints(container.getComponent(0)).
                                     getWidth();
-        Spring maxHeightSpring = layout.getConstraints(parent.getComponent(0)).
+        Spring maxHeightSpring = layout.getConstraints(container.getComponent(0)).
                                     getWidth();
         for (int i = 1; i < max; i++) {
             SpringLayout.Constraints cons = layout.getConstraints(
-                                            parent.getComponent(i));
+                                            container.getComponent(i));
 
             maxWidthSpring = Spring.max(maxWidthSpring, cons.getWidth());
             maxHeightSpring = Spring.max(maxHeightSpring, cons.getHeight());
@@ -94,7 +94,7 @@
         //components to have the same size.
         for (int i = 0; i < max; i++) {
             SpringLayout.Constraints cons = layout.getConstraints(
-                                            parent.getComponent(i));
+                                            container.getComponent(i));
 
             cons.setWidth(maxWidthSpring);
             cons.setHeight(maxHeightSpring);
@@ -106,7 +106,7 @@
         SpringLayout.Constraints lastRowCons = null;
         for (int i = 0; i < max; i++) {
             SpringLayout.Constraints cons = layout.getConstraints(
-                                                 parent.getComponent(i));
+                                                 container.getComponent(i));
             if (i % cols == 0) { //start of new row
                 lastRowCons = lastCons;
                 cons.setX(initialXSpring);
@@ -125,7 +125,7 @@
         }
 
         //Set the parent's size.
-        SpringLayout.Constraints pCons = layout.getConstraints(parent);
+        SpringLayout.Constraints pCons = layout.getConstraints(container);
         pCons.setConstraint(SpringLayout.SOUTH,
                             Spring.sum(
                                 Spring.constant(yPad),



More information about the Schmitzm-commits mailing list