charva.awt
Class VerticalFlowLayout

java.lang.Object
  extended by charva.awt.VerticalFlowLayout
All Implemented Interfaces:
LayoutManager

public class VerticalFlowLayout
extends java.lang.Object
implements LayoutManager

A concrete implementation of LayoutManager that lays out its components top-to-bottom.


Field Summary
static int BOTTOM
           
static int MIDDLE
           
static int TOP
           
 
Constructor Summary
VerticalFlowLayout()
          Default constructor.
VerticalFlowLayout(int align_, int hgap_, int vgap_)
          Use this constructor when you want to set the alignment and the horizontal and vertical gaps.
 
Method Summary
 void doLayout(Container container_)
          Lay out the components according to the specified alignment, hgap and vgap.
 int getAlignment()
          Gets the alignment for this layout.
 Dimension minimumSize(Container container_)
          Calculate the minimum-size rectangle that can enclose all the components in the given container.
 void setAlignment(int align_)
          Sets the alignment for this layout.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOP

public static final int TOP
See Also:
Constant Field Values

MIDDLE

public static final int MIDDLE
See Also:
Constant Field Values

BOTTOM

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

VerticalFlowLayout

public VerticalFlowLayout()
Default constructor. Sets alignment to MIDDLE, hgap to 1, and vgap to 0.


VerticalFlowLayout

public VerticalFlowLayout(int align_,
                          int hgap_,
                          int vgap_)
Use this constructor when you want to set the alignment and the horizontal and vertical gaps.

Method Detail

setAlignment

public void setAlignment(int align_)
Sets the alignment for this layout. Allowable values are VerticalFlowLayout.TOP, VerticalFlowLayout.MIDDLE and VerticalFlowLayout.BOTTOM.


getAlignment

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


minimumSize

public Dimension minimumSize(Container container_)
Calculate the minimum-size rectangle that can enclose all the components in the given container.

Specified by:
minimumSize in interface LayoutManager

doLayout

public void doLayout(Container container_)
Lay out the components according to the specified alignment, hgap and vgap. This is called when the size of the container has already been calculated. It lays out the components in a column, one at a time, until it determines that there is not enough space left in the column. Then it moves to the next row. If there is not enough horizontal space in the container to lay out all of the components, it removes the remaining components from the container; they don't appear at all.

Specified by:
doLayout in interface LayoutManager