Package com.portal.ctrl
Class ColumnFlowLayout
java.lang.Object
com.portal.ctrl.ColumnFlowLayout
- All Implemented Interfaces:
LayoutManager,Serializable
Simlar to flow layout, but lays out components top to bottom, not
left to right.
- Version:
- %version: 1 % %date_modified: Thu Jun 10 18:47:50 1999 %
- Author:
- larrylf
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new Flow Layout with a centered alignment and a default 5-unit horizontal and vertical gap.ColumnFlowLayout(int hgap, int vgap) Creates a new flow layout manager with the indicated alignment and the indicated horizontal and vertical gaps. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLayoutComponent(String name, Component comp) Adds the specified component to the layout.intgetHgap()Gets the horizontal gap between components.intgetVgap()Gets the vertical gap between components.voidlayoutContainer(Container target) Lays out the container.minimumLayoutSize(Container target) Returns the minimum dimensions needed to layout the components contained in the specified target container.preferredLayoutSize(Container target) Returns the preferred dimensions for this layout given the components in the specified target container.voidRemoves the specified component from the layout.voidsetHgap(int hgap) Sets the horizontal gap between components.voidsetVgap(int vgap) Sets the vertical gap between components.toString()Returns a string representation of thisFlowLayoutobject and its values.
-
Constructor Details
-
ColumnFlowLayout
public ColumnFlowLayout()Constructs a new Flow Layout with a centered alignment and a default 5-unit horizontal and vertical gap. -
ColumnFlowLayout
public ColumnFlowLayout(int hgap, int vgap) Creates a new flow layout manager with the indicated alignment and the indicated horizontal and vertical gaps.The value of the alignment argument must be one of
FlowLayout.LEFT,FlowLayout.RIGHT, orFlowLayout.CENTER.- Parameters:
hgap- the horizontal gap between components.vgap- the vertical gap between components.
-
-
Method Details
-
getHgap
public int getHgap()Gets the horizontal gap between components.- Returns:
- the horizontal gap between components.
-
setHgap
public void setHgap(int hgap) Sets the horizontal gap between components.- Parameters:
hgap- the horizontal gap between components
-
getVgap
public int getVgap()Gets the vertical gap between components.- Returns:
- the vertical gap between components.
-
setVgap
public void setVgap(int vgap) Sets the vertical gap between components.- Parameters:
vgap- the vertical gap between components
-
addLayoutComponent
Adds the specified component to the layout. Not used by this class.- Specified by:
addLayoutComponentin interfaceLayoutManager- Parameters:
name- the name of the componentcomp- the component to be added
-
removeLayoutComponent
Removes the specified component from the layout. Not used by this class.- Specified by:
removeLayoutComponentin interfaceLayoutManager- Parameters:
comp- the component to remove
-
preferredLayoutSize
Returns the preferred dimensions for this layout given the components in the specified target container.- Specified by:
preferredLayoutSizein interfaceLayoutManager- Parameters:
target- the component which needs to be laid out- Returns:
- the preferred dimensions to lay out the subcomponents of the specified container.
-
minimumLayoutSize
Returns the minimum dimensions needed to layout the components contained in the specified target container.- Specified by:
minimumLayoutSizein interfaceLayoutManager- Parameters:
target- the component which needs to be laid out- Returns:
- the minimum dimensions to lay out the subcomponents of the specified container.
-
layoutContainer
Lays out the container. This method lets each component take its preferred size by reshaping the components in the target container in order to satisfy the constraints of thisColumnFlowLayoutobject.- Specified by:
layoutContainerin interfaceLayoutManager- Parameters:
target- the specified component being laid out.
-
toString
Returns a string representation of thisFlowLayoutobject and its values.
-