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
FieldsModifier and TypeFieldDescriptionprotected StateTransitionTrackerprotected MenuUtilities.MenuPropertyListenerListens on all changes to the underlying menu item.protected PropertyChangeListenerprotected RolloverMenuItemListenerRollover 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 -
Method Summary
Modifier and TypeMethodDescriptionstatic ComponentUIcreateUI(JComponent comp) Returns the font of the accelerator string ofthisUI delegate.Returns the arrow icon ofthisUI delegate.Returns the associated menu item.Returns the checkmark icon ofthisUI delegate.intReturns the default gap between the icon and the text forthisdelegate.protected DimensiongetPreferredMenuItemSize(JComponent c, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap) Returns the model for tracking the transitions.protected voidprotected voidbooleanisInside(MouseEvent me) Checks whether the mouse position of the specified event lies inside the area of the component designated for transition effects.protected voidpaintMenuItem(Graphics g, JComponent c, Icon checkIcon, Icon arrowIcon, Color background, Color foreground, int defaultTextIconGap) protected voidMethods 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, updateMethods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior
-
Field Details
-
stateTransitionTracker
-
substanceMenuPropertyListener
Listens on all changes to the underlying menu item. -
substanceRolloverListener
Rollover listener. -
substancePropertyListener
-
-
Constructor Details
-
SubstanceMenuItemUI
-
-
Method Details
-
createUI
-
installListeners
protected void installListeners()- Overrides:
installListenersin classBasicMenuItemUI
-
installDefaults
protected void installDefaults()- Overrides:
installDefaultsin classBasicMenuItemUI
-
uninstallListeners
protected void uninstallListeners()- Overrides:
uninstallListenersin classBasicMenuItemUI
-
getAssociatedMenuItem
Description copied from interface:SubstanceMenuReturns the associated menu item.- Specified by:
getAssociatedMenuItemin interfaceSubstanceMenu- Returns:
- The associated menu item.
-
getAcceleratorFont
Description copied from interface:SubstanceMenuReturns the font of the accelerator string ofthisUI delegate.- Specified by:
getAcceleratorFontin interfaceSubstanceMenu- Returns:
- The font of the accelerator string of
thisUI delegate.
-
getArrowIcon
Description copied from interface:SubstanceMenuReturns the arrow icon ofthisUI delegate.- Specified by:
getArrowIconin interfaceSubstanceMenu- Returns:
- The arrow icon of
thisUI delegate.
-
getCheckIcon
Description copied from interface:SubstanceMenuReturns the checkmark icon ofthisUI delegate.- Specified by:
getCheckIconin interfaceSubstanceMenu- Returns:
- The checkmark icon of
thisUI delegate.
-
getDefaultTextIconGap
public int getDefaultTextIconGap()Description copied from interface:SubstanceMenuReturns the default gap between the icon and the text forthisdelegate.- Specified by:
getDefaultTextIconGapin interfaceSubstanceMenu- Returns:
- The default gap between the icon and the text for
thisdelegate.
-
getPreferredMenuItemSize
protected Dimension getPreferredMenuItemSize(JComponent c, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap) - Overrides:
getPreferredMenuItemSizein classBasicMenuItemUI
-
paintMenuItem
protected void paintMenuItem(Graphics g, JComponent c, Icon checkIcon, Icon arrowIcon, Color background, Color foreground, int defaultTextIconGap) - Overrides:
paintMenuItemin classBasicMenuItemUI
-
getTransitionTracker
Description copied from interface:TransitionAwareUIReturns the model for tracking the transitions.- Specified by:
getTransitionTrackerin interfaceTransitionAwareUI- Returns:
- Model for tracking the transitions.
-
isInside
Description copied from interface:TransitionAwareUIChecks whether the mouse position of the specified event lies inside the area of the component designated for transition effects.- Specified by:
isInsidein interfaceTransitionAwareUI- Parameters:
me- Mouse event.- Returns:
trueif the mouse position of the specified event lies inside the area of the component designated for transition effects,falseotherwise.
-