public class SingleFiledLayout
extends java.lang.Object
implements java.awt.LayoutManager, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
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
|
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
|
static int |
LEFT
Left justify components
|
protected int |
orientation
ROW or COLUMN -- should the components be aligned in a row or column
|
static int |
RIGHT
Right justify components
|
static int |
ROW
Align components in a row
|
static int |
TOP
Top justify components
|
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
void |
addLayoutComponent(java.lang.String name,
java.awt.Component component)
Adds the specified component with the specified name to the layout.
|
void |
layoutContainer(java.awt.Container container)
To lay out the specified container using this layout.
|
java.awt.Dimension |
minimumLayoutSize(java.awt.Container container)
Determines the minimum size of the container argument using this layout.
|
java.awt.Dimension |
preferredLayoutSize(java.awt.Container container)
Determines the preferred size of the container argument using this layout.
|
void |
removeLayoutComponent(java.awt.Component component)
Removes the specified component with the specified name from the layout.
|
public static final int COLUMN
public static final int ROW
public static final int LEFT
public static final int TOP
public static final int CENTER
public static final int FULL
public static final int BOTTOM
public static final int RIGHT
public static int DEFAULT_GAP
protected int orientation
protected int justification
protected int gap
public SingleFiledLayout()
public SingleFiledLayout(int orientation)
orientation
- ROW or COLUMN -- should the components be aligned in a row or columnpublic SingleFiledLayout(int orientation, int justification, int gap)
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 pixelspublic void layoutContainer(java.awt.Container container)
User code should not have to call this method directly.
layoutContainer
in interface java.awt.LayoutManager
container
- container being served by this layout managerpublic java.awt.Dimension preferredLayoutSize(java.awt.Container container)
preferredLayoutSize
in interface java.awt.LayoutManager
container
- container being served by this layout managerpublic java.awt.Dimension minimumLayoutSize(java.awt.Container container)
minimumLayoutSize
in interface java.awt.LayoutManager
container
- container being served by this layout managerpublic void addLayoutComponent(java.lang.String name, java.awt.Component component)
addLayoutComponent
in interface java.awt.LayoutManager
name
- dummy parametercomponent
- component to addpublic void removeLayoutComponent(java.awt.Component component)
removeLayoutComponent
in interface java.awt.LayoutManager
component
- component being removed