| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| pack-priv class | |
| protected class | BasicMenuItemUI.
Deprecated
for removal since 17.
Mouse input handler.
|
| Modifier and Type | Field and Description |
|---|---|
| protected String | acceleratorDelimiter
Accelerator delimiter string, such as |
| protected Font | acceleratorFont
The accelerator font. |
| protected Color | acceleratorForeground
The color of the accelerator foreground. |
| protected Color | acceleratorSelectionForeground
The color of the accelerator selection. |
| protected Icon | arrowIcon
The arrow icon. |
| protected Icon | checkIcon
The check icon. |
| private static final boolean | |
| protected int | defaultTextIconGap
The gap between the text and the icon. |
| protected Color | disabledForeground
The color of the disabled foreground. |
| pack-priv BasicMenuItemUI. | |
| protected MenuDragMouseListener | menuDragMouseListener
The instance of |
| protected JMenuItem | menuItem
The instance of |
| protected MenuKeyListener | menuKeyListener
The instance of |
| protected MouseInputListener | mouseInputListener
The instance of |
| protected boolean | oldBorderPainted
The value represents if the old border is painted. |
| protected PropertyChangeListener | propertyChangeListener
|
| protected Color | selectionBackground
The color of the selection background. |
| protected Color | selectionForeground
The color of the selection foreground. |
| private static final boolean | |
| private static final boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv InputMap | |
| protected MenuDragMouseListener | Returns: an instance ofMenuDragMouseListenera component c)Returns an instance of |
| protected MenuKeyListener | Returns: an instance ofMenuKeyListenera component c)Returns an instance of |
| protected MouseInputListener | Returns: an instance ofMouseInputListenera component c)Returns an instance of |
| protected PropertyChangeListener | Returns: an instance of aPropertyChangeListener or nulla component c)Creates a |
| public static ComponentUI | Returns: a new instance ofBasicMenuItemUIa component c)Hides javax. Returns a new instance of |
| protected void | doClick(MenuSelectionManager
A MenuSelectionManager. The visual feedback and
internal bookkeeping tasks are delegated to
this MenuSelectionManager. If msm)null is
passed as this argument, the
MenuSelectionManager.defaultManager is
used.Call this method when a menu item is to be activated. |
| pack-priv boolean | |
| pack-priv BasicMenuItemUI. | |
| public Dimension | getMaximumSize(JComponent c)
Overrides javax. Returns the specified component's maximum size appropriate for the look and feel. |
| public Dimension | getMinimumSize(JComponent c)
Overrides javax. Returns the specified component's minimum size appropriate for the look and feel. |
| public MenuElement[] | |
| protected Dimension | Returns: the preferred size of a menu itema component c, Icon a check icon checkIcon, Icon an arrow icon arrowIcon, int a gap between a text and an icon defaultTextIconGap)Returns the preferred size of a menu item. |
| public Dimension | getPreferredSize(JComponent c)
Overrides javax. Returns the specified component's preferred size appropriate for the look and feel. |
| protected String | |
| protected void | |
| protected void | |
| protected void | |
| pack-priv void | |
| protected void | |
| public void | installUI(JComponent c)
Overrides javax. Configures the specified component appropriately for the look and feel. |
| private boolean | isInternalFrameSystemMenu()
This is to see if the menu item in question is part of the system menu on an internal frame. |
| pack-priv static void | |
| public void | paint(Graphics g, JComponent c)
Overrides javax. Paints the specified component appropriately for the look and feel. |
| private void | |
| private void | paintArrowIcon(Graphics g, MenuItemLayoutHelper lh, MenuItemLayoutHelper.
|
| protected void | paintBackground(Graphics
the paint graphics g, JMenuItem menu item to be painted menuItem, Color selection background color bgColor)Draws the background of the menu item. |
| private void | paintCheckIcon(Graphics g, MenuItemLayoutHelper lh, MenuItemLayoutHelper.
|
| private void | |
| protected void | paintMenuItem(Graphics
an instance of g, JComponent Graphicsa component c, Icon a check icon checkIcon, Icon an arrow icon arrowIcon, Color a background color background, Color a foreground color foreground, int a gap between a text and an icon defaultTextIconGap)Paints a menu item. |
| private void | |
| protected void | |
| pack-priv void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| public void | uninstallUI(JComponent c)
Overrides javax. Reverses configuration which was done on the specified component during
|
| public void | update(Graphics g, JComponent c)
Overrides javax. We draw the background in paintMenuItem() so override update (which fills the background of opaque components by default) to just call paint(). |
| pack-priv void |
| acceleratorDelimiter | back to summary |
|---|---|
| protected String acceleratorDelimiter Accelerator delimiter string, such as
| |
| acceleratorFont | back to summary |
|---|---|
| protected Font acceleratorFont The accelerator font. | |
| acceleratorForeground | back to summary |
|---|---|
| protected Color acceleratorForeground The color of the accelerator foreground. | |
| acceleratorSelectionForeground | back to summary |
|---|---|
| protected Color acceleratorSelectionForeground The color of the accelerator selection. | |
| arrowIcon | back to summary |
|---|---|
| protected Icon arrowIcon The arrow icon. | |
| checkIcon | back to summary |
|---|---|
| protected Icon checkIcon The check icon. | |
| DEBUG | back to summary |
|---|---|
| private static final boolean DEBUG | |
| defaultTextIconGap | back to summary |
|---|---|
| protected int defaultTextIconGap The gap between the text and the icon. | |
| disabledForeground | back to summary |
|---|---|
| protected Color disabledForeground The color of the disabled foreground. | |
| handler | back to summary |
|---|---|
| pack-priv BasicMenuItemUI. | |
| menuDragMouseListener | back to summary |
|---|---|
| protected MenuDragMouseListener menuDragMouseListener The instance of | |
| menuItem | back to summary |
|---|---|
| protected JMenuItem menuItem The instance of | |
| menuKeyListener | back to summary |
|---|---|
| protected MenuKeyListener menuKeyListener The instance of | |
| mouseInputListener | back to summary |
|---|---|
| protected MouseInputListener mouseInputListener The instance of | |
| oldBorderPainted | back to summary |
|---|---|
| protected boolean oldBorderPainted The value represents if the old border is painted. | |
| propertyChangeListener | back to summary |
|---|---|
| protected PropertyChangeListener propertyChangeListener
| |
| selectionBackground | back to summary |
|---|---|
| protected Color selectionBackground The color of the selection background. | |
| selectionForeground | back to summary |
|---|---|
| protected Color selectionForeground The color of the selection foreground. | |
| TRACE | back to summary |
|---|---|
| private static final boolean TRACE | |
| VERBOSE | back to summary |
|---|---|
| private static final boolean VERBOSE | |
| BasicMenuItemUI | back to summary |
|---|---|
| public BasicMenuItemUI() Constructs a | |
| createInputMap | back to summary |
|---|---|
| pack-priv InputMap createInputMap(int condition) | |
| createMenuDragMouseListener | back to summary |
|---|---|
| protected MenuDragMouseListener createMenuDragMouseListener(JComponent c) Returns an instance of
| |
| createMenuKeyListener | back to summary |
|---|---|
| protected MenuKeyListener createMenuKeyListener(JComponent c) Returns an instance of
| |
| createMouseInputListener | back to summary |
|---|---|
| protected MouseInputListener createMouseInputListener(JComponent c) Returns an instance of
| |
| createPropertyChangeListener | back to summary |
|---|---|
| protected PropertyChangeListener createPropertyChangeListener(JComponent c) Creates a
| |
| createUI | back to summary |
|---|---|
| public static ComponentUI createUI(JComponent c) Hides javax. Returns a new instance of
| |
| doClick | back to summary |
|---|---|
| protected void doClick(MenuSelectionManager msm) Call this method when a menu item is to be activated. This method handles some of the details of menu item activation such as clearing the selected path and messaging the JMenuItem's doClick() method.
| |
| doNotCloseOnMouseClick | back to summary |
|---|---|
| pack-priv boolean doNotCloseOnMouseClick() | |
| getHandler | back to summary |
|---|---|
| pack-priv BasicMenuItemUI. | |
| 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 | |
| getPath | back to summary |
|---|---|
| public MenuElement[] getPath() Returns a menu element path.
| |
| getPreferredMenuItemSize | back to summary |
|---|---|
| protected Dimension getPreferredMenuItemSize(JComponent c, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap) Returns the preferred size of a menu item.
| |
| getPreferredSize | back to summary |
|---|---|
| public Dimension getPreferredSize(JComponent c) Overrides javax. Doc from javax. Returns the specified component's preferred size appropriate for
the look and feel. If | |
| getPropertyPrefix | back to summary |
|---|---|
| protected String getPropertyPrefix() Returns a property prefix.
| |
| installComponents | back to summary |
|---|---|
| protected void installComponents(JMenuItem menuItem) Registers the subcomponents of the menu.
| |
| installDefaults | back to summary |
|---|---|
| protected void installDefaults() Installs default properties. | |
| installKeyboardActions | back to summary |
|---|---|
| protected void installKeyboardActions() Registers keyboard action. | |
| installLazyActionMap | back to summary |
|---|---|
| pack-priv void installLazyActionMap() | |
| installListeners | back to summary |
|---|---|
| protected void installListeners() Registers listeners. | |
| installUI | back to summary |
|---|---|
| public void installUI(JComponent c) Overrides javax. Doc from javax. Configures the specified component appropriately for the look and feel.
This method is invoked when the
| |
| isInternalFrameSystemMenu | back to summary |
|---|---|
| private boolean isInternalFrameSystemMenu() This is to see if the menu item in question is part of the system menu on an internal frame. The Strings that are being checked can be found in MetalInternalFrameTitlePaneUI.java, WindowsInternalFrameTitlePaneUI.java, and MotifInternalFrameTitlePaneUI.java.
| |
| loadActionMap | back to summary |
|---|---|
| pack-priv static void loadActionMap(LazyActionMap map) | |
| paint | back to summary |
|---|---|
| public void paint(Graphics g, JComponent c) Overrides javax. Doc from javax. Paints the specified component appropriately for the look and feel.
This method is invoked from the | |
| paintAccText | back to summary |
|---|---|
| private void paintAccText(Graphics g, MenuItemLayoutHelper lh, MenuItemLayoutHelper. | |
| paintArrowIcon | back to summary |
|---|---|
| private void paintArrowIcon(Graphics g, MenuItemLayoutHelper lh, MenuItemLayoutHelper. | |
| paintBackground | back to summary |
|---|---|
| protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor) Draws the background of the menu item. | |
| paintCheckIcon | back to summary |
|---|---|
| private void paintCheckIcon(Graphics g, MenuItemLayoutHelper lh, MenuItemLayoutHelper. | |
| paintIcon | back to summary |
|---|---|
| private void paintIcon(Graphics g, MenuItemLayoutHelper lh, MenuItemLayoutHelper. | |
| paintMenuItem | back to summary |
|---|---|
| protected void paintMenuItem(Graphics g, JComponent c, Icon checkIcon, Icon arrowIcon, Color background, Color foreground, int defaultTextIconGap) Paints a menu item. | |
| paintText | back to summary |
|---|---|
| private void paintText(Graphics g, MenuItemLayoutHelper lh, MenuItemLayoutHelper. | |
| paintText | back to summary |
|---|---|
| protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text) Renders the text of the current menu item. | |
| printMenuElementArray | back to summary |
|---|---|
| pack-priv void printMenuElementArray(MenuElement[] path, boolean dumpStack) | |
| uninstallComponents | back to summary |
|---|---|
| protected void uninstallComponents(JMenuItem menuItem) Unregisters components.
| |
| uninstallDefaults | back to summary |
|---|---|
| protected void uninstallDefaults() Uninstalls default properties. | |
| uninstallKeyboardActions | back to summary |
|---|---|
| protected void uninstallKeyboardActions() Unregisters keyboard actions. | |
| uninstallListeners | back to summary |
|---|---|
| protected void uninstallListeners() Unregisters listeners. | |
| uninstallUI | back to summary |
|---|---|
| public void uninstallUI(JComponent c) Overrides javax. Doc from javax. Reverses configuration which was done on the specified component during
| |
| update | back to summary |
|---|---|
| public void update(Graphics g, JComponent c) Overrides javax. We draw the background in paintMenuItem() so override update (which fills the background of opaque components by default) to just call paint(). | |
| updateAcceleratorBinding | back to summary |
|---|---|
pack-priv void updateAcceleratorBinding()
| |
| Modifier and Type | Method and Description |
|---|---|
| public void | actionPerformed(ActionEvent e)
Implements java. Invoked when an action occurs. |
| CLICK | back to summary |
|---|---|
| private static final String CLICK | |
| Actions | back to summary |
|---|---|
| pack-priv Actions(String key) | |
| actionPerformed | back to summary |
|---|---|
| public void actionPerformed(ActionEvent e) Implements java. Doc from java. Invoked when an action occurs. | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | menuDragMouseDragged(MenuDragMouseEvent e)
Implements javax. Invoked when the mouse is being dragged in a menu component's display area. |
| public void | menuDragMouseEntered(MenuDragMouseEvent e)
Implements javax. Invoked when the dragged mouse has entered a menu component's display area. |
| public void | menuDragMouseExited(MenuDragMouseEvent e)
Implements javax. Invoked when the dragged mouse has left a menu component's display area. |
| public void | menuDragMouseReleased(MenuDragMouseEvent e)
Implements javax. Invoked when a dragged mouse is release in a menu component's display area. |
| 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 e)
Implements java. Invoked when a mouse button is pressed on a component and then dragged. |
| public void | mouseEntered(MouseEvent e)
Implements java. Invoked when the mouse enters a component. |
| 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 e)
Implements java. Invoked when a mouse button has been pressed on a component. |
| public void | mouseReleased(MouseEvent e)
Implements java. Invoked when a mouse button has been released on a component. |
| public void | propertyChange(PropertyChangeEvent e)
Implements java. This method gets called when a bound property is changed. |
| Handler | back to summary |
|---|---|
| pack-priv Handler() | |
| menuDragMouseDragged | back to summary |
|---|---|
| public void menuDragMouseDragged(MenuDragMouseEvent e) 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) 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) 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) Implements javax. Doc from javax. Invoked when a dragged mouse is release in a menu component's display area. | |
| 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. Doc from java. Invoked when a mouse button is pressed on a component and then
dragged.
Due to platform-dependent Drag&Drop implementations,
| |
| mouseEntered | back to summary |
|---|---|
| public void mouseEntered(MouseEvent e) Implements java. Doc from java. Invoked when the mouse enters a component.
| |
| 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. Doc from java. Invoked when a mouse button has been pressed on a component. | |
| mouseReleased | back to summary |
|---|---|
| public void mouseReleased(MouseEvent e) Implements java. Doc from java. Invoked when a mouse button has been released on a component. | |
| propertyChange | back to summary |
|---|---|
| public void propertyChange(PropertyChangeEvent e) Implements java. Doc from java. This method gets called when a bound property is changed. | |
Deprecated
for removal since 17.
| 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 e)
Implements java. Invoked when a mouse button is pressed on a component and then dragged. |
| public void | mouseEntered(MouseEvent e)
Implements java. Invoked when the mouse enters a component. |
| 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 e)
Implements java. Invoked when a mouse button has been pressed on a component. |
| public void | mouseReleased(MouseEvent e)
Implements java. Invoked when a mouse button has been released on a component. |
| 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. Doc from java. Invoked when a mouse button is pressed on a component and then
dragged.
Due to platform-dependent Drag&Drop implementations,
| |
| mouseEntered | back to summary |
|---|---|
| public void mouseEntered(MouseEvent e) Implements java. Doc from java. Invoked when the mouse enters a component. | |
| 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. Doc from java. Invoked when a mouse button has been pressed on a component. | |
| mouseReleased | back to summary |
|---|---|
| public void mouseReleased(MouseEvent e) Implements java. Doc from java. Invoked when a mouse button has been released on a component. | |