|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.hawaii.ics.yucheng.AnchorLayoutManager
class AnchorLayoutManager
A layout manager that supports anchored components. Each component added can be anchored to the left, top, right, bottom, or a combination of these locations. When the container is resized, the components will stretch or move accordingly.
Nested Class Summary | |
---|---|
(package private) class |
AnchorLayoutManager.Anchor
An anchor associated with a component. |
Field Summary | |
---|---|
static java.lang.String |
ANCHOR_BOTTOM
An anchor flag that indicates the component should anchor to the bottom of the container. |
static java.lang.String |
ANCHOR_LEFT
An anchor flag that indicates the component should anchor to the left of the container. |
static java.lang.String |
ANCHOR_RIGHT
An anchor flag that indicates the component should anchor to the right of the container. |
static java.lang.String |
ANCHOR_TOP
An anchor flag that indicates the component should anchor to the top of the container. |
private java.util.Collection<AnchorLayoutManager.Anchor> |
myAnchors
|
(package private) int |
myMinimumCX
The minimum width of the container. |
(package private) int |
myMinimumCY
The minimum height of the container. |
Constructor Summary | |
---|---|
AnchorLayoutManager(int minimumCX,
int minimumCY)
Initializes a new instance of the class. |
Method Summary | |
---|---|
void |
addLayoutComponent(java.lang.String flags,
java.awt.Component component)
Adds a component to the layout manager. |
void |
layoutContainer(java.awt.Container container)
Positions each component added to the layout based on the size of the specified container. |
java.awt.Dimension |
minimumLayoutSize(java.awt.Container container)
Returns the minimum layout size. |
java.awt.Dimension |
preferredLayoutSize(java.awt.Container container)
Returns the preferred layout size. |
void |
removeLayoutComponent(java.awt.Component component)
Removes a component from the layout. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ANCHOR_BOTTOM
public static final java.lang.String ANCHOR_LEFT
public static final java.lang.String ANCHOR_RIGHT
public static final java.lang.String ANCHOR_TOP
private final java.util.Collection<AnchorLayoutManager.Anchor> myAnchors
final int myMinimumCX
final int myMinimumCY
Constructor Detail |
---|
public AnchorLayoutManager(int minimumCX, int minimumCY)
minimumCX
- The minimum and initial width of the container.minimumCY
- The minimum and initial height of the container.
java.lang.IllegalArgumentException
- Thrown if either of the minimum sizes are
less than one.Method Detail |
---|
public void addLayoutComponent(java.lang.String flags, java.awt.Component component)
addLayoutComponent
in interface java.awt.LayoutManager
flags
- The layout flags.component
- The component to add.
java.lang.NullPointerException
- Thrown if either of the arguments are null.public void layoutContainer(java.awt.Container container)
layoutContainer
in interface java.awt.LayoutManager
container
- The container.
java.lang.NullPointerException
- Thrown if the container is null.public java.awt.Dimension minimumLayoutSize(java.awt.Container container)
minimumLayoutSize
in interface java.awt.LayoutManager
container
- The container (not used).
java.lang.NullPointerException
- Thrown if the container is null.public java.awt.Dimension preferredLayoutSize(java.awt.Container container)
preferredLayoutSize
in interface java.awt.LayoutManager
container
- The container.
java.lang.NullPointerException
- Thrown if the container is null.public void removeLayoutComponent(java.awt.Component component)
removeLayoutComponent
in interface java.awt.LayoutManager
component
- The component to remove.
java.lang.NullPointerException
- Thrown if the component is null.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |