| java.lang.Object java.awt.MenuComponent
All known Subclasses: java.awt.MenuItem, java.awt.MenuBar,
Inner Class :class State implements MenuState | |
Inner Class :class MenuPopupBox extends PopupBox | |
Method Summary | |
String | autoName() | AccessibleContext | createAccessibleContext() | final public void | dispatchEvent(AWTEvent event) | void | endMenu() | void | fireItemAction(int item, long when, int modifiers) Post the ActionEvent or ItemEvent,
depending on type of the menu item. | public AccessibleContext | getAccessibleContext() | public Font | getFont() | Graphics | getGraphics(MultiRectArea clip) | int | getHeight() | MenuItem | getItem(int index) | int | getItemCount() | Rectangle | getItemRect(int index) | Point | getLocation() | MenuBar | getMenuBar() | public String | getName() | public MenuContainer | getParent() | public MenuComponentPeer | getPeer() | PopupBox | getPopupBox() | int | getSelectedItemIndex() | Menu | getSelectedSubmenu() | MenuItem | getShortcutMenuItemImpl(MenuShortcut ms) | Point | getSubmenuLocation(int index) | final protected Object | getTreeLock() | final MultiRectArea | getUpdateClip(int index1, int index2) | int | getWidth() | boolean | hasDefaultFont() | void | hide() | boolean | isActive() | boolean | isFontSet() | boolean | isVisible() | void | itemHidden(MenuComponent mc) | void | itemSelected(long when, int modifiers) | void | onKeyEvent(int eventId, int vKey, long when, int modifiers) | void | onMouseEvent(int eventId, Point where, int mouseButton, long when, int modifiers) | void | paint(Graphics gr) | protected String | paramString() | void | postDeprecatedEvent(AWTEvent event) | public boolean | postEvent(Event e) | protected void | processEvent(AWTEvent event) | public void | removeNotify() | void | selectItem(int index) | void | selectItem(int index, boolean showSubMenu) | void | selectNextItem(boolean forward, boolean showSubMenu) | public void | setFont(Font font) | public void | setName(String name) | void | setParent(MenuContainer parent) | void | showSubMenu(int index) | public String | toString() |
deprecatedEventHandler | boolean deprecatedEventHandler(Code) | | |
createAccessibleContext | AccessibleContext createAccessibleContext()(Code) | | accessible context specific for particular menu component |
endMenu | void endMenu()(Code) | | Hide all menu hierarchy
|
fireItemAction | void fireItemAction(int item, long when, int modifiers)(Code) | | Post the ActionEvent or ItemEvent,
depending on type of the menu item.
Parameters: item - - the index of menu item Parameters: when - - event time Parameters: modifiers - - input event modifiers |
getGraphics | Graphics getGraphics(MultiRectArea clip)(Code) | | Creates the Graphics object for the pop-up box of this menu component
Parameters: clip - - the clip to set on this Graphics - the created Graphics object, or null if such object is not available. |
getHeight | int getHeight()(Code) | | |
getItemCount | int getItemCount()(Code) | | |
getMenuBar | MenuBar getMenuBar()(Code) | | - the menu bar which is the root of crrent menu's hierarchy;or null if the hierarchy root is not a menu bar |
getSelectedItemIndex | int getSelectedItemIndex()(Code) | | |
getSelectedSubmenu | Menu getSelectedSubmenu()(Code) | | The sub-menu of currently selecetd item, or null if such a sub-menu is not available |
getShortcutMenuItemImpl | MenuItem getShortcutMenuItemImpl(MenuShortcut ms)(Code) | | Recursively find the menu item for a menu shortcut
Parameters: ms - - the shortcut the menu item; or null if the item is not available for this shortcut |
getSubmenuLocation | Point getSubmenuLocation(int index)(Code) | | |
getUpdateClip | final MultiRectArea getUpdateClip(int index1, int index2)(Code) | | Determine the clip region when menu selection is changed
from index1 to index2
Parameters: index1 - - old selected intem Parameters: index2 - - new selected item - the region to repaint |
hasDefaultFont | boolean hasDefaultFont()(Code) | | |
isActive | boolean isActive()(Code) | | |
isFontSet | boolean isFontSet()(Code) | | |
isVisible | boolean isVisible()(Code) | | |
itemSelected | void itemSelected(long when, int modifiers)(Code) | | Handle the mouse click or Enter key event on a menu's item
Parameters: when - - the event time Parameters: modifiers - - input event modifiers |
onKeyEvent | void onKeyEvent(int eventId, int vKey, long when, int modifiers)(Code) | | Keyboard event handler
Parameters: eventId - - one of the KeyEvent.KEY_* constants Parameters: vKey - - the key code Parameters: when - - event time Parameters: modifiers - - input event modifiers |
onMouseEvent | void onMouseEvent(int eventId, Point where, int mouseButton, long when, int modifiers)(Code) | | Mouse events handler
Parameters: eventId - - one of the MouseEvent.MOUSE_* constants Parameters: where - - mouse location Parameters: mouseButton - - mouse button that was pressed or released Parameters: when - - event time Parameters: modifiers - - input event modifiers |
removeNotify | public void removeNotify()(Code) | | |
selectItem | void selectItem(int index)(Code) | | Convenience method for selectItem(index, true)
|
selectItem | void selectItem(int index, boolean showSubMenu)(Code) | | Change the selection in the menu
Parameters: index - - new selecetd item's index Parameters: showSubMenu - - if new selected item has a sub-menu,should that sub-menu be displayed |
selectNextItem | void selectNextItem(boolean forward, boolean showSubMenu)(Code) | | Change the selected item to the next one in the requested direction
moving cyclically, skipping separators
Parameters: forward - - the direction to move the selection Parameters: showSubMenu - - if new selected item has a sub-menu,should that sub-menu be displayed |
showSubMenu | void showSubMenu(int index)(Code) | | |
|
|