|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--jcontrol.ui.vole.Component
|
+--jcontrol.ui.vole.menu.Menu
The abstract class Menu is the superclass for
graphical menus.
| Field Summary | |
protected int |
activeIndex
|
protected java.util.Vector |
inactives
|
protected java.util.Vector |
items
|
protected ActionListener |
listener
|
protected int |
oldActiveIndex
|
| Fields inherited from class jcontrol.ui.vole.Component |
focusOwner, font, g, height, parent, visible, width, x, y |
| Constructor Summary | |
Menu(int x,
int y,
int width,
int height)
|
|
| 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. |
protected boolean |
hasNextOrPrev(boolean updown,
int index)
Checks if the specified menu item has an active predecessor or successor. |
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()
Paints the whole menu. |
protected abstract void |
paint(boolean all)
|
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. |
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 |
setParent(Container parent)
Sets the parent Container. |
| Methods inherited from class jcontrol.ui.vole.Component |
getBounds, getParent, isVisible, onActionEvent, removeFocus, requestFocus, setBounds, setFont, setGraphics, setLocation, setVisible, transferFocus, validate |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, notifyAll, wait |
| Methods inherited from interface jcontrol.ui.vole.menu.MenuInterface |
setGraphics |
| Field Detail |
protected int activeIndex
protected java.util.Vector inactives
protected java.util.Vector items
protected ActionListener listener
protected int oldActiveIndex
| Constructor Detail |
public Menu(int x,
int y,
int width,
int height)
| Method Detail |
public int addMenuItem(java.lang.String item)
addMenuItem in interface MenuInterfaceitem - the name of the menu item, can even specify an image name
public int addMenuItem(java.lang.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(java.lang.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(java.lang.String item)
isMenuItemEnabled in interface MenuInterfaceitem - the menu item
public boolean onKeyEvent(KeyEvent e)
onKeyEvent in interface MenuInterfaceonKeyEvent in class Componente - The KeyEvent.
public void paint()
paint in interface MenuInterfacepaint in class Componentpaint()protected abstract void paint(boolean all)
public void remove()
remove in interface MenuInterfaceremove in class Componentpublic void removeMenuItem(java.lang.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(java.lang.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 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 | ||||||||