wyvern.common.util
Class ColumnLayout

java.lang.Object
  extended bywyvern.common.util.ColumnLayout
All Implemented Interfaces:
java.awt.LayoutManager, java.awt.LayoutManager2

public class ColumnLayout
extends java.lang.Object
implements java.awt.LayoutManager2

This LayoutManager arranges the components into a column. Components are always given their preferred size. When you create a ColumnLayout, you may specify four values: margin_height -- how much space to leave on top and bottom margin_width -- how much space to leave on left and right spacing -- how much vertical space to leave between items alignment -- the horizontal position of the components: ColumnLayout.LEFT -- left-justify the components ColumnLayout.CENTER -- horizontally center the components ColumnLayout.RIGHT -- right-justify the components You never call the methods of a ColumnLayout object. Just create one and make it the layout manager for your container by passing it to the addLayout() method of the Container object.


Field Summary
protected  int alignment
           
static int CENTER
           
static int LEFT
           
protected  int margin_height
           
protected  int margin_width
           
static int RIGHT
           
protected  int spacing
           
 
Constructor Summary
ColumnLayout()
          A default constructor that creates a ColumnLayout using 5-pixel margin width and height, 5-pixel spacing, and left alignment
ColumnLayout(int margin_height, int margin_width, int spacing, int alignment)
          The constructor.
 
Method Summary
 void addLayoutComponent(java.awt.Component comp, java.lang.Object constraint)
           
 void addLayoutComponent(java.lang.String constraint, java.awt.Component comp)
           
 float getLayoutAlignmentX(java.awt.Container parent)
           
 float getLayoutAlignmentY(java.awt.Container parent)
           
 void invalidateLayout(java.awt.Container parent)
           
 void layoutContainer(java.awt.Container parent)
          The method that actually performs the layout.
protected  java.awt.Dimension layoutSize(java.awt.Container parent, int sizetype)
           
 java.awt.Dimension maximumLayoutSize(java.awt.Container parent)
          The Container calls this to find out how big the layout can be
 java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
          The Container calls this to find out how big the layout must be
 java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
          The Container calls this to find out how big the layout should to be
 void removeLayoutComponent(java.awt.Component comp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

margin_height

protected int margin_height

margin_width

protected int margin_width

spacing

protected int spacing

alignment

protected int alignment

LEFT

public static final int LEFT
See Also:
Constant Field Values

CENTER

public static final int CENTER
See Also:
Constant Field Values

RIGHT

public static final int RIGHT
See Also:
Constant Field Values
Constructor Detail

ColumnLayout

public ColumnLayout(int margin_height,
                    int margin_width,
                    int spacing,
                    int alignment)
The constructor. See comment above for meanings of these arguments


ColumnLayout

public ColumnLayout()
A default constructor that creates a ColumnLayout using 5-pixel margin width and height, 5-pixel spacing, and left alignment

Method Detail

layoutContainer

public void layoutContainer(java.awt.Container parent)
The method that actually performs the layout. Called by the Container

Specified by:
layoutContainer in interface java.awt.LayoutManager

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
The Container calls this to find out how big the layout should to be

Specified by:
preferredLayoutSize in interface java.awt.LayoutManager

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
The Container calls this to find out how big the layout must be

Specified by:
minimumLayoutSize in interface java.awt.LayoutManager

maximumLayoutSize

public java.awt.Dimension maximumLayoutSize(java.awt.Container parent)
The Container calls this to find out how big the layout can be

Specified by:
maximumLayoutSize in interface java.awt.LayoutManager2

layoutSize

protected java.awt.Dimension layoutSize(java.awt.Container parent,
                                        int sizetype)

addLayoutComponent

public void addLayoutComponent(java.lang.String constraint,
                               java.awt.Component comp)
Specified by:
addLayoutComponent in interface java.awt.LayoutManager

addLayoutComponent

public void addLayoutComponent(java.awt.Component comp,
                               java.lang.Object constraint)
Specified by:
addLayoutComponent in interface java.awt.LayoutManager2

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component comp)
Specified by:
removeLayoutComponent in interface java.awt.LayoutManager

invalidateLayout

public void invalidateLayout(java.awt.Container parent)
Specified by:
invalidateLayout in interface java.awt.LayoutManager2

getLayoutAlignmentX

public float getLayoutAlignmentX(java.awt.Container parent)
Specified by:
getLayoutAlignmentX in interface java.awt.LayoutManager2

getLayoutAlignmentY

public float getLayoutAlignmentY(java.awt.Container parent)
Specified by:
getLayoutAlignmentY in interface java.awt.LayoutManager2