jcontrol.ui.vole.menu
Interface MenuInterface

All Known Implementing Classes:
Menu

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) DOMOLOGIC Home Automation GmbH 2003

Version:
1.0
Author:
Marcus Timmermann

Method Summary
 int addMenuItem(java.lang.String item)
          Adds a menu item to this menu.
 int addMenuItem(java.lang.String item, int pos)
          Adds a menu item to this menu at the specified position.
 void enableMenuItem(java.lang.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(java.lang.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(java.lang.String item)
          Removes a menu item from this menu.
 boolean select(int index)
          Selects the specified menu item.
 boolean select(java.lang.String item)
          Selects the specified menu item
 void setGraphics(jcontrol.io.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

public int addMenuItem(java.lang.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

public int addMenuItem(java.lang.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

public void enableMenuItem(java.lang.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

public int getActiveItemCount()
Returns the number of active menu items.


getSelectedIndex

public int getSelectedIndex()
Returns the index of the selected menu item


isMenuItemEnabled

public boolean isMenuItemEnabled(java.lang.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

public 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

public void paint()
See Also:
Menu.paint()

remove

public void remove()
Removes this menu from the screen.


removeMenuItem

public void removeMenuItem(java.lang.String item)
Removes a menu item from this menu.

Parameters:
item - the item to remove

select

public 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

public boolean select(java.lang.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

public void setGraphics(jcontrol.io.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

public void setParent(Container parent)
Sets the parent Frame.

Parameters:
parent - the Frame handle this menu.