buoy.widget
Class WidgetContainer

java.lang.Object
  extended by buoy.event.EventSource
      extended by buoy.widget.Widget
          extended by buoy.widget.WidgetContainer
Direct Known 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  java.util.Collection<Widget> 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, removeEventLink
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WidgetContainer

public WidgetContainer()
Create a WidgetContainer.

Method Detail

getChildCount

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


getChildren

public abstract java.util.Collection<Widget> getChildren()
Get a Collection containing all child Widgets of this container.


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.


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.


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.


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.