|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.lwuit.layouts.Layout com.sun.lwuit.layouts.BorderLayout
public class BorderLayout
A border layout lays out a container, arranging and resizing its components to fit in five regions: north, south, east, west, and center. Each region may contain no more than one component, and is identified by a corresponding constant: NORTH, SOUTH, EAST, WEST, and CENTER. When adding a component to a container with a border layout, use one of these five constants.
Field Summary | |
---|---|
static java.lang.String |
CENTER
The center layout constraint (middle of container) |
static int |
CENTER_BEHAVIOR_CENTER
Defines the behavior of the component placed in the center position of the layout, places the component in the center of the space availble to the center component. |
static int |
CENTER_BEHAVIOR_CENTER_ABSOLUTE
Defines the behavior of the component placed in the center position of the layout, places the component in the center of the surrounding container |
static int |
CENTER_BEHAVIOR_SCALE
Defines the behavior of the component placed in the center position of the layout, by default it is scaled to the available space |
static java.lang.String |
EAST
The east layout constraint (right of container). |
static java.lang.String |
NORTH
The north layout constraint (top of container). |
static java.lang.String |
SOUTH
The south layout constraint (bottom of container). |
static java.lang.String |
WEST
The west layout constraint (left of container). |
Constructor Summary | |
---|---|
BorderLayout()
Creates a new instance of BorderLayout |
Method Summary | |
---|---|
void |
addLayoutComponent(java.lang.Object name,
Component comp,
Container c)
Some layouts can optionally track the addition of elements with meta-data that allows the user to "hint" on object positioning. |
void |
defineLandscapeSwap(java.lang.String portraitPosition,
java.lang.String landscapePosition)
This method allows swapping positions within the border layout when the layout orientation changes to landscape or if the layout starts off as landscape. |
boolean |
equals(java.lang.Object o)
|
Component |
getCenter()
Returns the component in the center location |
int |
getCenterBehavior()
Defines the behavior of the center component to one of the constants defined in this class |
java.lang.Object |
getComponentConstraint(Component comp)
Returns the component constraint |
Component |
getEast()
Returns the component in the east location |
java.lang.String |
getLandscapeSwap(java.lang.String portraitPosition)
Returns the landscape swap destination for the given border layout element if such a destination is defined. |
Component |
getNorth()
Returns the component in the north location |
Dimension |
getPreferredSize(Container parent)
Returns the container preferred size |
Component |
getSouth()
Returns the component in the south location |
Component |
getWest()
Returns the component in the west location |
boolean |
isAbsoluteCenter()
Deprecated. use center behavior instead |
void |
layoutContainer(Container target)
Layout the given parent container children |
void |
removeLayoutComponent(Component comp)
Removes the component from the layout this operation is only useful if the layout maintains references to components within it |
void |
setAbsoluteCenter(boolean absoluteCenter)
Deprecated. use center behavior instead |
void |
setCenterBehavior(int centerBehavior)
Defines the behavior of the center component to one of the constants defined in this class |
java.lang.String |
toString()
|
Methods inherited from class com.sun.lwuit.layouts.Layout |
---|
hashCode, isOverlapSupported |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int CENTER_BEHAVIOR_SCALE
public static final int CENTER_BEHAVIOR_CENTER
public static final int CENTER_BEHAVIOR_CENTER_ABSOLUTE
public static final java.lang.String NORTH
public static final java.lang.String SOUTH
public static final java.lang.String CENTER
public static final java.lang.String WEST
public static final java.lang.String EAST
Constructor Detail |
---|
public BorderLayout()
Method Detail |
---|
public void addLayoutComponent(java.lang.Object name, Component comp, Container c)
Layout
addLayoutComponent
in class Layout
name
- optional meta data information, like alignment orientationcomp
- the added component to the layoutc
- the parent containerpublic void removeLayoutComponent(Component comp)
Layout
removeLayoutComponent
in class Layout
comp
- the removed component from layoutpublic java.lang.Object getComponentConstraint(Component comp)
getComponentConstraint
in class Layout
comp
- the component whose constraint is queried
public void layoutContainer(Container target)
Layout
layoutContainer
in class Layout
target
- the given parent containerpublic Dimension getPreferredSize(Container parent)
Layout
getPreferredSize
in class Layout
parent
- the parent container
public Component getSouth()
public Component getCenter()
public Component getNorth()
public Component getEast()
public Component getWest()
public java.lang.String toString()
toString
in class java.lang.Object
public void defineLandscapeSwap(java.lang.String portraitPosition, java.lang.String landscapePosition)
portraitPosition
- the position for the component when in portrait (this position
should always be used when adding a component to the layout). One of NORTH/SOUTH/EAST/WEST/CENTER.landscapePosition
- the destination position to use in landscapepublic java.lang.String getLandscapeSwap(java.lang.String portraitPosition)
portraitPosition
- the constraint used when placing the component
public boolean equals(java.lang.Object o)
equals
in class Layout
public boolean isAbsoluteCenter()
public void setAbsoluteCenter(boolean absoluteCenter)
absoluteCenter
- the absoluteCenter to setpublic int getCenterBehavior()
public void setCenterBehavior(int centerBehavior)
centerBehavior
- the centerBehavior to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |