com.mindfusion.diagramming
Class VerticalFlowLayout

java.lang.Object
  extended by com.mindfusion.diagramming.VerticalFlowLayout
All Implemented Interfaces:
java.awt.LayoutManager, java.awt.LayoutManager2, java.io.Serializable

public class VerticalFlowLayout
extends java.lang.Object
implements java.awt.LayoutManager2, java.io.Serializable

A version of FlowLayout which arranges its components vertically.

See Also:
Serialized Form

Field Summary
static int BOTTOM
          This value indicates that each row of components should be bottom-justified.
static int CENTER
          This value indicates that each row of components should be centered.
static int LEFT
          This value indicates that the components should be left-aligned.
static int MIDDLE
          This value indicates that the components should be centered horizontally.
static int RIGHT
          This value indicates that the components should be right-aligned.
static int STRETCH
          This value indicates that the components should be stretched horizontally.
static int TOP
          This value indicates that each row of components should be top-justified.
 
Constructor Summary
VerticalFlowLayout()
          Initializes a new instance of the VerticalFlowLayout class with a centered alignment and a default 5-unit horizontal and vertical gap.
VerticalFlowLayout(int align)
          Initializes a new instance of the VerticalFlowLayout class with the specified alignment and a default 5-unit horizontal and vertical gap.
VerticalFlowLayout(int align, int hgap, int vgap)
          Initializes a new instance of the VerticalFlowLayout class with the indicated alignment and the indicated horizontal and vertical gaps.
VerticalFlowLayout(int halign, int align, int hgap, int vgap)
          Initializes a new instance of the VerticalFlowLayout class.
 
Method Summary
 void addLayoutComponent(java.awt.Component comp, java.lang.Object constraints)
           
 void addLayoutComponent(java.lang.String name, java.awt.Component comp)
           
 int getAlignment()
          Gets the alignment for this layout.
 int getHAlignment()
          Gets the horizontal alignment of layout components.
 int getHgap()
          Gets the horizontal gap between components and between the components and the borders of the Container.
 float getLayoutAlignmentX(java.awt.Container target)
           
 float getLayoutAlignmentY(java.awt.Container target)
           
 int getVgap()
          Gets the vertical gap between components and between the components and the borders of the Container.
 void invalidateLayout(java.awt.Container target)
           
 void layoutContainer(java.awt.Container target)
          Lays out the container.
 java.awt.Dimension maximumLayoutSize(java.awt.Container target)
           
 java.awt.Dimension minimumLayoutSize(java.awt.Container target)
          Returns the minimum dimensions needed to layout the visible components contained in the specified target container.
 java.awt.Dimension preferredLayoutSize(java.awt.Container target)
          Returns the preferred dimensions for this layout given the visible components in the specified target container.
 void removeLayoutComponent(java.awt.Component comp)
           
 void setAlignment(int value)
          Sets the alignment for this layout.
 void setHAlignment(int value)
          Sets the horizontal alignment of layout components.
 void setHgap(int hgap)
          Sets the horizontal gap between components and between the components and the borders of the Container.
 void setVgap(int vgap)
          Sets the vertical gap between components and between the components and the borders of the Container.
 java.lang.String toString()
          Returns a string representation of this VerticalFlowLayout object and its values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TOP

public static final int TOP
This value indicates that each row of components should be top-justified.

See Also:
Constant Field Values

CENTER

public static final int CENTER
This value indicates that each row of components should be centered.

See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
This value indicates that each row of components should be bottom-justified.

See Also:
Constant Field Values

LEFT

public static final int LEFT
This value indicates that the components should be left-aligned.

See Also:
Constant Field Values

MIDDLE

public static final int MIDDLE
This value indicates that the components should be centered horizontally.

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
This value indicates that the components should be right-aligned.

See Also:
Constant Field Values

STRETCH

public static final int STRETCH
This value indicates that the components should be stretched horizontally.

See Also:
Constant Field Values
Constructor Detail

VerticalFlowLayout

public VerticalFlowLayout()
Initializes a new instance of the VerticalFlowLayout class with a centered alignment and a default 5-unit horizontal and vertical gap.


VerticalFlowLayout

public VerticalFlowLayout(int align)
Initializes a new instance of the VerticalFlowLayout class with the specified alignment and a default 5-unit horizontal and vertical gap.


VerticalFlowLayout

public VerticalFlowLayout(int align,
                          int hgap,
                          int vgap)
Initializes a new instance of the VerticalFlowLayout class with the indicated alignment and the indicated horizontal and vertical gaps.


VerticalFlowLayout

public VerticalFlowLayout(int halign,
                          int align,
                          int hgap,
                          int vgap)
Initializes a new instance of the VerticalFlowLayout class.

Method Detail

getAlignment

public int getAlignment()
Gets the alignment for this layout.


setAlignment

public void setAlignment(int value)
Sets the alignment for this layout.


getHAlignment

public int getHAlignment()
Gets the horizontal alignment of layout components.


setHAlignment

public void setHAlignment(int value)
Sets the horizontal alignment of layout components.


getHgap

public int getHgap()
Gets the horizontal gap between components and between the components and the borders of the Container.


setHgap

public void setHgap(int hgap)
Sets the horizontal gap between components and between the components and the borders of the Container.


getVgap

public int getVgap()
Gets the vertical gap between components and between the components and the borders of the Container.


setVgap

public void setVgap(int vgap)
Sets the vertical gap between components and between the components and the borders of the Container.


addLayoutComponent

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

addLayoutComponent

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

removeLayoutComponent

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

getLayoutAlignmentX

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

getLayoutAlignmentY

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

invalidateLayout

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

maximumLayoutSize

public java.awt.Dimension maximumLayoutSize(java.awt.Container target)
Specified by:
maximumLayoutSize in interface java.awt.LayoutManager2

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container target)
Returns the preferred dimensions for this layout given the visible components in the specified target container.

Specified by:
preferredLayoutSize in interface java.awt.LayoutManager

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container target)
Returns the minimum dimensions needed to layout the visible components contained in the specified target container.

Specified by:
minimumLayoutSize in interface java.awt.LayoutManager

layoutContainer

public void layoutContainer(java.awt.Container target)
Lays out the container. This method lets each visible component take its preferred size by reshaping the components in the target container in order to satisfy the alignment of this VerticalFlowLayout object.

Specified by:
layoutContainer in interface java.awt.LayoutManager

toString

public java.lang.String toString()
Returns a string representation of this VerticalFlowLayout object and its values.

Overrides:
toString in class java.lang.Object