org.jvnet.substance
Class SubstanceRadioButtonMenuItemUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.ButtonUI
          extended by javax.swing.plaf.MenuItemUI
              extended by javax.swing.plaf.basic.BasicMenuItemUI
                  extended by javax.swing.plaf.basic.BasicRadioButtonMenuItemUI
                      extended by org.jvnet.substance.SubstanceRadioButtonMenuItemUI
All Implemented Interfaces:
SubstanceMenu, Trackable

public class SubstanceRadioButtonMenuItemUI
extends javax.swing.plaf.basic.BasicRadioButtonMenuItemUI
implements SubstanceMenu, Trackable

UI for radio button menu items in Substance look and feel.

Author:
Kirill Grouchnikov

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicMenuItemUI
javax.swing.plaf.basic.BasicMenuItemUI.MouseInputHandler
 
Field Summary
protected static java.awt.Graphics graphics
          Helper graphics context.
protected  org.jvnet.lafwidget.animation.FadeStateListener substanceFadeStateListener
          Listener for fade animations.
protected  MenuUtilities.MenuPropertyListener substanceMenuPropertyListener
          Listens on all changes to the underlying menu item.
protected  java.beans.PropertyChangeListener substancePropertyListener
          Property change listener.
protected  RolloverMenuItemListener substanceRolloverListener
          Rollover listener.
 
Fields inherited from class javax.swing.plaf.basic.BasicMenuItemUI
acceleratorFont, acceleratorForeground, acceleratorSelectionForeground, arrowIcon, checkIcon, defaultTextIconGap, disabledForeground, menuDragMouseListener, menuItem, menuKeyListener, mouseInputListener, oldBorderPainted, propertyChangeListener, selectionBackground, selectionForeground
 
Fields inherited from interface org.jvnet.substance.SubstanceMenu
SINGLE_MENU_TEXT_OFFSET
 
Constructor Summary
SubstanceRadioButtonMenuItemUI()
           
 
Method Summary
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent b)
           
 java.awt.Font getAcceleratorFont()
          Returns the font of the accelerator string of this UI delegate.
 javax.swing.Icon getArrowIcon()
          Returns the arrow icon of this UI delegate.
 javax.swing.JMenuItem getAssociatedMenuItem()
          Returns the associated menu item.
 javax.swing.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  java.awt.Dimension getPreferredMenuItemSize(javax.swing.JComponent c, javax.swing.Icon checkIcon, javax.swing.Icon arrowIcon, int defaultTextIconGap)
           
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 paintBackground(java.awt.Graphics g, javax.swing.JMenuItem menuItem, java.awt.Color bgColor)
           
protected  void paintText(java.awt.Graphics g, javax.swing.JMenuItem menuItem, java.awt.Rectangle textRect, java.lang.String text)
           
protected  void uninstallListeners()
           
 
Methods inherited from class javax.swing.plaf.basic.BasicRadioButtonMenuItemUI
getPropertyPrefix, processMouseEvent
 
Methods inherited from class javax.swing.plaf.basic.BasicMenuItemUI
createMenuDragMouseListener, createMenuKeyListener, createMouseInputListener, createPropertyChangeListener, doClick, getMaximumSize, getMinimumSize, getPath, getPreferredSize, installComponents, installKeyboardActions, installUI, paint, paintMenuItem, 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 Detail

substanceRolloverListener

protected RolloverMenuItemListener substanceRolloverListener
Rollover listener.


substanceFadeStateListener

protected org.jvnet.lafwidget.animation.FadeStateListener substanceFadeStateListener
Listener for fade animations.


substancePropertyListener

protected java.beans.PropertyChangeListener substancePropertyListener
Property change listener. Listens on changes to AbstractButton.MODEL_CHANGED_PROPERTY property.


graphics

protected static java.awt.Graphics graphics
Helper graphics context.


substanceMenuPropertyListener

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

Constructor Detail

SubstanceRadioButtonMenuItemUI

public SubstanceRadioButtonMenuItemUI()
Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent b)

installListeners

protected void installListeners()
Overrides:
installListeners in class javax.swing.plaf.basic.BasicMenuItemUI

uninstallListeners

protected void uninstallListeners()
Overrides:
uninstallListeners in class javax.swing.plaf.basic.BasicMenuItemUI

installDefaults

protected void installDefaults()
Overrides:
installDefaults in class javax.swing.plaf.basic.BasicMenuItemUI

paintBackground

protected void paintBackground(java.awt.Graphics g,
                               javax.swing.JMenuItem menuItem,
                               java.awt.Color bgColor)
Overrides:
paintBackground in class javax.swing.plaf.basic.BasicMenuItemUI

paintText

protected void paintText(java.awt.Graphics g,
                         javax.swing.JMenuItem menuItem,
                         java.awt.Rectangle textRect,
                         java.lang.String text)
Overrides:
paintText in class javax.swing.plaf.basic.BasicMenuItemUI

getAssociatedMenuItem

public javax.swing.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 java.awt.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 javax.swing.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 javax.swing.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 java.awt.Dimension getPreferredMenuItemSize(javax.swing.JComponent c,
                                                      javax.swing.Icon checkIcon,
                                                      javax.swing.Icon arrowIcon,
                                                      int defaultTextIconGap)
Overrides:
getPreferredMenuItemSize in class javax.swing.plaf.basic.BasicMenuItemUI

isInside

public boolean isInside(java.awt.event.MouseEvent me)
Description copied from interface: Trackable
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 Trackable
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.