public class BorderContainer extends WidgetContainer
In addition to the event types generated by all Widgets, BorderContainers generate the following event types:
Modifier and Type | Class and Description |
---|---|
static class |
BorderContainer.Position
This inner class represents a position within the container.
|
Modifier and Type | Field and Description |
---|---|
static BorderContainer.Position |
CENTER |
static BorderContainer.Position |
EAST |
static BorderContainer.Position |
NORTH |
static BorderContainer.Position |
SOUTH |
static BorderContainer.Position |
WEST |
Constructor and Description |
---|
BorderContainer()
Create a new BorderContainer.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Widget widget,
BorderContainer.Position where)
Add a Widget to this container, using the default LayoutInfo to position it.
|
void |
add(Widget widget,
BorderContainer.Position where,
LayoutInfo layout)
Add a Widget to this container.
|
Widget |
getChild(BorderContainer.Position where)
Get the child in a particular location.
|
int |
getChildCount()
Get the number of children in this container.
|
LayoutInfo |
getChildLayout(BorderContainer.Position where)
Get the LayoutInfo for the Widget in a particular location.
|
LayoutInfo |
getChildLayout(Widget widget)
Get the LayoutInfo for a particular Widget.
|
BorderContainer.Position |
getChildPosition(Widget widget)
Get the Position of a particular Widget.
|
java.util.Collection<Widget> |
getChildren()
Get a Collection containing all child Widgets of this container.
|
javax.swing.JPanel |
getComponent()
Get the java.awt.Component corresponding to this Widget.
|
boolean |
getCornersAreVertical()
Get whether the vertical Widgets (EAST and WEST) or the horizontal Widgets (NORTH and SOUTH) extend
all the way to the corners.
|
LayoutInfo |
getDefaultLayout()
Get the default LayoutInfo.
|
java.awt.Dimension |
getMinimumSize()
Get the smallest size at which this Widget can reasonably be drawn.
|
java.awt.Dimension |
getPreferredSize()
Get the preferred size at which this Widget will look best.
|
void |
layoutChildren()
Layout the child Widgets.
|
void |
remove(BorderContainer.Position where)
Remove a child Widget from this container.
|
void |
remove(Widget widget)
Remove a child Widget from this container.
|
void |
removeAll()
Remove all child Widgets from this container.
|
void |
setChildLayout(BorderContainer.Position where,
LayoutInfo layout)
Set the LayoutInfo for the Widget in a particular location.
|
void |
setChildLayout(Widget widget,
LayoutInfo layout)
Set the LayoutInfo for a particular Widget.
|
void |
setCornersAreVertical(boolean vertical)
Set whether the vertical Widgets (EAST and WEST) or the horizontal Widgets (NORTH and SOUTH) extend
all the way to the corners.
|
void |
setDefaultLayout(LayoutInfo layout)
Set the default LayoutInfo.
|
isOpaque, setOpaque
addEventLink, dispatchEvent, getBackground, getBounds, getCursor, getFont, getMaximumSize, getName, getParent, hasFocus, isEnabled, isFocusable, isVisible, repaint, requestFocus, setBackground, setCursor, setEnabled, setFocusable, setFont, setName, setVisible
addEventLink, addEventLink, removeEventLink
public static final BorderContainer.Position CENTER
public static final BorderContainer.Position NORTH
public static final BorderContainer.Position EAST
public static final BorderContainer.Position SOUTH
public static final BorderContainer.Position WEST
public javax.swing.JPanel getComponent()
Widget
getComponent
in class Widget
public int getChildCount()
getChildCount
in class WidgetContainer
public java.util.Collection<Widget> getChildren()
getChildren
in class WidgetContainer
public Widget getChild(BorderContainer.Position where)
where
- the location of the Widget to get (CENTER, NORTH, EAST, SOUTH, or WEST)public BorderContainer.Position getChildPosition(Widget widget)
widget
- the Widget for which to get the Positionpublic void layoutChildren()
layoutChildren
in class WidgetContainer
public void add(Widget widget, BorderContainer.Position where)
widget
- the Widget to addwhere
- the location to add it (CENTER, NORTH, EAST, SOUTH, or WEST)public void add(Widget widget, BorderContainer.Position where, LayoutInfo layout)
widget
- the Widget to addwhere
- the location to add it (CENTER, NORTH, EAST, SOUTH, or WEST)layout
- the LayoutInfo to use for this Widget. If null, the default LayoutInfo will be used.public LayoutInfo getChildLayout(BorderContainer.Position where)
where
- the location of the Widget (CENTER, NORTH, EAST, SOUTH, or WEST)public void setChildLayout(BorderContainer.Position where, LayoutInfo layout)
where
- the location of the Widget (CENTER, NORTH, EAST, SOUTH, or WEST)layout
- the new LayoutInfo. If null, the default LayoutInfo will be used.public LayoutInfo getChildLayout(Widget widget)
widget
- the Widget for which to get the LayoutInfopublic void setChildLayout(Widget widget, LayoutInfo layout)
widget
- the Widget for which to set the LayoutInfolayout
- the new LayoutInfo. If null, the default LayoutInfo will be used.public LayoutInfo getDefaultLayout()
public void setDefaultLayout(LayoutInfo layout)
public void remove(Widget widget)
remove
in class WidgetContainer
widget
- the Widget to removepublic void remove(BorderContainer.Position where)
where
- the location of the Widget to remove (CENTER, NORTH, EAST, SOUTH, or WEST)public void removeAll()
removeAll
in class WidgetContainer
public boolean getCornersAreVertical()
public void setCornersAreVertical(boolean vertical)
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class Widget
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class Widget
Written by Peter Eastman.