| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| public class | BasicMenuUI.
As of Java 2 platform 1.4, this previously undocumented class is now obsolete. |
| private class | |
| protected class | BasicMenuUI.
Instantiated and used by a menu item to handle the current menu selection from mouse events. |
| Modifier and Type | Field and Description |
|---|---|
| protected ChangeListener | changeListener
The instance of |
| private static boolean | |
| private static final boolean | |
| private int | |
| protected MenuListener | menuListener
The instance of |
| private InputMap | selectedWindowInputMap
Uses as the parent of the windowInputMap when selected. |
| private static final boolean | |
| private static final boolean |
| Access | Constructor and Description |
|---|---|
| public |
| changeListener | back to summary |
|---|---|
| protected ChangeListener changeListener The instance of | |
| crossMenuMnemonic | back to summary |
|---|---|
| private static boolean crossMenuMnemonic | |
| DEBUG | back to summary |
|---|---|
| private static final boolean DEBUG | |
| lastMnemonic | back to summary |
|---|---|
| private int lastMnemonic | |
| menuListener | back to summary |
|---|---|
| protected MenuListener menuListener The instance of | |
| selectedWindowInputMap | back to summary |
|---|---|
| private InputMap selectedWindowInputMap Uses as the parent of the windowInputMap when selected. | |
| TRACE | back to summary |
|---|---|
| private static final boolean TRACE | |
| VERBOSE | back to summary |
|---|---|
| private static final boolean VERBOSE | |
| BasicMenuUI | back to summary |
|---|---|
| public BasicMenuUI() Constructs a | |
| appendPath | back to summary |
|---|---|
| private static void appendPath(MenuElement[] path, MenuElement elem) | |
| createChangeListener | back to summary |
|---|---|
| protected ChangeListener createChangeListener(JComponent c) Returns an instance of
| |
| createMenuDragMouseListener | back to summary |
|---|---|
| protected MenuDragMouseListener createMenuDragMouseListener(JComponent c) Overrides javax. Doc from javax. Returns an instance of | |
| createMenuKeyListener | back to summary |
|---|---|
| protected MenuKeyListener createMenuKeyListener(JComponent c) Overrides javax. Doc from javax. Returns an instance of | |
| createMenuListener | back to summary |
|---|---|
| protected MenuListener createMenuListener(JComponent c) Returns an instance of
| |
| createMouseInputListener | back to summary |
|---|---|
| protected MouseInputListener createMouseInputListener(JComponent c) Overrides javax. Doc from javax. Returns an instance of | |
| createPropertyChangeListener | back to summary |
|---|---|
| protected PropertyChangeListener createPropertyChangeListener(JComponent c) Overrides javax. Doc from javax. Creates a | |
| createUI | back to summary |
|---|---|
| public static ComponentUI createUI(JComponent x) Hides javax. Constructs a new instance of
| |
| getHandler | back to summary |
|---|---|
| pack-priv BasicMenuItemUI. Overrides javax. | |
| getMaximumSize | back to summary |
|---|---|
| public Dimension getMaximumSize(JComponent c) Overrides javax. Doc from javax. Returns the specified component's maximum size appropriate for
the look and feel. If | |
| getMinimumSize | back to summary |
|---|---|
| public Dimension getMinimumSize(JComponent c) Overrides javax. Doc from javax. Returns the specified component's minimum size appropriate for
the look and feel. If | |
| getPropertyPrefix | back to summary |
|---|---|
| protected String getPropertyPrefix() Overrides javax. Doc from javax. Returns a property prefix. | |
| installDefaults | back to summary |
|---|---|
| protected void installDefaults() Overrides javax. Doc from javax. Installs default properties. | |
| installKeyboardActions | back to summary |
|---|---|
| protected void installKeyboardActions() Overrides javax. Doc from javax. Registers keyboard action. | |
| installLazyActionMap | back to summary |
|---|---|
| pack-priv void installLazyActionMap() Overrides javax. | |
| installListeners | back to summary |
|---|---|
| protected void installListeners() Overrides javax. Doc from javax. Registers listeners. | |
| loadActionMap | back to summary |
|---|---|
| pack-priv static void loadActionMap(LazyActionMap map) | |
| setupPostTimer | back to summary |
|---|---|
| protected void setupPostTimer(JMenu menu) Sets timer to the
| |
| uninstallDefaults | back to summary |
|---|---|
| protected void uninstallDefaults() Overrides javax. Doc from javax. Uninstalls default properties. | |
| uninstallKeyboardActions | back to summary |
|---|---|
| protected void uninstallKeyboardActions() Overrides javax. Doc from javax. Unregisters keyboard actions. | |
| uninstallListeners | back to summary |
|---|---|
| protected void uninstallListeners() Overrides javax. Doc from javax. Unregisters listeners. | |
| updateDefaultBackgroundColor | back to summary |
|---|---|
| private void updateDefaultBackgroundColor() | |
| updateMnemonicBinding | back to summary |
|---|---|
pack-priv void updateMnemonicBinding()
| |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private JMenu | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | accept(Object c)
Overrides sun. Overrides default javax. Subclasses that need to conditionalize the enabled state should override this. |
| public void | actionPerformed(ActionEvent e)
Implements java. Invoked when an action occurs. |
| private JMenu |
| force | back to summary |
|---|---|
| private boolean force | |
| menu | back to summary |
|---|---|
| private JMenu menu | |
| SELECT | back to summary |
|---|---|
| private static final String SELECT | |
| Actions | back to summary |
|---|---|
| pack-priv Actions(String key, JMenu menu, boolean shouldForce) | |
| accept | back to summary |
|---|---|
| public boolean accept(Object c) Overrides sun. Overrides default javax. Doc from sun. Subclasses that need to conditionalize the enabled state should
override this. Be aware that
| |
| actionPerformed | back to summary |
|---|---|
| public void actionPerformed(ActionEvent e) Implements java. Doc from java. Invoked when an action occurs. | |
| getMenu | back to summary |
|---|---|
| private JMenu getMenu(ActionEvent e) | |
| Modifier and Type | Field and Description |
|---|---|
| public boolean | isSelected
|
| public JMenu | menu
The instance of |
| public BasicMenuUI | ui
The instance of |
| public Component | wasFocused
The component that was focused. |
| Access | Constructor and Description |
|---|---|
| public | ChangeHandler(JMenu
an instance of m, BasicMenuUI JMenuan instance of ui)BasicMenuUIConstructs a new instance of |
| Modifier and Type | Method and Description |
|---|---|
| public void | stateChanged(ChangeEvent e)
Implements javax. Invoked when the target of the listener has changed its state. |
| isSelected | back to summary |
|---|---|
| public boolean isSelected
| |
| menu | back to summary |
|---|---|
| public JMenu menu The instance of | |
| ui | back to summary |
|---|---|
| public BasicMenuUI ui The instance of | |
| wasFocused | back to summary |
|---|---|
| public Component wasFocused The component that was focused. | |
| ChangeHandler | back to summary |
|---|---|
| public ChangeHandler(JMenu m, BasicMenuUI ui) Constructs a new instance of
| |
| stateChanged | back to summary |
|---|---|
| public void stateChanged(ChangeEvent e) Implements javax. Doc from javax. Invoked when the target of the listener has changed its state. | |
| Access | Constructor and Description |
|---|---|
| private |
| Handler | back to summary |
|---|---|
| private Handler() | |
| menuDragMouseDragged | back to summary |
|---|---|
| public void menuDragMouseDragged(MenuDragMouseEvent e) Overrides javax. Implements javax. Doc from javax. Invoked when the mouse is being dragged in a menu component's display area. | |
| menuDragMouseEntered | back to summary |
|---|---|
| public void menuDragMouseEntered(MenuDragMouseEvent e) Overrides javax. Implements javax. Doc from javax. Invoked when the dragged mouse has entered a menu component's display area. | |
| menuDragMouseExited | back to summary |
|---|---|
| public void menuDragMouseExited(MenuDragMouseEvent e) Overrides javax. Implements javax. Doc from javax. Invoked when the dragged mouse has left a menu component's display area. | |
| menuDragMouseReleased | back to summary |
|---|---|
| public void menuDragMouseReleased(MenuDragMouseEvent e) Overrides javax. Implements javax. Doc from javax. Invoked when a dragged mouse is release in a menu component's display area. | |
| menuKeyPressed | back to summary |
|---|---|
| public void menuKeyPressed(MenuKeyEvent e) Implements javax. Doc from javax. Invoked when a key has been pressed. | |
| menuKeyReleased | back to summary |
|---|---|
| public void menuKeyReleased(MenuKeyEvent e) Implements javax. Doc from javax. Invoked when a key has been released. | |
| menuKeyTyped | back to summary |
|---|---|
| public void menuKeyTyped(MenuKeyEvent e) Implements javax. Open the Menu | |
| mouseClicked | back to summary |
|---|---|
| public void mouseClicked(MouseEvent e) Overrides javax. Implements java. Doc from java. Invoked when the mouse button has been clicked (pressed and released) on a component. | |
| mouseDragged | back to summary |
|---|---|
| public void mouseDragged(MouseEvent e) Overrides javax. Implements java. Invoked when a mouse button is pressed on the menu and then dragged. Delegates the mouse event to the MenuSelectionManager.
| |
| mouseEntered | back to summary |
|---|---|
| public void mouseEntered(MouseEvent e) Overrides javax. Implements java. Invoked when the cursor enters the menu. This method sets the selected path for the MenuSelectionManager and handles the case in which a menu item is used to pop up an additional menu, as in a hierarchical menu system.
| |
| mouseExited | back to summary |
|---|---|
| public void mouseExited(MouseEvent e) Overrides javax. Implements java. Doc from java. Invoked when the mouse exits a component. | |
| mouseMoved | back to summary |
|---|---|
| public void mouseMoved(MouseEvent e) Overrides javax. Implements java. Doc from java. Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed. | |
| mousePressed | back to summary |
|---|---|
| public void mousePressed(MouseEvent e) Overrides javax. Implements java. Invoked when the mouse has been clicked on the menu. This method clears or sets the selection path of the MenuSelectionManager.
| |
| mouseReleased | back to summary |
|---|---|
| public void mouseReleased(MouseEvent e) Overrides javax. Implements java. Invoked when the mouse has been released on the menu. Delegates the mouse event to the MenuSelectionManager.
| |
| propertyChange | back to summary |
|---|---|
| public void propertyChange(PropertyChangeEvent e) Overrides javax. Implements java. Doc from java. This method gets called when a bound property is changed. | |
This class is protected so that it can be subclassed by other look and feels to implement their own mouse handling behavior. All overridden methods should call the parent methods so that the menu selection is correct.
javax.swing.MenuSelectionManager
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | mouseClicked(MouseEvent e)
Implements java. Invoked when the mouse button has been clicked (pressed and released) on a component. |
| public void | mouseDragged(MouseEvent
the mouse event e)Implements java. Invoked when a mouse button is pressed on the menu and then dragged. |
| public void | mouseEntered(MouseEvent
the mouse event; not used e)Implements java. Invoked when the cursor enters the menu. |
| public void | mouseExited(MouseEvent e)
Implements java. Invoked when the mouse exits a component. |
| public void | mouseMoved(MouseEvent e)
Implements java. Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed. |
| public void | mousePressed(MouseEvent
the mouse event e)Implements java. Invoked when the mouse has been clicked on the menu. |
| public void | mouseReleased(MouseEvent
the mouse event e)Implements java. Invoked when the mouse has been released on the menu. |
| MouseInputHandler | back to summary |
|---|---|
| protected MouseInputHandler() Constructs a | |
| mouseClicked | back to summary |
|---|---|
| public void mouseClicked(MouseEvent e) Implements java. Doc from java. Invoked when the mouse button has been clicked (pressed and released) on a component. | |
| mouseDragged | back to summary |
|---|---|
| public void mouseDragged(MouseEvent e) Implements java. Invoked when a mouse button is pressed on the menu and then dragged. Delegates the mouse event to the MenuSelectionManager.
| |
| mouseEntered | back to summary |
|---|---|
| public void mouseEntered(MouseEvent e) Implements java. Invoked when the cursor enters the menu. This method sets the selected path for the MenuSelectionManager and handles the case in which a menu item is used to pop up an additional menu, as in a hierarchical menu system.
| |
| mouseExited | back to summary |
|---|---|
| public void mouseExited(MouseEvent e) Implements java. Doc from java. Invoked when the mouse exits a component. | |
| mouseMoved | back to summary |
|---|---|
| public void mouseMoved(MouseEvent e) Implements java. Doc from java. Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed. | |
| mousePressed | back to summary |
|---|---|
| public void mousePressed(MouseEvent e) Implements java. Invoked when the mouse has been clicked on the menu. This method clears or sets the selection path of the MenuSelectionManager.
| |
| mouseReleased | back to summary |
|---|---|
| public void mouseReleased(MouseEvent e) Implements java. Invoked when the mouse has been released on the menu. Delegates the mouse event to the MenuSelectionManager.
| |