|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbecker.gui.RowLayout
public class RowLayout
A RowLayout manages the layout of a container's components. The components are laid out in a row according to their preferred sizes. If the components will not fit into the container they are all scaled by the same amount in both the horizontal and vertical dimensions so they will fit.
By default, all components will be laid out so their bottoms are aligned. A RowLayout may also be set to align the tops or centers of the components. Similarly, the row itself is centered horizontally by default but may be set to align at either the left or the right of the container.
Field Summary | |
---|---|
static int |
ALIGN_BOTTOMS
Vertically align the bottoms of the components. |
static int |
ALIGN_CENTERS
Vertically align the centers of the components. |
static int |
ALIGN_TOPS
Vertically align the tops of the components. |
static int |
JUSTIFY_CENTER
Position the components in the center of the container. |
static int |
JUSTIFY_LEFT
Position the components as far left as possible within the container. |
static int |
JUSTIFY_RIGHT
Position the components as far right as possible within the container. |
Constructor Summary | |
---|---|
RowLayout()
Construct a new RowLayout layout manager which aligns component bottoms and center justifies the row. |
|
RowLayout(int alignment,
int justification)
Construst a new RowLayout layout manager. |
Method Summary | |
---|---|
void |
addLayoutComponent(String name,
Component comp)
Adds the specified component with the specified name to the layout. |
int |
getHgap()
Get the horizontal gap between components. |
void |
layoutContainer(Container parent)
Lays out the container in the specified panel. |
Dimension |
minimumLayoutSize(Container parent)
Calculates the minimum size dimensions for the specified panel given the components in the specified parent container. |
Dimension |
preferredLayoutSize(Container parent)
Calculates the preferred size dimensions for the specified panel given the components in the specified parent container. |
void |
removeLayoutComponent(Component comp)
Removes the specified component from the layout. |
void |
setHgap(int gap)
Set the horizontal gap between components. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ALIGN_BOTTOMS
public static final int ALIGN_CENTERS
public static final int ALIGN_TOPS
public static final int JUSTIFY_LEFT
public static final int JUSTIFY_CENTER
public static final int JUSTIFY_RIGHT
Constructor Detail |
---|
public RowLayout()
public RowLayout(int alignment, int justification)
alignment
- How the components are aligned vertically. One of
{ALIGN_BOTTOMS, ALIGN_CENTERS, ALIGN_TOPS}.justification
- How the row of components is justified horizontally.
One of {JUSTIFY_LEFT, JUSTIFY_CENTER, JUSTIFY_RIGHT}.Method Detail |
---|
public void addLayoutComponent(String name, Component comp)
addLayoutComponent
in interface LayoutManager
name
- the component namecomp
- the component to be addedpublic void removeLayoutComponent(Component comp)
removeLayoutComponent
in interface LayoutManager
comp
- the component to be removedpublic Dimension preferredLayoutSize(Container parent)
preferredLayoutSize
in interface LayoutManager
parent
- the component to be laid outminimumLayoutSize(java.awt.Container)
public Dimension minimumLayoutSize(Container parent)
minimumLayoutSize
in interface LayoutManager
parent
- the component to be laid outpreferredLayoutSize(java.awt.Container)
public void layoutContainer(Container parent)
layoutContainer
in interface LayoutManager
parent
- the component which needs to be laid outpublic void setHgap(int gap)
gap
- The gap between components, in pixels.public int getHgap()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |