org.jivesoftware.spark.component
Class VerticalFlowLayout

java.lang.Object
  extended by java.awt.FlowLayout
      extended by org.jivesoftware.spark.component.VerticalFlowLayout
All Implemented Interfaces:
java.awt.LayoutManager, java.io.Serializable

public class VerticalFlowLayout
extends java.awt.FlowLayout

VerticalFlowLayout is similar to FlowLayout except it lays out components vertically. Extends FlowLayout because it mimics much of the behavior of the FlowLayout class, except vertically. An additional feature is that you can specify a fill to edge flag, which causes the VerticalFlowLayout manager to resize all components to expand to the column width Warning: This causes problems when the main panel has less space that it needs and it seems to prohibit multi-column output. Additionally there is a vertical fill flag, which fills the last component to the remaining height of the container.

See Also:
Serialized Form

Field Summary
static int BOTTOM
          Specify the alignment to be bottom.
static int MIDDLE
          Specify a middle alignment.
static int TOP
          Specify alignment top.
 
Fields inherited from class java.awt.FlowLayout
CENTER, LEADING, LEFT, RIGHT, TRAILING
 
Constructor Summary
VerticalFlowLayout()
          Construct a new VerticalFlowLayout with a middle alignment, and the fill to edge flag set.
VerticalFlowLayout(boolean hfill, boolean vfill)
          Construct a new VerticalFlowLayout with a middle alignment.
VerticalFlowLayout(int align)
          Construct a new VerticalFlowLayout with a middle alignment.
VerticalFlowLayout(int align, boolean hfill, boolean vfill)
          Construct a new VerticalFlowLayout.
VerticalFlowLayout(int align, int hgap, int vgap, boolean hfill, boolean vfill)
          Construct a new VerticalFlowLayout.
 
Method Summary
 boolean getHorizontalFill()
          Returns true if the layout horizontally fills.
 boolean getVerticalFill()
          Returns true if the layout vertically fills.
 void layoutContainer(java.awt.Container target)
          Lays out the container.
 java.awt.Dimension minimumLayoutSize(java.awt.Container target)
          Returns the minimum size needed to layout the target container.
 java.awt.Dimension preferredLayoutSize(java.awt.Container target)
          Returns the preferred dimensions given the components in the target container.
 void setHorizontalFill(boolean hfill)
          Set to true to enable horizontally fill.
 void setVerticalFill(boolean vfill)
          Set true to fill vertically.
 
Methods inherited from class java.awt.FlowLayout
addLayoutComponent, getAlignment, getHgap, getVgap, removeLayoutComponent, setAlignment, setHgap, setVgap, toString
 
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
Specify alignment top.

See Also:
Constant Field Values

MIDDLE

public static final int MIDDLE
Specify a middle alignment.

See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
Specify the alignment to be bottom.

See Also:
Constant Field Values
Constructor Detail

VerticalFlowLayout

public VerticalFlowLayout()
Construct a new VerticalFlowLayout with a middle alignment, and the fill to edge flag set.


VerticalFlowLayout

public VerticalFlowLayout(boolean hfill,
                          boolean vfill)
Construct a new VerticalFlowLayout with a middle alignment.

Parameters:
hfill - the fill to edge flag
vfill - the vertical fill in pixels.

VerticalFlowLayout

public VerticalFlowLayout(int align)
Construct a new VerticalFlowLayout with a middle alignment.

Parameters:
align - the alignment value

VerticalFlowLayout

public VerticalFlowLayout(int align,
                          boolean hfill,
                          boolean vfill)
Construct a new VerticalFlowLayout.

Parameters:
align - the alignment value
hfill - the horizontalfill in pixels.
vfill - the vertical fill in pixels.

VerticalFlowLayout

public VerticalFlowLayout(int align,
                          int hgap,
                          int vgap,
                          boolean hfill,
                          boolean vfill)
Construct a new VerticalFlowLayout.

Parameters:
align - the alignment value
hgap - the horizontal gap variable
vgap - the vertical gap variable
hfill - the fill to edge flag
vfill - true if the panel should vertically fill.
Method Detail

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container target)
Returns the preferred dimensions given the components in the target container.

Specified by:
preferredLayoutSize in interface java.awt.LayoutManager
Overrides:
preferredLayoutSize in class java.awt.FlowLayout
Parameters:
target - the component to lay out

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container target)
Returns the minimum size needed to layout the target container.

Specified by:
minimumLayoutSize in interface java.awt.LayoutManager
Overrides:
minimumLayoutSize in class java.awt.FlowLayout
Parameters:
target - the component to lay out.
Returns:
the minimum layout dimension.

setVerticalFill

public void setVerticalFill(boolean vfill)
Set true to fill vertically.

Parameters:
vfill - true to fill vertically.

getVerticalFill

public boolean getVerticalFill()
Returns true if the layout vertically fills.

Returns:
true if vertically fills the layout using the specified.

setHorizontalFill

public void setHorizontalFill(boolean hfill)
Set to true to enable horizontally fill.

Parameters:
hfill - true to fill horizontally.

getHorizontalFill

public boolean getHorizontalFill()
Returns true if the layout horizontally fills.

Returns:
true if horizontally fills.

layoutContainer

public void layoutContainer(java.awt.Container target)
Lays out the container.

Specified by:
layoutContainer in interface java.awt.LayoutManager
Overrides:
layoutContainer in class java.awt.FlowLayout
Parameters:
target - the container to lay out.