dog.gui
Class DMenubar

java.lang.Object
  |
  +--java.awt.Component
        |
        +--dog.gui.DComponent
              |
              +--dog.gui.DMenubar
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, Referential, java.io.Serializable

public class DMenubar
extends DComponent

An application menu bar for a frame.

This menubar manages a list of items. It displays the items' icon (if any) and label, and generates action events.

To add a submenu to any menu item, add an item for which the reference is another menu. The handling of that menu will be performed automatically.

See Also:
Serialized Form

Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Fields inherited from class dog.gui.DComponent
CENTER, CENTER_TILE, changes, EAST, INTEGER_TILE, MAXIMIZE, MAXIMIZE_ASPECT, MAXIMIZE_HORIZONTAL, MAXIMIZE_VERTICAL, NORTH, NORTHEAST, NORTHWEST, reference, SOUTH, SOUTHEAST, SOUTHWEST, TILE, tooltip, WEST
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DMenubar()
           
 
Method Summary
 void add(DItem item)
           
 void add(DItem[] items)
           
 void addActionListener(java.awt.event.ActionListener listener)
          Adds the specified action listener to receive action events from this menu.
 void clear()
           
 DItem[] getItems()
          Returns the items in this menu.
 java.awt.Dimension getPreferredSize()
           
 DItem getSelected()
          Returns the selected item in this menu.
 void paint(java.awt.Graphics g)
           
protected  void processActionEvent(java.awt.event.ActionEvent event)
          Processes action events on this menu by dispatching them to any registered ActionListeners.
protected  void processEvent(java.awt.AWTEvent event)
          Processes events on this menu.
protected  void processMouseEvent(java.awt.event.MouseEvent event)
           
protected  void processMouseMotionEvent(java.awt.event.MouseEvent event)
           
 void removeActionListener(java.awt.event.ActionListener listener)
          Removes the specified action listener so it no longer receives action events from this menu.
protected  void select(DItem item, int xoffset)
           
 
Methods inherited from class dog.gui.DComponent
addPropertyChangeListener, alignParamString, drawActiveButtonBorder, drawActiveOptionBorder, drawArrow, drawBackgroundImage, drawBorder, drawButtonBorder, drawCheckbox, drawDarkBorder, drawDefaultButtonBorder, drawDisabledBorder, drawDisabledCheckbox, drawDisabledOption, drawExpander, drawFocusBorder, drawImage, drawLabel, drawOption, drawOptionBorder, drawPressedBorder, drawTick, getDefaultToolkit, getImage, getImage, getImage, getReference, getRootPane, getRows, getTooltip, isPreloadImages, paramString, parseColor, parseFont, processCancelAction, processDefaultAction, removePropertyChangeListener, setEnabled, setPreloadImages, setReference, setTooltip, toString
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DMenubar

public DMenubar()
Method Detail

add

public void add(DItem item)

add

public void add(DItem[] items)

clear

public void clear()

getItems

public DItem[] getItems()
Returns the items in this menu.

getSelected

public DItem getSelected()
Returns the selected item in this menu.

select

protected void select(DItem item,
                      int xoffset)

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class java.awt.Component

paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class java.awt.Component

addActionListener

public void addActionListener(java.awt.event.ActionListener listener)
Adds the specified action listener to receive action events from this menu.
Parameters:
listener - the action listener

removeActionListener

public void removeActionListener(java.awt.event.ActionListener listener)
Removes the specified action listener so it no longer receives action events from this menu.
Parameters:
listener - the action listener

processEvent

protected void processEvent(java.awt.AWTEvent event)
Processes events on this menu. If the event is an ActionEvent, it invokes the processActionEvent method. Otherwise it invokes the superclass processEvent.
Overrides:
processEvent in class DComponent
Parameters:
event - the event

processActionEvent

protected void processActionEvent(java.awt.event.ActionEvent event)
Processes action events on this menu by dispatching them to any registered ActionListeners.
Parameters:
event - the action event

processMouseEvent

protected void processMouseEvent(java.awt.event.MouseEvent event)
Overrides:
processMouseEvent in class DComponent

processMouseMotionEvent

protected void processMouseMotionEvent(java.awt.event.MouseEvent event)
Overrides:
processMouseMotionEvent in class DComponent