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

Same as the standard java class GridLayout but allows more flexability for sizing of columns and rows.

See Also:
Serialized Form

Field Summary
protected  int labelWidth
          The required cell width of the labels column
protected  int largestHeight
          The height of the child component with the largest height
protected  int largestWidth
          The width of the child component with the largest width
 
Constructor Summary
LabelledLayout()
          Construct a new GridLayout2 with a default of one column per component, in a single row.
LabelledLayout(int hgap, int vgap)
          Construct a new GridLayout2 with the specified number of rows and columns, cell spacing and cell sizing scheme.
LabelledLayout(Orientation orientation)
          Construct a new GridLayout2 with a default of one column per component, in a single row.
 
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
 

Field Detail

largestHeight

protected int largestHeight
The height of the child component with the largest height

largestWidth

protected int largestWidth
The width of the child component with the largest width

labelWidth

protected int labelWidth
The required cell width of the labels column
Constructor Detail

LabelledLayout

public LabelledLayout()
Construct a new GridLayout2 with a default of one column per component, in a single row.

LabelledLayout

public LabelledLayout(Orientation orientation)
Construct a new GridLayout2 with a default of one column per component, in a single row.

LabelledLayout

public LabelledLayout(int hgap,
                      int vgap)
Construct a new GridLayout2 with the specified number of rows and columns, cell spacing and cell sizing scheme.
Parameters:
rows - the number of rows in the layout
cols - the number of columns in the layout
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
Parameters:
name - the name of the component

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Determines the preferred size of the container argument using this labelled layout.
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

getHgap

public int getHgap()

setHgap

public void setHgap(int hgap)

getVgap

public int getVgap()

setVgap

public void setVgap(int vgap)

getSeperator

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


ArgoUML (c) 1996-2002
ArgoUML Project Home
ArgoUML Cookbook