Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
java.awt.BorderLayout
Field Summary | |
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
Constructor Summary | |
| |
|
Method Summary | |
void |
|
void |
|
Object |
|
int |
|
float |
|
float |
|
Component |
|
Component |
|
int |
|
void |
|
void |
|
Dimension |
|
Dimension |
|
Dimension |
|
void |
|
void |
|
void |
|
String |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public static final String AFTER_LAST_LINE
The constant indicating the position after the last line of the layout. The exact position depends on the writing system: For a top-to-bottom orientation, it is the same asSOUTH
, for a bottom-to-top orientation, it is the same asNORTH
.This constant is an older name for
PAGE_END
which has exactly the same value.
- Field Value:
- "Last"
- Since:
- 1.2
public static final String AFTER_LINE_ENDS
The constant indicating the position after the last item of the layout. The exact position depends on the writing system: For a left-to-right orientation, it is the same asEAST
, for a right-to-left orientation, it is the same asWEST
.This constant is an older name for
LINE_END
which has exactly the same value.
- Field Value:
- "After"
- Since:
- 1.2
public static final String BEFORE_FIRST_LINE
The constant indicating the position before the first line of the layout. The exact position depends on the writing system: For a top-to-bottom orientation, it is the same asNORTH
, for a bottom-to-top orientation, it is the same asSOUTH
.This constant is an older name for
PAGE_START
which has exactly the same value.
- Field Value:
- "First"
- Since:
- 1.2
public static final String BEFORE_LINE_BEGINS
The constant indicating the position before the first item of the layout. The exact position depends on the writing system: For a left-to-right orientation, it is the same asWEST
, for a right-to-left orientation, it is the same asEAST
.This constant is an older name for
LINE_START
which has exactly the same value.
- Field Value:
- "Before"
- Since:
- 1.2
public static final String CENTER
Constant indicating the center of the container
- Field Value:
- "Center"
public static final String EAST
Constant indicating the right side of the container
- Field Value:
- "East"
public static final String LINE_END
The constant indicating the position after the last item of the layout. The exact position depends on the writing system: For a left-to-right orientation, it is the same asEAST
, for a right-to-left orientation, it is the same asWEST
.
- Field Value:
- "After"
- Since:
- 1.4
public static final String LINE_START
The constant indicating the position before the first item of the layout. The exact position depends on the writing system: For a left-to-right orientation, it is the same asWEST
, for a right-to-left orientation, it is the same asEAST
.
- Field Value:
- "Before"
- Since:
- 1.4
public static final String NORTH
Constant indicating the top of the container
- Field Value:
- "North"
public static final String PAGE_END
The constant indicating the position after the last line of the layout. The exact position depends on the writing system: For a top-to-bottom orientation, it is the same asSOUTH
, for a bottom-to-top orientation, it is the same asNORTH
.
- Field Value:
- "Last"
- Since:
- 1.4
public static final String PAGE_START
The constant indicating the position before the first line of the layout. The exact position depends on the writing system: For a top-to-bottom orientation, it is the same asNORTH
, for a bottom-to-top orientation, it is the same asSOUTH
.
- Field Value:
- "First"
- Since:
- 1.4
public static final String SOUTH
Constant indicating the bottom of the container
- Field Value:
- "South"
public static final String WEST
Constant indicating the left side of the container
- Field Value:
- "West"
public BorderLayout()
Initializes a new instance ofBorderLayout
with no horiztonal or vertical gaps between components.
public BorderLayout(int hgap, int vgap)
Initializes a new instance ofBorderLayout
with the specified horiztonal and vertical gaps between components.
- Parameters:
hgap
- The horizontal gap between components.vgap
- The vertical gap between components.
public void addLayoutComponent(Component component, Object constraints)
Adds a component to the layout in the specified constraint position, which must be one of the string constants defined in this class.
- Specified by:
- addLayoutComponent in interface LayoutManager2
- Parameters:
component
- The component to add.constraints
- The constraint string.
- Throws:
IllegalArgumentException
- If the constraint object is not a string, or is not one of the specified constants in this class.
public void addLayoutComponent(String constraints, Component component)
Deprecated. This method is deprecated in favor of
addLayoutComponent(Component, Object)
.Adds a component to the layout in the specified constraint position, which must be one of the string constants defined in this class.
- Specified by:
- addLayoutComponent in interface LayoutManager
- Parameters:
constraints
- The constraint string.component
- The component to add.
- Throws:
IllegalArgumentException
- If the constraint object is not one of the specified constants in this class.
public Object getConstraints(Component c)
Return the constraint corresponding to a component in this layout. If the component is null, or is not in this layout, returns null. Otherwise, this will return one of the constraint constants defined in this class.
- Parameters:
c
- the component
- Returns:
- the constraint, or null
- Since:
- 1.5
public float getLayoutAlignmentX(Container parent)
Returns the X axis alignment, which is afloat
indicating where along the X axis this container wishs to position its layout. 0 indicates align to the left, 1 indicates align to the right, and 0.5 indicates align to the center.
- Specified by:
- getLayoutAlignmentX in interface LayoutManager2
- Parameters:
parent
- The parent container.
- Returns:
- The X alignment value.
public float getLayoutAlignmentY(Container parent)
Returns the Y axis alignment, which is afloat
indicating where along the Y axis this container wishs to position its layout. 0 indicates align to the top, 1 indicates align to the bottom, and 0.5 indicates align to the center.
- Specified by:
- getLayoutAlignmentY in interface LayoutManager2
- Parameters:
parent
- The parent container.
- Returns:
- The Y alignment value.
public Component getLayoutComponent(Container container, Object constraints)
Return the component at the specified location, which must be one of the absolute constants such as CENTER or SOUTH. The container's orientation is used to map this location to the correct corresponding component, so for instance in a right-to-left container, a request for the EAST component could return the LINE_END component. This will return null if no component is available at the given location.
- Parameters:
container
- the container whose orientation is usedconstraints
- the absolute location of the component
- Returns:
- the component at the location, or null
- Throws:
IllegalArgumentException
- if the constraint is not recognized
public Component getLayoutComponent(Object constraints)
Return the component at the indicated location, or null if no component is at that location. The constraints argument must be one of the location constants specified by this class.
- Parameters:
constraints
- the location
- Returns:
- the component at that location, or null
- Throws:
IllegalArgumentException
- if the constraints argument is not recognized
- Since:
- 1.5
public void invalidateLayout(Container parent)
Instructs this object to discard any layout information it might have cached.
- Specified by:
- invalidateLayout in interface LayoutManager2
- Parameters:
parent
- The parent container.
public void layoutContainer(Container target)
Lays out the specified container according to the constraints in this object.
- Specified by:
- layoutContainer in interface LayoutManager
- Parameters:
target
- The container to lay out.
public Dimension maximumLayoutSize(Container target)
Returns the maximum size of the specified container using this layout.
- Specified by:
- maximumLayoutSize in interface LayoutManager2
- Parameters:
target
- The container to calculate the maximum size for.
- Returns:
- The maximum size of the container
public Dimension minimumLayoutSize(Container target)
Returns the minimum size of the specified container using this layout.
- Specified by:
- minimumLayoutSize in interface LayoutManager
- Parameters:
target
- The container to calculate the minimum size for.
- Returns:
- The minimum size of the container
public Dimension preferredLayoutSize(Container target)
Returns the preferred size of the specified container using this layout.
- Specified by:
- preferredLayoutSize in interface LayoutManager
- Parameters:
target
- The container to calculate the preferred size for.
- Returns:
- The preferred size of the container
public void removeLayoutComponent(Component component)
Removes the specified component from the layout.
- Specified by:
- removeLayoutComponent in interface LayoutManager
- Parameters:
component
- The component to remove from the layout.
public void setHgap(int hgap)
Sets the horizontal gap to the specified value.
- Parameters:
hgap
- The new horizontal gap.
public void setVgap(int vgap)
Sets the vertical gap to the specified value.
- Parameters:
vgap
- The new vertical gap value.