svn commit: r16654 - trunk/src/argouml-app/src/org/argouml/uml/ui/LabelledLayout.java

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2009-01-18 14:01:27-0800
New Revision: 16654

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/ui/LabelledLayout.java

Log:
Javadoc and code tidy. No effective change.

Modified: trunk/src/argouml-app/src/org/argouml/uml/ui/LabelledLayout.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/LabelledLayout.java?view=diff&pathrev=16654&r1=16653&r2=16654
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/ui/LabelledLayout.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/ui/LabelledLayout.java	2009-01-18 14:01:27-0800
@@ -24,7 +24,6 @@
 
 package org.argouml.uml.ui;
 
-import java.awt.Color;
 import java.awt.Component;
 import java.awt.Container;
 import java.awt.Dimension;
@@ -125,6 +124,8 @@
     /**
      * Construct a new horizontal LabelledLayout with the specified
      * cell spacing.
+     * @param hgap The horizontal gap between components
+     * @param vgap The vertical gap between components
      */
     public LabelledLayout(int hgap, int vgap) {
         this.ignoreSplitters = false;
@@ -389,13 +390,15 @@
                                 unknownHeightCount--, 
                                 childComp);
                     } catch (ArithmeticException e) {
+                        String lookAndFeel = 
+                            UIManager.getLookAndFeel().getClass().getName();
                         throw new IllegalStateException(
                                 "Division by zero laying out "
                                 + childComp.getClass().getName()
                                 + " on " + parent.getClass().getName()
                                 + " in section " + sectionNo
                                 + " using "
-                                + UIManager.getLookAndFeel().getClass().getName(),
+                                + lookAndFeel,
                                 e);
                     }
                     totalHeight += rowHeight;
@@ -415,7 +418,8 @@
     
     /**
      * @param childComp a component
-     * @return 0 for a resizable component or a positive value for its fixed height
+     * @return 0 for a resizable component or a positive value for its fixed
+     * height
      */
     private int getChildHeight(Component childComp) {
         if (isResizable(childComp)) {
@@ -445,10 +449,18 @@
      * space.
      */
     private boolean isResizable(Component comp) {
-        if (comp == null) return false;
-        if (comp instanceof JComboBox) return false;
-        if (comp.getPreferredSize() == null) return false;
-        if (comp.getMinimumSize() == null) return false;
+        if (comp == null) {
+            return false;
+        }
+        if (comp instanceof JComboBox) {
+            return false;
+        }
+        if (comp.getPreferredSize() == null) {
+            return false;
+        }
+        if (comp.getMinimumSize() == null) {
+            return false;
+        }
         return (getMinimumHeight(comp) < getPreferredHeight(comp));
     }
 
@@ -478,22 +490,40 @@
         return (int) comp.getMaximumSize().getWidth();
     }
     
+    /**
+     * Create a new instance of the Separator that splits the layout in columns
+     * @return the separator
+     */
     public static Seperator getSeparator() {
         return new Seperator();
     }
 
+    /**
+     * @return the horizontal gaps between components
+     */
     public int getHgap() {
         return this.hgap;
     }
 
+    /**
+     * Set the horizontal gaps between components
+     * @param hgap the horizontal gap
+     */
     public void setHgap(int hgap) {
         this.hgap = hgap;
     }
 
+    /**
+     * @return the vertical gaps between components
+     */
     public int getVgap() {
         return this.vgap;
     }
 
+    /**
+     * Set the vertical gaps between components
+     * @param vgap the horizontal gap
+     */
     public void setVgap(int vgap) {
         this.vgap = vgap;
     }

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=1033342

To unsubscribe from this discussion, e-mail: [[email protected]].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.