|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjcontrol.ui.vole.Component
jcontrol.ui.vole.menu.Menu
public abstract class Menu
The abstract class Menu is the superclass for
graphical menus.
(c) Copyright 2003-2005 DOMOLOGIC GmbH
| Field Summary | |
|---|---|
protected Vector |
m_inactive
|
protected Vector |
m_items
|
protected int |
m_lastSelectedIndex
|
protected ActionListener |
m_listener
|
protected boolean |
m_repaint
|
protected int |
m_selectedIndex
|
| Fields inherited from class jcontrol.ui.vole.Component |
|---|
eventQueue, focusOwner, font, g, height, listener, parent, visible, width, x, y |
| Constructor Summary | |
|---|---|
Menu(int x,
int y,
int width,
int height)
|
|
| 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. |
protected boolean |
hasNextOrPrev(boolean updown,
int index)
Checks if the specified menu item has an active predecessor or successor. |
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. |
abstract void |
paint()
Paint has to be implemented by the deviating class. |
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. |
protected int |
selectNextOrPrev(boolean updown)
Selects the next or previous menu item in this menu. |
void |
setActionListener(ActionListener listener)
Set the ActionListener for this menu. |
void |
setFont(Resource font)
Set the font for this component. |
void |
setParent(Container parent)
Sets the parent Container. |
| Methods inherited from class jcontrol.ui.vole.Component |
|---|
getBounds, getParent, isVisible, onActionEvent, removeFocus, requestFocus, setBounds, setGraphics, setVisible, transferFocus, validate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, notifyAll, wait |
| Methods inherited from interface jcontrol.ui.vole.menu.MenuInterface |
|---|
setGraphics |
| Field Detail |
|---|
protected Vector m_inactive
protected Vector m_items
protected int m_lastSelectedIndex
protected ActionListener m_listener
protected boolean m_repaint
protected int m_selectedIndex
| Constructor Detail |
|---|
public Menu(int x,
int y,
int width,
int height)
| Method Detail |
|---|
public int addMenuItem(String item)
addMenuItem in interface MenuInterfaceitem - the name of the menu item, can even specify an image name
public int addMenuItem(String item,
int pos)
addMenuItem in interface MenuInterfaceitem - the name of the menu item, can even specify an image namepos - the position
public void enableMenuItem(String item,
boolean onoff)
enableMenuItem in interface MenuInterfaceitem - the name to the menu itemonoff - enable or disablepublic int getActiveItemCount()
getActiveItemCount in interface MenuInterfacepublic int getSelectedIndex()
getSelectedIndex in interface MenuInterface
protected boolean hasNextOrPrev(boolean updown,
int index)
updown - if true, check for a successor, for a predecessor otherwiseindex - the index of the menu item
public boolean isMenuItemEnabled(String item)
isMenuItemEnabled in interface MenuInterfaceitem - the menu item
public boolean onKeyEvent(KeyEvent e)
onKeyEvent in interface MenuInterfaceonKeyEvent in class Componente - The KeyEvent.
public abstract void paint()
paint in interface MenuInterfacepaint in class Componentpaint()public void remove()
remove in interface MenuInterfaceremove in class Componentpublic void removeMenuItem(String item)
removeMenuItem in interface MenuInterfaceitem - the item to removepublic boolean select(int index)
select in interface MenuInterfaceindex - the index of the item to select
public boolean select(String item)
select in interface MenuInterfaceitem - the item to select
protected int selectNextOrPrev(boolean updown)
updown - if true, select the next item, the previous otherwise
public void setActionListener(ActionListener listener)
ActionListener for this menu. It will
receive action events when a menu item is selected.
listener - The action listener to associate with this menu.public void setFont(Resource font)
setFont in class Componentfont - The new font.public void setParent(Container parent)
setParent in interface MenuInterfacesetParent in class Componentparent - the Container to be the parent Object
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||