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.BasicMenuUIAn implementation ofMenuUIused 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 classExtBasicMenuUI.RolloverHandler
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringMENU_PROPERTY_PREFIXprivate java.awt.event.MouseListenermouseListenerprivate java.lang.StringpropertyPrefixprivate MenuItemRendererrendererprivate static java.lang.StringSUBMENU_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.ComponentUIcreateUI(javax.swing.JComponent b)private voidensureSubMenuInstalled()Checks if we have already detected the correct menu type, menu in menu bar vs.protected java.awt.DimensiongetPreferredMenuItemSize(javax.swing.JComponent c, javax.swing.Icon aCheckIcon, javax.swing.Icon anArrowIcon, int textIconGap)protected java.lang.StringgetPropertyPrefix()protected voidinstallDefaults()protected voidinstallListeners()private static booleanisSubMenu(javax.swing.JMenuItem aMenuItem)protected voidpaintMenuItem(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 voiduninstallDefaults()protected voiduninstallListeners()private voiduninstallRolloverListener()-
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:
installDefaultsin classjavax.swing.plaf.basic.BasicMenuUI
-
uninstallDefaults
protected void uninstallDefaults()
- Overrides:
uninstallDefaultsin classjavax.swing.plaf.basic.BasicMenuUI
-
getPropertyPrefix
protected java.lang.String getPropertyPrefix()
- Overrides:
getPropertyPrefixin 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:
getPreferredMenuItemSizein 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:
paintMenuItemin 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:
installListenersin classjavax.swing.plaf.basic.BasicMenuUI
-
uninstallListeners
protected void uninstallListeners()
- Overrides:
uninstallListenersin classjavax.swing.plaf.basic.BasicMenuUI
-
uninstallRolloverListener
private void uninstallRolloverListener()
-
isSubMenu
private static boolean isSubMenu(javax.swing.JMenuItem aMenuItem)
-
-