|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.swing.layout.dock.DockLayout
public class DockLayout
The flexible border layout is a layout manager that is similar to the
BorderLayout, but allows dynamic resizing of the components and adjusting the
main orientation of the components.
Is also serves as base class for more advance layout managers like the DockLayout
The flexible border layout lays out a container, arranging and resizing
its components to fit in five regions: North, south, east, west, and center.
Each component is optional, so layouts consisting of i. e. only a east, west and center
component are possible.
The orientation (property setHorizontalOrder(boolean)) determines how the
components will be arranged in the container.
horizontalOrder = true:
The north and south components have the same width as the center component.
The component arrangement appears rather horizontally ordered.
| Field Summary | |
|---|---|
static java.lang.String |
STR_BOTTOM
Alternative shorthand string constraing of south component (bottom of container). |
static java.lang.String |
STR_CENTER
Shorthand string constraing of center component (middle of container). |
static java.lang.String |
STR_EAST
Shorthand string constraing of east component (right side of container). |
static java.lang.String |
STR_LEFT
Alternative shorthand string constraing of west component (left side of container). |
static java.lang.String |
STR_NORTH
Shorthand string constraing of north component (top of container). |
static java.lang.String |
STR_RIGHT
Alternative shorthand string constraing of east component (right side of container). |
static java.lang.String |
STR_SOUTH
Shorthand string constraing of south component (bottom of container). |
static java.lang.String |
STR_TOP
Alternative shorthand string constraing of north component (top of container). |
static java.lang.String |
STR_WEST
Shorthand string constraing of west component (left side of container). |
| Constructor Summary | |
|---|---|
DockLayout()
Constructs a new dock layout with no gaps between components. |
|
DockLayout(int horizontalGap,
int verticalGap)
Constructs a dock layout with the specified gaps between components. |
|
| Method Summary | |
|---|---|
void |
addLayoutComponent(java.awt.Component comp,
java.lang.Object constraints)
Adds the specified component to the layout, using the specified constraint object. |
void |
addLayoutComponent(java.lang.String constraint,
java.awt.Component comp)
Deprecated. replaced by addLayoutComponent(Component,Object) |
protected java.awt.Component |
getComponent(int index)
Gets the component that corresponds to the given index if it is visible. |
int |
getHgap()
Returns the horizontal gap between components. |
boolean |
getHorizontalOrder()
Gets the main order of the components. |
float |
getLayoutAlignmentX(java.awt.Container parent)
Returns the alignment along the x axis. |
float |
getLayoutAlignmentY(java.awt.Container parent)
Returns the alignment along the y axis. |
int |
getVgap()
Returns the vertical gap between components. |
void |
invalidateLayout(java.awt.Container target)
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded. |
void |
layoutContainer(java.awt.Container target)
Lays out the container argument using this dock layout. |
java.awt.Dimension |
maximumLayoutSize(java.awt.Container target)
Returns the maximum dimensions for this layout given the components in the specified target container. |
java.awt.Dimension |
minimumLayoutSize(java.awt.Container target)
Determines the minimum size of the target container using this layout manager. |
java.awt.Dimension |
preferredLayoutSize(java.awt.Container target)
Determines the preferred size of the target container using this layout manager, based on the components in the container. |
void |
removeLayoutComponent(java.awt.Component comp)
Removes the specified component from this dock layout. |
void |
setHgap(int horizontalGap)
Sets the horizontal gap between components. |
void |
setHorizontalOrder(boolean horizontalOrder)
Sets the main order of the components. |
void |
setVgap(int verticalGap)
Sets the vertical gap between components. |
protected int |
stringConstraintToIndex(java.lang.String constraint)
Gets the component array index that corresponds to a given constraint shortcut. |
java.lang.String |
toString()
Returns a string representation of the state of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String STR_CENTER
public static final java.lang.String STR_NORTH
public static final java.lang.String STR_SOUTH
public static final java.lang.String STR_EAST
public static final java.lang.String STR_WEST
public static final java.lang.String STR_TOP
public static final java.lang.String STR_BOTTOM
public static final java.lang.String STR_RIGHT
public static final java.lang.String STR_LEFT
| Constructor Detail |
|---|
public DockLayout()
public DockLayout(int horizontalGap,
int verticalGap)
horizontalGap - the horizontal gapverticalGap - the vertical gap| Method Detail |
|---|
public boolean getHorizontalOrder()
public void setHorizontalOrder(boolean horizontalOrder)
horizontalOrder - true The components appear horizontally ordered.public int getHgap()
public void setHgap(int horizontalGap)
public int getVgap()
public void setVgap(int verticalGap)
public void addLayoutComponent(java.awt.Component comp,
java.lang.Object constraints)
addLayoutComponent in interface java.awt.LayoutManager2comp - Component to be addedconstraints - Object that specifies how and where
the component is added to the layout.
java.lang.IllegalArgumentException - if the constraint object is not
a string, or if it is not one of the five specified constants.
public void addLayoutComponent(java.lang.String constraint,
java.awt.Component comp)
addLayoutComponent(Component,Object)
addLayoutComponent in interface java.awt.LayoutManagerconstraint - Component constraintcomp - Component to be addedpublic void removeLayoutComponent(java.awt.Component comp)
removeLayoutComponent in interface java.awt.LayoutManagercomp - Component to be removedpublic void layoutContainer(java.awt.Container target)
layoutContainer in interface java.awt.LayoutManagertarget - Container in which to do the layoutpublic java.awt.Dimension preferredLayoutSize(java.awt.Container target)
preferredLayoutSize in interface java.awt.LayoutManagertarget - Container in which to do the layout
public java.awt.Dimension minimumLayoutSize(java.awt.Container target)
minimumLayoutSize in interface java.awt.LayoutManagertarget - Container in which to do the layout
public java.awt.Dimension maximumLayoutSize(java.awt.Container target)
maximumLayoutSize in interface java.awt.LayoutManager2target - Component which needs to be laid out
public float getLayoutAlignmentX(java.awt.Container parent)
getLayoutAlignmentX in interface java.awt.LayoutManager2parent - Container the layout has been applied to
public float getLayoutAlignmentY(java.awt.Container parent)
getLayoutAlignmentY in interface java.awt.LayoutManager2parent - Container the layout has been applied to
public void invalidateLayout(java.awt.Container target)
invalidateLayout in interface java.awt.LayoutManager2target - Container the layout has been applied toprotected java.awt.Component getComponent(int index)
index - Index into component child array or null
protected int stringConstraintToIndex(java.lang.String constraint)
constraint - String constraing ("North", "Bottom", "Center" etc.)
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||