info.clearthought.layout
Class SingleFiledLayout
java.lang.Object
info.clearthought.layout.SingleFiledLayout
- java.awt.LayoutManager, java.io.Serializable
public class SingleFiledLayout
extends java.lang.Object
implements java.awt.LayoutManager, java.io.Serializable
SingleFiledLayout lays out components singled filed. This layout manager is
like FlowLayout except that all components are placed in a single row or
column.
static int | BOTTOM - Bottom justify components
|
static int | CENTER - Center components
|
static int | COLUMN - Align components in a column
|
static int | DEFAULT_GAP - Default gap -- derived classes may override
|
static int | FULL - Full justify components
|
static int | LEFT - Left justify components
|
static int | RIGHT - Right justify components
|
static int | ROW - Align components in a row
|
static int | TOP - Top justify components
|
protected int | gap - Space between components in pixels
|
protected int | justification - LEFT, TOP, CENTER, FULL, BOTTOM, RIGHT -- how should components of different
sizes be aligned
|
protected int | orientation - ROW or COLUMN -- should the components be aligned in a row or column
|
SingleFiledLayout() - Constructs an instance of SingleFiledLayout that will align components in a
column using the default gap and LEFT justification.
|
SingleFiledLayout(int orientation) - Constructs an instance of SingleFiledLayout using the default gap and LEFT
or TOP justification.
|
SingleFiledLayout(int orientation, int justification, int gap) - Constructs an instance of SingleFiledLayout.
|
void | addLayoutComponent(String name, Component component) - Adds the specified component with the specified name to the layout.
|
void | layoutContainer(Container container) - To lay out the specified container using this layout.
|
Dimension | minimumLayoutSize(Container container) - Determines the minimum size of the container argument using this layout.
|
Dimension | preferredLayoutSize(Container container) - Determines the preferred size of the container argument using this layout.
|
void | removeLayoutComponent(Component component) - Removes the specified component with the specified name from the layout.
|
BOTTOM
public static final int BOTTOM
Bottom justify components
CENTER
public static final int CENTER
Center components
COLUMN
public static final int COLUMN
Align components in a column
DEFAULT_GAP
public static int DEFAULT_GAP
Default gap -- derived classes may override
FULL
public static final int FULL
Full justify components
LEFT
public static final int LEFT
Left justify components
RIGHT
public static final int RIGHT
Right justify components
ROW
public static final int ROW
Align components in a row
TOP
public static final int TOP
Top justify components
gap
protected int gap
Space between components in pixels
justification
protected int justification
LEFT, TOP, CENTER, FULL, BOTTOM, RIGHT -- how should components of different
sizes be aligned
orientation
protected int orientation
ROW or COLUMN -- should the components be aligned in a row or column
SingleFiledLayout
public SingleFiledLayout()
Constructs an instance of SingleFiledLayout that will align components in a
column using the default gap and LEFT justification.
SingleFiledLayout
public SingleFiledLayout(int orientation)
Constructs an instance of SingleFiledLayout using the default gap and LEFT
or TOP justification.
orientation
- ROW or COLUMN -- should the components be aligned in
a row or column
SingleFiledLayout
public SingleFiledLayout(int orientation,
int justification,
int gap)
Constructs an instance of SingleFiledLayout.
orientation
- ROW or COLUMN -- should the components be aligned in
a row or columnjustification
- LEFT, TOP, CENTER, FULL, BOTTOM, RIGHT -- how should
components of different sizes be alignedgap
- space between components in pixels
addLayoutComponent
public void addLayoutComponent(String name,
Component component)
Adds the specified component with the specified name to the layout.
name
- dummy parametercomponent
- component to add
layoutContainer
public void layoutContainer(Container container)
To lay out the specified container using this layout. This method
repositions the components in the specified target container.
User code should not have to call this method directly.
container
- container being served by this layout manager
minimumLayoutSize
public Dimension minimumLayoutSize(Container container)
Determines the minimum size of the container argument using this layout.
The minimum size is the smallest size that, if used for the container's
size, will ensure that no component is truncated. The minimum size is the
preferred size.
container
- container being served by this layout manager
- a dimension indicating the container's minimum size
preferredLayoutSize
public Dimension preferredLayoutSize(Container container)
Determines the preferred size of the container argument using this layout.
The preferred size is the smallest size that, if used for the container's
size, will ensure that no component is truncated when the component is it's
preferred size.
container
- container being served by this layout manager
- a dimension indicating the container's preferred size
removeLayoutComponent
public void removeLayoutComponent(Component component)
Removes the specified component with the specified name from the layout.
component
- component being removed