Class RadianceMenuUI
- 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
-
- org.pushingpixels.radiance.theming.internal.ui.RadianceMenuUI
-
- All Implemented Interfaces:
TransitionAwareUI
,RadianceMenu
public class RadianceMenuUI extends javax.swing.plaf.basic.BasicMenuUI implements RadianceMenu, TransitionAwareUI
UI for menus in Radiance look and feel.
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.event.FocusListener
radianceFocusListener
For rollover effects - enhancement 93.private MenuUtilities.MenuPropertyListener
radianceMenuPropertyListener
Listens on all changes to the underlying menu item.private java.awt.event.MouseListener
radianceMouseListener
For rollover effects - enhancement 93.private java.beans.PropertyChangeListener
radiancePropertyListener
Property change listener.private StateTransitionTracker
stateTransitionTracker
-
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 Modifier Constructor Description protected
RadianceMenuUI(javax.swing.JMenu menuItem)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static javax.swing.plaf.ComponentUI
createUI(javax.swing.JComponent comp)
java.awt.Font
getAcceleratorFont()
Returns the font of the accelerator string ofthis
UI delegate.javax.swing.Icon
getArrowIcon()
Returns the arrow icon ofthis
UI delegate.javax.swing.JMenuItem
getAssociatedMenuItem()
Returns the associated menu item.javax.swing.Icon
getCheckIcon()
Returns the checkmark icon ofthis
UI delegate.int
getDefaultTextIconGap()
Returns the default gap between the icon and the text forthis
delegate.protected java.awt.Dimension
getPreferredMenuItemSize(javax.swing.JComponent c, javax.swing.Icon checkIcon, javax.swing.Icon arrowIcon, int defaultTextIconGap)
StateTransitionTracker
getTransitionTracker()
Returns the model for tracking the transitions.protected void
installDefaults()
protected void
installListeners()
boolean
isInside(java.awt.event.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(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
uninstallListeners()
void
update(java.awt.Graphics g, javax.swing.JComponent c)
void
updateCheckIconIfNeeded()
-
Methods inherited from class javax.swing.plaf.basic.BasicMenuUI
createChangeListener, createMenuDragMouseListener, createMenuKeyListener, createMenuListener, createMouseInputListener, createPropertyChangeListener, getMaximumSize, getMinimumSize, getPropertyPrefix, installKeyboardActions, setupPostTimer, uninstallDefaults, uninstallKeyboardActions
-
Methods inherited from class javax.swing.plaf.basic.BasicMenuItemUI
doClick, getPath, getPreferredSize, installComponents, installUI, paint, paintBackground, paintText, uninstallComponents, uninstallUI
-
-
-
-
Field Detail
-
radianceMouseListener
private java.awt.event.MouseListener radianceMouseListener
For rollover effects - enhancement 93.
-
stateTransitionTracker
private StateTransitionTracker stateTransitionTracker
-
radianceMenuPropertyListener
private MenuUtilities.MenuPropertyListener radianceMenuPropertyListener
Listens on all changes to the underlying menu item.
-
radiancePropertyListener
private java.beans.PropertyChangeListener radiancePropertyListener
Property change listener. Listens on changes toAbstractButton.MODEL_CHANGED_PROPERTY
property.
-
radianceFocusListener
private java.awt.event.FocusListener radianceFocusListener
For rollover effects - enhancement 93.
-
-
Method Detail
-
createUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent comp)
-
installDefaults
protected void installDefaults()
- Overrides:
installDefaults
in classjavax.swing.plaf.basic.BasicMenuUI
-
installListeners
protected void installListeners()
- Overrides:
installListeners
in classjavax.swing.plaf.basic.BasicMenuUI
-
uninstallListeners
protected void uninstallListeners()
- Overrides:
uninstallListeners
in classjavax.swing.plaf.basic.BasicMenuUI
-
getAssociatedMenuItem
public javax.swing.JMenuItem getAssociatedMenuItem()
Description copied from interface:RadianceMenu
Returns the associated menu item.- Specified by:
getAssociatedMenuItem
in interfaceRadianceMenu
- Returns:
- The associated menu item.
-
getAcceleratorFont
public java.awt.Font getAcceleratorFont()
Description copied from interface:RadianceMenu
Returns the font of the accelerator string ofthis
UI delegate.- Specified by:
getAcceleratorFont
in interfaceRadianceMenu
- Returns:
- The font of the accelerator string of
this
UI delegate.
-
getArrowIcon
public javax.swing.Icon getArrowIcon()
Description copied from interface:RadianceMenu
Returns the arrow icon ofthis
UI delegate.- Specified by:
getArrowIcon
in interfaceRadianceMenu
- Returns:
- The arrow icon of
this
UI delegate.
-
getCheckIcon
public javax.swing.Icon getCheckIcon()
Description copied from interface:RadianceMenu
Returns the checkmark icon ofthis
UI delegate.- Specified by:
getCheckIcon
in interfaceRadianceMenu
- Returns:
- The checkmark icon of
this
UI delegate.
-
getDefaultTextIconGap
public int getDefaultTextIconGap()
Description copied from interface:RadianceMenu
Returns the default gap between the icon and the text forthis
delegate.- Specified by:
getDefaultTextIconGap
in interfaceRadianceMenu
- Returns:
- The default gap between the icon and the text for
this
delegate.
-
getPreferredMenuItemSize
protected java.awt.Dimension getPreferredMenuItemSize(javax.swing.JComponent c, javax.swing.Icon checkIcon, javax.swing.Icon arrowIcon, int defaultTextIconGap)
- Overrides:
getPreferredMenuItemSize
in classjavax.swing.plaf.basic.BasicMenuItemUI
-
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 classjavax.swing.plaf.basic.BasicMenuItemUI
-
getTransitionTracker
public StateTransitionTracker getTransitionTracker()
Description copied from interface:TransitionAwareUI
Returns the model for tracking the transitions.- Specified by:
getTransitionTracker
in interfaceTransitionAwareUI
- Returns:
- Model for tracking the transitions.
-
isInside
public boolean isInside(java.awt.event.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 interfaceTransitionAwareUI
- 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.
-
update
public void update(java.awt.Graphics g, javax.swing.JComponent c)
- Overrides:
update
in classjavax.swing.plaf.basic.BasicMenuItemUI
-
updateCheckIconIfNeeded
public void updateCheckIconIfNeeded()
- Specified by:
updateCheckIconIfNeeded
in interfaceRadianceMenu
-
-