public class ExplicitContainer extends WidgetContainer
In addition to the event types generated by all Widgets, ExplicitContainers generate the following event types:
Constructor and Description |
---|
ExplicitContainer()
Create a new ExplicitContainer.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Widget widget,
java.awt.Rectangle bounds)
Add a Widget to this container.
|
Widget |
getChild(int i)
Get the i'th child of this container.
|
java.awt.Rectangle |
getChildBounds(int index)
Get the position of a child Widget within this container.
|
java.awt.Rectangle |
getChildBounds(Widget widget)
Get the position of a child Widget within this container.
|
int |
getChildCount()
Get the number of children in this container.
|
int |
getChildIndex(Widget widget)
Get the index 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.
|
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(Widget widget)
Remove a child Widget from this container.
|
void |
removeAll()
Remove all child Widgets from this container.
|
void |
setChildBounds(int index,
java.awt.Rectangle bounds)
Set the position of a child Widget within this container.
|
void |
setChildBounds(Widget widget,
java.awt.Rectangle bounds)
Set the position of a child Widget within this container.
|
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 javax.swing.JPanel getComponent()
Widget
getComponent
in class Widget
public int getChildCount()
getChildCount
in class WidgetContainer
public Widget getChild(int i)
public java.util.Collection<Widget> getChildren()
getChildren
in class WidgetContainer
public void layoutChildren()
layoutChildren
in class WidgetContainer
public void add(Widget widget, java.awt.Rectangle bounds)
widget
- the Widget to addbounds
- the location and size at which the Widget should appearpublic int getChildIndex(Widget widget)
widget
- the Widget to locatepublic java.awt.Rectangle getChildBounds(int index)
index
- the index of the Widget for which to get the locationpublic void setChildBounds(int index, java.awt.Rectangle bounds)
index
- the index of the Widget to movebounds
- the location and size at which the Widget should appearpublic java.awt.Rectangle getChildBounds(Widget widget)
widget
- the Widget for which to get the locationpublic void setChildBounds(Widget widget, java.awt.Rectangle bounds)
widget
- the Widget to movebounds
- the location and size at which the Widget should appearpublic void remove(Widget widget)
remove
in class WidgetContainer
widget
- the Widget to removepublic void removeAll()
removeAll
in class WidgetContainer
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class Widget
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class Widget
Written by Peter Eastman.