buoy.widget

Class BMenuBar


public class BMenuBar
extends WidgetContainer

A BMenuBar is a WidgetContainer corresponding to the menu bar of a window.
Author:
Peter Eastman

Constructor Summary

BMenuBar()
Create a new BMenuBar.

Method Summary

void
add(BMenu menu)
Add a BMenu to the end of the menu bar.
void
add(BMenu menu, int index)
Add a BMenu to the menu bar.
BMenu
getChild(int i)
Get the i'th child of this container.
int
getChildCount()
Get the number of children in this container.
Collection
getChildren()
Get a Collection containing all child Widgets of this container.
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.

Methods inherited from class buoy.widget.WidgetContainer

getChildCount, getChildren, isOpaque, layoutChildren, remove, removeAll, setOpaque

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

BMenuBar

public BMenuBar()
Create a new BMenuBar.

Method Details

add

public void add(BMenu menu)
Add a BMenu to the end of the menu bar.
Parameters:
menu - the BMenu to add

add

public void add(BMenu menu,
                int index)
Add a BMenu to the menu bar.
Parameters:
menu - the BMenu to add
index - the position at which to add it

getChild

public BMenu getChild(int i)
Get the i'th child of this container.

getChildCount

public int getChildCount()
Get the number of children in this container.
Overrides:
getChildCount in interface WidgetContainer

getChildren

public Collection getChildren()
Get a Collection containing all child Widgets of this container.
Overrides:
getChildren in interface WidgetContainer

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.
Overrides:
layoutChildren in interface WidgetContainer

remove

public void remove(Widget widget)
Remove a child Widget from this container.
Overrides:
remove in interface WidgetContainer

removeAll

public void removeAll()
Remove all child Widgets from this container.
Overrides:
removeAll in interface WidgetContainer

Written by Peter Eastman.