moka.x
Class Menu

java.lang.Object
  extended bymoka.lang.Object
      extended bymoka.event.EventListener
          extended bymoka.x.Component
              extended bymoka.x.CaptionedComponent
                  extended bymoka.x.Label
                      extended bymoka.x.Menu
All Implemented Interfaces:
Captioned, Colored

public class Menu
extends Label

Menu class represents a pull-down menu component that is deployed from a menu bar. Each item in a menu must belong to the MenuItem class.

Since:
MDK2.1

Field Summary
 Vector items
          A vector containing the items of this Menu.
 
Fields inherited from class moka.x.Component
enabled, height, listen, mnemonic, next, parent, prev, visible, width, x, y
 
Fields inherited from interface moka.x.Colored
bgColor, fgColor
 
Fields inherited from interface moka.x.Captioned
caption, font
 
Constructor Summary
Menu()
           
Menu(java.lang.String caption)
           
 
Method Summary
 void add(MenuItem i)
          Adds the specified MenuItem to this Menu.
 void finalize()
          Frees the memory of system ressources used by this Menu object.
 void onPaint()
          Called when a PaintEvent occurs to paint the image of the container and stores it in its virtual memory.
 void paint()
          Paints the Menu.
 void remove(MenuItem i)
          Removes the specified Menu from this MenuBar.
 void setVisible(boolean b)
          Sets the visibility of the component.
 void use()
          This method is invoked by the GEM when the user interacts with the ComboBox.
 
Methods inherited from class moka.x.Component
bottom, center, checkMnemonic, clean, eventTriggered, isCursorOver, left, move, right, setBounds, setEnabled, setHeight, setMnemonic, setWidth, setX, setY, toFront, top
 
Methods inherited from class moka.event.EventListener
eventTriggered
 
Methods inherited from class moka.lang.Object
equals, getClassName, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface moka.x.Colored
setBgColor, setFgColor
 
Methods inherited from interface moka.x.Captioned
setCaption, setFont
 

Field Detail

items

public Vector items
A vector containing the items of this Menu.

Constructor Detail

Menu

public Menu()

Menu

public Menu(java.lang.String caption)
Method Detail

finalize

public void finalize()
Frees the memory of system ressources used by this Menu object.

Overrides:
finalize in class CaptionedComponent

paint

public void paint()
Paints the Menu.

Overrides:
paint in class Label

add

public void add(MenuItem i)
Adds the specified MenuItem to this Menu. Same as this Menu items.add(i);

Parameters:
i - the MenuItem to add to this Menu.

remove

public void remove(MenuItem i)
Removes the specified Menu from this MenuBar. Same as this Menu items.remove(i);


onPaint

public void onPaint()
Called when a PaintEvent occurs to paint the image of the container and stores it in its virtual memory. The container is painted, then all its children are and finally its foreground is. A PaintEvent occurs when the aspect of the container is altered or any of its children is.

Overrides:
onPaint in class Component

setVisible

public void setVisible(boolean b)
Sets the visibility of the component.

Overrides:
setVisible in class Component
Parameters:
b - true if the component should be visible, false otherwize.

use

public void use()
This method is invoked by the GEM when the user interacts with the ComboBox.

Overrides:
use in class Component