public class DockableWidget extends WidgetContainer
DockingContainer, and rearranged by the user. It is a
container which holds a single content Widget and draws a border around it. By clicking on the
border, the user can drag the DockableWidget to any other DockingContainer in the same window,
group the Widgets in a DockingContainer into tabs, and reorder the Widgets within a tab.
The border drawn by this class consists of a fairly simple title bar. You can change the appearance
of the border by creating a subclass and overriding getBorderInsets(),
paintBorder(java.awt.Graphics2D), and isInDragRegion(java.awt.Point).
| Constructor and Description |
|---|
DockableWidget()
Create a DockableWidget with no content Widget or label.
|
DockableWidget(Widget content,
java.lang.String label)
Create a DockableWidget.
|
| Modifier and Type | Method and Description |
|---|---|
java.awt.Rectangle |
getBounds()
Get the current location and size of this Widget.
|
int |
getChildCount()
Get the number of children in this container.
|
java.util.Collection<Widget> |
getChildren()
Get a Collection containing all child Widgets of this container.
|
Widget |
getContent()
Get the content Widget.
|
java.lang.String |
getLabel()
Get the label which appears in the title bar.
|
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 |
setContent(Widget widget)
Set the content Widget.
|
void |
setLabel(java.lang.String label)
Set the label which appears in the title bar.
|
isOpaque, setOpaqueaddEventLink, dispatchEvent, getBackground, getComponent, getCursor, getFont, getMaximumSize, getName, getParent, hasFocus, isEnabled, isFocusable, isVisible, repaint, requestFocus, setBackground, setCursor, setEnabled, setFocusable, setFont, setName, setVisibleaddEventLink, addEventLink, removeEventLinkpublic DockableWidget()
public DockableWidget(Widget content, java.lang.String label)
content - the content Widgetlabel - the label to appear in the title barpublic Widget getContent()
public void setContent(Widget widget)
public java.lang.String getLabel()
public void setLabel(java.lang.String label)
public java.awt.Dimension getPreferredSize()
WidgetgetPreferredSize in class Widgetpublic java.awt.Dimension getMinimumSize()
WidgetgetMinimumSize in class Widgetpublic int getChildCount()
WidgetContainergetChildCount in class WidgetContainerpublic java.util.Collection<Widget> getChildren()
WidgetContainergetChildren in class WidgetContainerpublic void remove(Widget widget)
WidgetContainerremove in class WidgetContainerpublic void removeAll()
WidgetContainerremoveAll in class WidgetContainerpublic void layoutChildren()
WidgetContainerlayoutChildren in class WidgetContainerWritten by Peter Eastman.