RowContainer is a WidgetContainer which arranges its child Widgets in a row, from left to right.
In addition to the event types generated by all Widgets, RowContainers generate the following event types:
add
public void add(Widget widget)
Add a Widget to this container, using the default LayoutInfo to position it.
widget
- the Widget to add
add
public void add(Widget widget,
LayoutInfo layout)
Add a Widget to this container.
widget
- the Widget to addlayout
- the LayoutInfo to use for this Widget. If null, the default LayoutInfo will be used.
add
public void add(Widget widget,
int index,
LayoutInfo layout)
Add a Widget to this container.
widget
- the Widget to addindex
- the index at which to add the Widgetlayout
- the LayoutInfo to use for this Widget. If null, the default LayoutInfo will be used.
getChild
public Widget getChild(int i)
Get the i'th child of this container.
getChildIndex
public int getChildIndex(Widget widget)
Get the index of a particular Widget.
widget
- the Widget to locate
- the position of the Widget within this container, or -1 if the Widget is not a child
of this container
getChildLayout
public LayoutInfo getChildLayout(Widget widget)
Get the LayoutInfo for a particular Widget.
widget
- the Widget for which to get the LayoutInfo
- the LayoutInfo being used for that Widget. This may return null, which indicates that the
default LayoutInfo is being used. It will also return null if the specified Widget is not
a child of this container.
getChildLayout
public LayoutInfo getChildLayout(int index)
Get the LayoutInfo for a particular Widget.
index
- the index of the Widget for which to get the LayoutInfo
- the LayoutInfo being used for that Widget. This may return null, which indicates that the
default LayoutInfo is being used.
getDefaultLayout
public LayoutInfo getDefaultLayout()
Get the default LayoutInfo.
getMinimumSize
public Dimension getMinimumSize()
Get the smallest size at which this Widget can reasonably be drawn. When a WidgetContainer lays out
its contents, it will attempt never to make this Widget smaller than its minimum size.
- getMinimumSize in interface Widget
getPreferredSize
public Dimension getPreferredSize()
Get the preferred size at which this Widget will look best. When a WidgetContainer lays out
its contents, it will attempt to make this Widget as close as possible to its preferred size.
- getPreferredSize in interface Widget
layoutChildren
public void layoutChildren()
Layout the child Widgets. This may be invoked whenever something has changed (the size of this
WidgetContainer, the preferred size of one of its children, etc.) that causes the layout to no
longer be correct. If a child is itself a WidgetContainer, its layoutChildren() method will be
called in turn.
- layoutChildren in interface WidgetContainer
remove
public void remove(Widget widget)
Remove a child Widget from this container.
- remove in interface WidgetContainer
widget
- the Widget to remove
remove
public void remove(int index)
Remove a child Widget from this container.
index
- the index of the Widget to remove
setChildLayout
public void setChildLayout(Widget widget,
LayoutInfo layout)
Set the LayoutInfo for a particular Widget.
widget
- the Widget for which to set the LayoutInfolayout
- the new LayoutInfo. If null, the default LayoutInfo will be used
setChildLayout
public void setChildLayout(int index,
LayoutInfo layout)
Set the LayoutInfo for a particular Widget.
index
- the index of the Widget for which to set the LayoutInfolayout
- the new LayoutInfo. If null, the default LayoutInfo will be used
setDefaultLayout
public void setDefaultLayout(LayoutInfo layout)
Set the default LayoutInfo.