Package org.pushingpixels.substance.internal.ui

# Class SubstanceMenuItemUI

java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ButtonUI
javax.swing.plaf.MenuItemUI
javax.swing.plaf.basic.BasicMenuItemUI
org.pushingpixels.substance.internal.ui.SubstanceMenuItemUI

All Implemented Interfaces:
  `TransitionAwareUI`, `SubstanceMenu`

public class SubstanceMenuItemUI extends BasicMenuItemUI implements SubstanceMenu, TransitionAwareUI
UI for menu items in Substance look and feel.

## Nested Class Summary

## Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicMenuItemUI

`BasicMenuItemUI.MouseInputHandler`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected StateTransitionTracker`
`stateTransitionTracker`
`protected MenuUtilities.MenuPropertyListener`
`substanceMenuPropertyListener`
Listens on all changes to the underlying menu item.
`protected PropertyChangeListener`
`substancePropertyListener`
`protected RolloverMenuItemListener`
`substanceRolloverListener`
Rollover listener.

### 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
`SubstanceMenuItemUI(JMenuItem menuItem)`

## Method Summary

Modifier and Type
Method
Description
`static ComponentUI`
`createUI(JComponent comp)`
`Font`
`getAcceleratorFont()`
Returns the font of the accelerator string of `this` UI delegate.
`Icon`
`getArrowIcon()`
Returns the arrow icon of `this` UI delegate.
`JMenuItem`
`getAssociatedMenuItem()`
Returns the associated menu item.
`Icon`
`getCheckIcon()`
Returns the checkmark icon of `this` UI delegate.
`int`
`getDefaultTextIconGap()`
Returns the default gap between the icon and the text for `this` delegate.
`protected Dimension`
`getPreferredMenuItemSize(JComponent c, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap)`
`StateTransitionTracker`
`getTransitionTracker()`
Returns the model for tracking the transitions.
`protected void`
`installDefaults()`
`protected void`
`installListeners()`
`boolean`
`isInside(MouseEvent me)`
Checks whether the mouse position of the specified event lies inside the area of the component designated for transition effects.
`protected void`
`paintMenuItem(Graphics g, JComponent c, Icon checkIcon, Icon arrowIcon, Color background, Color foreground, int defaultTextIconGap)`
`protected void`
`uninstallListeners()`

### Methods inherited from class javax.swing.plaf.basic.BasicMenuItemUI

`createMenuDragMouseListener, createMenuKeyListener, createMouseInputListener, createPropertyChangeListener, doClick, getMaximumSize, getMinimumSize, getPath, getPreferredSize, getPropertyPrefix, installComponents, installKeyboardActions, installUI, paint, paintBackground, paintText, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallUI, update`

### Methods inherited from class javax.swing.plaf.ComponentUI

`contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### stateTransitionTracker

protected StateTransitionTracker stateTransitionTracker

### substanceMenuPropertyListener

protected MenuUtilities.MenuPropertyListener substanceMenuPropertyListener
Listens on all changes to the underlying menu item.

### substanceRolloverListener

protected RolloverMenuItemListener substanceRolloverListener
Rollover listener.

### substancePropertyListener

protected PropertyChangeListener substancePropertyListener

## Constructor Details

### SubstanceMenuItemUI

public SubstanceMenuItemUI(JMenuItem menuItem)

## Method Details

### createUI

public static ComponentUI createUI(JComponent comp)

### installListeners

protected void installListeners()

Overrides:
  `installListeners` in class `BasicMenuItemUI`

### installDefaults

protected void installDefaults()

Overrides:
  `installDefaults` in class `BasicMenuItemUI`

### uninstallListeners

protected void uninstallListeners()

Overrides:
  `uninstallListeners` in class `BasicMenuItemUI`

### getAssociatedMenuItem

public JMenuItem getAssociatedMenuItem()
Description copied from interface: `SubstanceMenu`
Returns the associated menu item.

Specified by:
  `getAssociatedMenuItem` in interface `SubstanceMenu`
Returns:
  The associated menu item.

### getAcceleratorFont

public Font getAcceleratorFont()
Description copied from interface: `SubstanceMenu`
Returns the font of the accelerator string of `this` UI delegate.

Specified by:
  `getAcceleratorFont` in interface `SubstanceMenu`
Returns:
  The font of the accelerator string of `this` UI delegate.

### getArrowIcon

public Icon getArrowIcon()
Description copied from interface: `SubstanceMenu`
Returns the arrow icon of `this` UI delegate.

Specified by:
  `getArrowIcon` in interface `SubstanceMenu`
Returns:
  The arrow icon of `this` UI delegate.

### getCheckIcon

public Icon getCheckIcon()
Description copied from interface: `SubstanceMenu`
Returns the checkmark icon of `this` UI delegate.

Specified by:
  `getCheckIcon` in interface `SubstanceMenu`
Returns:
  The checkmark icon of `this` UI delegate.

### getDefaultTextIconGap

public int getDefaultTextIconGap()
Description copied from interface: `SubstanceMenu`
Returns the default gap between the icon and the text for `this` delegate.

Specified by:
  `getDefaultTextIconGap` in interface `SubstanceMenu`
Returns:
  The default gap between the icon and the text for `this` delegate.

### getPreferredMenuItemSize

protected Dimension getPreferredMenuItemSize(JComponent c, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap)

Overrides:
  `getPreferredMenuItemSize` in class `BasicMenuItemUI`

### paintMenuItem

protected void paintMenuItem(Graphics g, JComponent c, Icon checkIcon, Icon arrowIcon, Color background, Color foreground, int defaultTextIconGap)

Overrides:
  `paintMenuItem` in class `BasicMenuItemUI`

### getTransitionTracker

public StateTransitionTracker getTransitionTracker()
Description copied from interface: `TransitionAwareUI`
Returns the model for tracking the transitions.

Specified by:
  `getTransitionTracker` in interface `TransitionAwareUI`
Returns:
  Model for tracking the transitions.

### isInside

public boolean isInside(MouseEvent me)
Description copied from interface: `TransitionAwareUI`
Checks whether the mouse position of the specified event lies inside the area of the component designated for transition effects.

Specified by:
  `isInside` in interface `TransitionAwareUI`
Parameters:
  `me` - Mouse event.
Returns:
  `true` if the mouse position of the specified event lies inside the area of the component designated for transition effects, `false` otherwise.