org.argouml.swingext
Class LabelledLayout

java.lang.Object
  |
  +--org.argouml.swingext.LabelledLayout
All Implemented Interfaces:
java.awt.LayoutManager, java.io.Serializable

public class LabelledLayout
extends java.lang.Object
implements java.awt.LayoutManager, java.io.Serializable

This layout manager lines up components in 2 columns. All JLabels are the first column and any component the JLabel is registered with is in a second column next to the label.

The height of each row is the largest minimum height of the 2 components.

The width of the first column is the largest preferred width of the 2 components.

The width of the 2nd column is any left over space or the maximum width of the component, whichever is the least.

LabelledLayout can show multiple panels of label/component pairs. The seperation of these panels is indicated by adding a Seperator component to the parent component. Labelled layout starts a new panel when detecting this Seperator.

See Also:
Serialized Form

Constructor Summary
LabelledLayout()
          Construct a new LabelledLayout.
LabelledLayout(boolean ignoreSplitters)
          Construct a new LabelledLayout.
LabelledLayout(int hgap, int vgap)
          Construct a new horizontal LabelledLayout with the specified cell spacing.
 
Method Summary
 void addLayoutComponent(java.lang.String name, java.awt.Component comp)
          Adds the specified component with the specified name to the layout.
 int getHgap()
           
static org.argouml.swingext.Seperator getSeperator()
           
 int getVgap()
           
 void layoutContainer(java.awt.Container parent)
           
 java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
           
 java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
          Determines the preferred size of the container argument using this labelled layout.
 void removeLayoutComponent(java.awt.Component comp)
          Removes the specified component with the specified name from the layout.
 void setHgap(int hgap)
           
 void setVgap(int vgap)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelledLayout

public LabelledLayout()
Construct a new LabelledLayout.


LabelledLayout

public LabelledLayout(boolean ignoreSplitters)
Construct a new LabelledLayout.


LabelledLayout

public LabelledLayout(int hgap,
                      int vgap)
Construct a new horizontal LabelledLayout with the specified cell spacing.

Method Detail

addLayoutComponent

public void addLayoutComponent(java.lang.String name,
                               java.awt.Component comp)
Adds the specified component with the specified name to the layout. This is included to satisfy the LayoutManager interface but is not actually used in this layout implementation.

Specified by:
addLayoutComponent in interface java.awt.LayoutManager
Parameters:
name - the name of the component
comp - the component to be added

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component comp)
Removes the specified component with the specified name from the layout. This is included to satisfy the LayoutManager interface but is not actually used in this layout implementation.

Specified by:
removeLayoutComponent in interface java.awt.LayoutManager

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Determines the preferred size of the container argument using this labelled layout. The preferred size is that all child components are in one section at their own preferred size with gaps and border indents.

Specified by:
preferredLayoutSize in interface java.awt.LayoutManager

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
Specified by:
minimumLayoutSize in interface java.awt.LayoutManager

layoutContainer

public void layoutContainer(java.awt.Container parent)
Specified by:
layoutContainer in interface java.awt.LayoutManager

getSeperator

public static org.argouml.swingext.Seperator getSeperator()

getHgap

public int getHgap()

setHgap

public void setHgap(int hgap)

getVgap

public int getVgap()

setVgap

public void setVgap(int vgap)


ArgoUML © 1996-2003 (20030919)ArgoUML Project HomeArgoUML Cookbook