buoy.widget

Class WidgetContainer

Known Direct Subclasses:
BMenu, BMenuBar, BorderContainer, BOutline, BPopupMenu, BScrollPane, BSplitPane, BTabbedPane, BToolBar, ColumnContainer, ExplicitContainer, FormContainer, GridContainer, OverlayContainer, RowContainer, WindowWidget

public abstract class WidgetContainer
extends Widget

A WidgetContainer is a Widget which contains other Widgets. It is responsible for arranging them on the screen. This is an abstract class. There are subclasses which provide different methods of laying out Widgets.
Author:
Peter Eastman

Constructor Summary

WidgetContainer()
Create a WidgetContainer.

Method Summary

abstract int
getChildCount()
Get the number of children in this container.
abstract Collection
getChildren()
Get a Collection containing all child Widgets of this container.
boolean
isOpaque()
Determine whether this WidgetContainer is set to be opaque.
abstract void
layoutChildren()
Layout the child Widgets.
abstract void
remove(Widget widget)
Remove a child Widget from this container.
abstract void
removeAll()
Remove all child Widgets from this container.
void
setOpaque(boolean opaque)
Set whether this WidgetContainer should be opaque.

Methods inherited from class buoy.widget.Widget

addEventLink, dispatchEvent, getBackground, getBounds, getComponent, getCursor, getFont, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, hasFocus, isEnabled, isFocusable, isVisible, repaint, requestFocus, setBackground, setCursor, setEnabled, setFocusable, setFont, setName, setVisible

Methods inherited from class buoy.event.EventSource

addEventLink, addEventLink, addEventLink, dispatchEvent, removeEventLink

Constructor Details

WidgetContainer

public WidgetContainer()
Create a WidgetContainer.

Method Details

getChildCount

public abstract int getChildCount()
Get the number of children in this container.

getChildren

public abstract Collection getChildren()
Get a Collection containing all child Widgets of this container.

isOpaque

public boolean isOpaque()
Determine whether this WidgetContainer is set to be opaque. If true, then it will be filled with its background color before RepaintEvents are sent out for it or any of its children. If false, this Widget's parent container will show through.

layoutChildren

public abstract 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.

remove

public abstract void remove(Widget widget)
Remove a child Widget from this container.

removeAll

public abstract void removeAll()
Remove all child Widgets from this container.

setOpaque

public void setOpaque(boolean opaque)
Set whether this WidgetContainer should be opaque. If true, then it will be filled with its background color before RepaintEvents are sent out for it or any of its children. If false, this Widget's parent container will show through.

Written by Peter Eastman.