[izpack-changes] r1533 - in izpack-src/trunk/src/lib/com/izforge/izpack: gui util

noreply at berlios.de noreply at berlios.de
Thu Aug 24 16:41:57 CEST 2006


Author: bartzkau
Date: 2006-08-24 16:41:56 +0200 (Thu, 24 Aug 2006)
New Revision: 1533

Modified:
   izpack-src/trunk/src/lib/com/izforge/izpack/gui/IzPanelLayout.java
   izpack-src/trunk/src/lib/com/izforge/izpack/util/OSClassHelper.java
Log:
Fix of a little bug in the size computing of stretched
components; javadoc.


Modified: izpack-src/trunk/src/lib/com/izforge/izpack/gui/IzPanelLayout.java
===================================================================
--- izpack-src/trunk/src/lib/com/izforge/izpack/gui/IzPanelLayout.java	2006-08-23 05:53:04 UTC (rev 1532)
+++ izpack-src/trunk/src/lib/com/izforge/izpack/gui/IzPanelLayout.java	2006-08-24 14:41:56 UTC (rev 1533)
@@ -396,16 +396,15 @@
         int stretchPart = (int) (pixels * maxStretch);
         if (stretchPart > 0)
         {
-            height += stretchPart;
             for (int i = 0; i < components.size(); ++i)
             {
                 if (stretchParts[i] < 0.00000001) continue;
                 IzPanelConstraints constraints = getConstraints(i, row);
                 Dimension size = constraints.component.getPreferredSize();
-                if (size.height * (1.0 + stretchParts[i]) < height)
-                    size.height = (int) (size.height * (1.0 + stretchParts[i]));
+                if (size.height + stretchPart * stretchParts[i] < height)
+                    size.height = (int) (height + stretchPart * stretchParts[i]);
                 else
-                    size.height = height;
+                    size.height = height + stretchPart;
                 if (constraints.component instanceof JScrollPane)
                 {   // This is a hack for text areas which uses word wrap. At tests
                     // they have a preferred width of 100 pixel which breaks the layout.
@@ -419,6 +418,7 @@
                 ((JComponent) constraints.component).setPreferredSize(size);
 
             }
+            height += stretchPart;
 
         }
         return (height);

Modified: izpack-src/trunk/src/lib/com/izforge/izpack/util/OSClassHelper.java
===================================================================
--- izpack-src/trunk/src/lib/com/izforge/izpack/util/OSClassHelper.java	2006-08-23 05:53:04 UTC (rev 1532)
+++ izpack-src/trunk/src/lib/com/izforge/izpack/util/OSClassHelper.java	2006-08-24 14:41:56 UTC (rev 1533)
@@ -86,11 +86,21 @@
 
     }
 
+    /**
+     * Return whether the helper can do the work or not.
+     * @return whether the helper can do the work or not
+     */
     public boolean good()
     {
         return (worker != null);
     }
 
+    /**
+     * Verifies the helper.
+     * @param idata current install data
+     * @return whether the helper is good or not
+     * @throws Exception
+     */
     public boolean verify(AutomatedInstallData idata) throws Exception
     {
         installdata = idata;




More information about the izpack-changes mailing list