Overview | Package | Class | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## jcontrol.ui.vole.menu
Interface MenuInterface

All Known Implementing Classes:
  BigImageMenu, Menu, MenuBar, MultiImageMenu, TextMenu

    public interface MenuInterface

This interface is the main interface used by `jcontrol.ui.vole.Menu`
. The meaning of this interface is to avoid loading the Menu class into a JControl device even if no menu is used only because the menu is referenced by `jcontrol.ui.vole.Frame` by default.
By referencing this interface instead of the (abstract) menu class, no unnecessary class will be uploaded.
NOTE: Normally, there is no need to implement this interface in any other class but `jcontrol.ui.vole.Menu`.

(c) Copyright 2003-2007 DOMOLOGIC GmbH

Version:
  1.0
Author:
  Marcus Timmermann

Method Summary
`int` | `addMenuItem(String item)` Adds a menu item to this menu.
`int` | `addMenuItem(String item, int pos)` Adds a menu item to this menu at the specified position.
`void` | `enableMenuItem(String item, boolean onoff)` Changes the active state of a menu item in this menu.
`int` | `getActiveItemCount()` Returns the number of active menu items.
`int` | `getSelectedIndex()` Returns the index of the selected menu item
`boolean` | `isMenuItemEnabled(String item)` Returns the active state of the specified menu item.
`boolean` | `onKeyEvent(KeyEvent e)` If a KeyEvent accurs, this method is called.
`void` | `paint()`
`void` | `remove()` Removes this menu from the screen.
`void` | `removeMenuItem(String item)` Removes a menu item from this menu.
`boolean` | `select(int index)` Selects the specified menu item.
`boolean` | `select(String item)` Selects the specified menu item
`void` | `setGraphics(Graphics g)` This method is called to set the main Display context for this component.
`void` | `setParent(Container parent)` Sets the parent Frame.

Method Detail

### addMenuItem

    int addMenuItem(String item)

  Adds a menu item to this menu.

  Parameters:
    `item` - the name of the menu item, can even specify an image name
  Returns:
    the index of the new menu item

### addMenuItem

    int addMenuItem(String item,
                    int pos)

  Adds a menu item to this menu at the specified position.

  Parameters:
    `item` - the name of the menu item, can even specify an image name
    `pos` - the position
  Returns:
    the index of the new menu item

### enableMenuItem

    void enableMenuItem(String item,
                        boolean onoff)

  Changes the active state of a menu item in this menu.

  Parameters:
    `item` - the name to the menu item
    `onoff` - enable or disable

### getActiveItemCount

    int getActiveItemCount()

  Returns the number of active menu items.

### getSelectedIndex

    int getSelectedIndex()

  Returns the index of the selected menu item

### isMenuItemEnabled

    boolean isMenuItemEnabled(String item)

  Returns the active state of the specified menu item.

  Parameters:
    `item` - the menu item
  Returns:
    boolean the active state of the menu item

### onKeyEvent

    boolean onKeyEvent(KeyEvent e)

  If a KeyEvent accurs, this method is called.

  Parameters:
    `e` - the KeyEvent.
  Returns:
    false if the KeyEvent was consumed, true otherwise.

### paint

    void paint()

  See Also:
    `Menu.paint()`

### remove

    void remove()

  Removes this menu from the screen.

### removeMenuItem

    void removeMenuItem(String item)

  Removes a menu item from this menu.

  Parameters:
    `item` - the item to remove

### select

    boolean select(int index)

  Selects the specified menu item.

  Parameters:
    `index` - the index of the item to select
  Returns:
    boolean true if the item has been selected successfully, false otherwise

### select

    boolean select(String item)

  Selects the specified menu item

  Parameters:
    `item` - the item to select
  Returns:
    boolean true if the item has been selected successfully, false otherwise

### setGraphics

    void setGraphics(Graphics g)

  This method is called to set the main Display context for this component.
  Normally, this is done only for the top-level container, then, all child components are set automatically.

  Parameters:
    `g` - the grahics context

### setParent

    void setParent(Container parent)

  Sets the parent Frame.

  Parameters:
    `parent` - the Frame handle this menu.

Overview | Package | Class | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD