ch.randelshofer.quaqua
Class QuaquaMenuItemUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ButtonUI
javax.swing.plaf.MenuItemUI
javax.swing.plaf.basic.BasicMenuItemUI
ch.randelshofer.quaqua.QuaquaMenuItemUI
- All Implemented Interfaces:
- QuaquaMenuPainterClient
public class QuaquaMenuItemUI
- extends javax.swing.plaf.basic.BasicMenuItemUI
- implements QuaquaMenuPainterClient
A replacement for the AquaMenuItemUI.
This class provides the following workarounds for issues in Apple's
implementation of the Aqua Look and Feel in Java 1.4.1:
- MenuItems are highlighted with a blue background color and white text and
accelerator instead of higlighting with a striped background, white text and black
accelerator.
- Menu item accelerators use character symbols instead of writing "Meta",
"Delete" or "Backspace".
- Version:
- 1.1 2008-05-04 Added support for background border.
1.0.2 2007-07-25 Don't override installListeners from BasicMenuItemUI.
1.0.1 2003-10-04 A 'break' in getAcceleratorText was missing which
resulted in a bad text for the VK_ENTER key code.
1.0 2003-07-19 Created.
- Author:
- Werner Randelshofer, Staldenmattweg 2, CH-6405 Immensee, Switzerland
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicMenuItemUI |
javax.swing.plaf.basic.BasicMenuItemUI.MouseInputHandler |
Fields inherited from class javax.swing.plaf.basic.BasicMenuItemUI |
acceleratorFont, acceleratorForeground, acceleratorSelectionForeground, arrowIcon, checkIcon, defaultTextIconGap, disabledForeground, menuDragMouseListener, menuItem, menuKeyListener, mouseInputListener, oldBorderPainted, selectionBackground, selectionForeground |
Method Summary |
protected void |
addListeners()
|
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent jcomponent)
|
protected java.awt.Dimension |
getPreferredMenuItemSize(javax.swing.JComponent c,
javax.swing.Icon checkIcon,
javax.swing.Icon arrowIcon,
int defaultTextIconGap)
|
protected java.lang.String |
getPropertyPrefix()
|
void |
paintBackground(java.awt.Graphics g,
javax.swing.JComponent component,
int menuWidth,
int menuHeight)
|
protected void |
paintMenuItem(java.awt.Graphics g,
javax.swing.JComponent c,
javax.swing.Icon checkIcon,
javax.swing.Icon arrowIcon,
java.awt.Color background,
java.awt.Color foreground,
int defaultTextIconGap)
|
protected void |
removeListeners()
|
protected void |
setIsScreenMenu(boolean bool)
|
void |
update(java.awt.Graphics graphics,
javax.swing.JComponent jcomponent)
|
protected void |
updateListenersForScreenMenuItem()
|
Methods inherited from class javax.swing.plaf.basic.BasicMenuItemUI |
createMenuDragMouseListener, createMenuKeyListener, createMouseInputListener, doClick, getMaximumSize, getMinimumSize, getPath, getPreferredSize, installComponents, installDefaults, installKeyboardActions, installListeners, installUI, paint, paintBackground, paintText, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI |
Methods inherited from class javax.swing.plaf.ComponentUI |
contains, getAccessibleChild, getAccessibleChildrenCount |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
createUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent jcomponent)
getPropertyPrefix
protected java.lang.String getPropertyPrefix()
- Overrides:
getPropertyPrefix
in class javax.swing.plaf.basic.BasicMenuItemUI
updateListenersForScreenMenuItem
protected void updateListenersForScreenMenuItem()
setIsScreenMenu
protected void setIsScreenMenu(boolean bool)
removeListeners
protected void removeListeners()
addListeners
protected void addListeners()
paintMenuItem
protected void paintMenuItem(java.awt.Graphics g,
javax.swing.JComponent c,
javax.swing.Icon checkIcon,
javax.swing.Icon arrowIcon,
java.awt.Color background,
java.awt.Color foreground,
int defaultTextIconGap)
- Overrides:
paintMenuItem
in class javax.swing.plaf.basic.BasicMenuItemUI
getPreferredMenuItemSize
protected java.awt.Dimension getPreferredMenuItemSize(javax.swing.JComponent c,
javax.swing.Icon checkIcon,
javax.swing.Icon arrowIcon,
int defaultTextIconGap)
- Overrides:
getPreferredMenuItemSize
in class javax.swing.plaf.basic.BasicMenuItemUI
update
public void update(java.awt.Graphics graphics,
javax.swing.JComponent jcomponent)
- Overrides:
update
in class javax.swing.plaf.basic.BasicMenuItemUI
paintBackground
public void paintBackground(java.awt.Graphics g,
javax.swing.JComponent component,
int menuWidth,
int menuHeight)
- Specified by:
paintBackground
in interface QuaquaMenuPainterClient