Package com.jgoodies.looks.common
Class ExtBasicMenuUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.ButtonUI
-
- javax.swing.plaf.MenuItemUI
-
- javax.swing.plaf.basic.BasicMenuItemUI
-
- javax.swing.plaf.basic.BasicMenuUI
-
- com.jgoodies.looks.common.ExtBasicMenuUI
-
- Direct Known Subclasses:
PlasticMenuUI
public class ExtBasicMenuUI extends javax.swing.plaf.basic.BasicMenuUI
An implementation ofMenuUI
used by the JGoodies Windows and Plastic looks. Unlike it's superclass, it aligns submenu items.- Version:
- $Revision: 1.12 $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ExtBasicMenuUI.RolloverHandler
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
MENU_PROPERTY_PREFIX
private java.awt.event.MouseListener
mouseListener
private java.lang.String
propertyPrefix
private MenuItemRenderer
renderer
private static java.lang.String
SUBMENU_PROPERTY_PREFIX
-
Fields inherited from class javax.swing.plaf.basic.BasicMenuItemUI
acceleratorDelimiter, acceleratorFont, acceleratorForeground, acceleratorSelectionForeground, arrowIcon, checkIcon, defaultTextIconGap, disabledForeground, menuDragMouseListener, menuItem, menuKeyListener, mouseInputListener, oldBorderPainted, propertyChangeListener, selectionBackground, selectionForeground
-
-
Constructor Summary
Constructors Constructor Description ExtBasicMenuUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static javax.swing.plaf.ComponentUI
createUI(javax.swing.JComponent b)
private void
ensureSubMenuInstalled()
Checks if we have already detected the correct menu type, menu in menu bar vs.protected java.awt.Dimension
getPreferredMenuItemSize(javax.swing.JComponent c, javax.swing.Icon aCheckIcon, javax.swing.Icon anArrowIcon, int textIconGap)
protected java.lang.String
getPropertyPrefix()
protected void
installDefaults()
protected void
installListeners()
private static boolean
isSubMenu(javax.swing.JMenuItem aMenuItem)
protected void
paintMenuItem(java.awt.Graphics g, javax.swing.JComponent c, javax.swing.Icon aCheckIcon, javax.swing.Icon anArrowIcon, java.awt.Color background, java.awt.Color foreground, int textIconGap)
protected void
uninstallDefaults()
protected void
uninstallListeners()
private void
uninstallRolloverListener()
-
Methods inherited from class javax.swing.plaf.basic.BasicMenuUI
createChangeListener, createMenuDragMouseListener, createMenuKeyListener, createMenuListener, createMouseInputListener, createPropertyChangeListener, getMaximumSize, getMinimumSize, installKeyboardActions, setupPostTimer, uninstallKeyboardActions
-
Methods inherited from class javax.swing.plaf.basic.BasicMenuItemUI
doClick, getPath, getPreferredSize, installComponents, installUI, paint, paintBackground, paintText, uninstallComponents, uninstallUI, update
-
-
-
-
Field Detail
-
MENU_PROPERTY_PREFIX
private static final java.lang.String MENU_PROPERTY_PREFIX
- See Also:
- Constant Field Values
-
SUBMENU_PROPERTY_PREFIX
private static final java.lang.String SUBMENU_PROPERTY_PREFIX
- See Also:
- Constant Field Values
-
propertyPrefix
private java.lang.String propertyPrefix
-
renderer
private MenuItemRenderer renderer
-
mouseListener
private java.awt.event.MouseListener mouseListener
-
-
Method Detail
-
createUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent b)
-
installDefaults
protected void installDefaults()
- Overrides:
installDefaults
in classjavax.swing.plaf.basic.BasicMenuUI
-
uninstallDefaults
protected void uninstallDefaults()
- Overrides:
uninstallDefaults
in classjavax.swing.plaf.basic.BasicMenuUI
-
getPropertyPrefix
protected java.lang.String getPropertyPrefix()
- Overrides:
getPropertyPrefix
in classjavax.swing.plaf.basic.BasicMenuUI
-
getPreferredMenuItemSize
protected java.awt.Dimension getPreferredMenuItemSize(javax.swing.JComponent c, javax.swing.Icon aCheckIcon, javax.swing.Icon anArrowIcon, int textIconGap)
- Overrides:
getPreferredMenuItemSize
in classjavax.swing.plaf.basic.BasicMenuItemUI
-
paintMenuItem
protected void paintMenuItem(java.awt.Graphics g, javax.swing.JComponent c, javax.swing.Icon aCheckIcon, javax.swing.Icon anArrowIcon, java.awt.Color background, java.awt.Color foreground, int textIconGap)
- Overrides:
paintMenuItem
in classjavax.swing.plaf.basic.BasicMenuItemUI
-
ensureSubMenuInstalled
private void ensureSubMenuInstalled()
Checks if we have already detected the correct menu type, menu in menu bar vs. sub menu; reinstalls if necessary.
-
installListeners
protected void installListeners()
- Overrides:
installListeners
in classjavax.swing.plaf.basic.BasicMenuUI
-
uninstallListeners
protected void uninstallListeners()
- Overrides:
uninstallListeners
in classjavax.swing.plaf.basic.BasicMenuUI
-
uninstallRolloverListener
private void uninstallRolloverListener()
-
isSubMenu
private static boolean isSubMenu(javax.swing.JMenuItem aMenuItem)
-
-