com.alee.laf.menu
Class WebRadioButtonMenuItemUI

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 com.alee.laf.menu.WebMenuItemUI
                      extended by com.alee.laf.menu.WebRadioButtonMenuItemUI
All Implemented Interfaces:
BorderMethods, SwingMethods

public class WebRadioButtonMenuItemUI
extends WebMenuItemUI

Custom UI for JRadioButtonMenuItem component.

Author:
Mikle Garin

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicMenuItemUI
javax.swing.plaf.basic.BasicMenuItemUI.MouseInputHandler
 
Field Summary
protected  java.awt.Color checkColor
          Style settings.
protected static javax.swing.ImageIcon radioCheckIcon
           
protected static javax.swing.ImageIcon radioIcon
          Used icons.
 
Fields inherited from class com.alee.laf.menu.WebMenuItemUI
acceleratorBg, acceleratorDisabledFg, acceleratorFg, acceleratorGap, alignTextToMenuIcons, buttonModelChangeListener, disabledFg, iconAlignment, margin, painter, propertyChangeListener, selectedBottomBg, selectedTopBg, sideSpacing
 
Fields inherited from class javax.swing.plaf.basic.BasicMenuItemUI
acceleratorFont, acceleratorForeground, acceleratorSelectionForeground, arrowIcon, checkIcon, defaultTextIconGap, disabledForeground, menuDragMouseListener, menuItem, menuKeyListener, mouseInputListener, oldBorderPainted, selectionBackground, selectionForeground
 
Constructor Summary
WebRadioButtonMenuItemUI()
           
 
Method Summary
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
          Returns an instance of the WebRadioButtonMenuItemUI for the specified component.
 java.awt.Color getCheckColor()
          Returns radiobutton menu item check color.
 java.awt.Paint getNorthCornerFill()
          Returns paint used to fill north popup menu corner when this component is first in the menu.
protected  java.lang.String getPropertyPrefix()
          Returns property prefix for this specific UI.
 java.awt.Paint getSouthCornerFill()
          Returns paint used to fill south popup menu corner when this component is last in the menu.
protected  void paintBackground(java.awt.Graphics2D g2d, javax.swing.JMenuItem menuItem, int x, int y, int w, int h, boolean selected, boolean ltr)
          Paints menu item background.
protected  void paintIcon(java.awt.Graphics2D g2d, javax.swing.JMenuItem menuItem, int x, int y, int w, int h, boolean selected, boolean ltr)
          Paints menu item icon.
 void setCheckColor(java.awt.Color color)
          Sets radiobutton menu item check color.
 
Methods inherited from class com.alee.laf.menu.WebMenuItemUI
getAcceleratorBg, getAcceleratorDisabledFg, getAcceleratorFg, getAcceleratorGap, getDisabledFg, getIconAlignment, getMargin, getPainter, getPreferredSize, getSelectedBottomBg, getSelectedTopBg, getSideSpacing, installUI, isAlignTextToMenuIcons, paint, paintAcceleratorText, paintText, setAcceleratorBg, setAcceleratorDisabledFg, setAcceleratorFg, setAcceleratorGap, setAlignTextToMenuIcons, setDisabledFg, setIconAlignment, setMargin, setPainter, setSelectedBottomBg, setSelectedTopBg, setSideSpacing, uninstallUI, updateBorder
 
Methods inherited from class javax.swing.plaf.basic.BasicMenuItemUI
createMenuDragMouseListener, createMenuKeyListener, createMouseInputListener, createPropertyChangeListener, doClick, getMaximumSize, getMinimumSize, getPath, getPreferredMenuItemSize, installComponents, installDefaults, installKeyboardActions, installListeners, paintBackground, paintMenuItem, paintText, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, 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

radioIcon

protected static final javax.swing.ImageIcon radioIcon
Used icons.


radioCheckIcon

protected static final javax.swing.ImageIcon radioCheckIcon

checkColor

protected java.awt.Color checkColor
Style settings.

Constructor Detail

WebRadioButtonMenuItemUI

public WebRadioButtonMenuItemUI()
Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
Returns an instance of the WebRadioButtonMenuItemUI for the specified component. This tricky method is used by UIManager to create component UIs when needed.

Parameters:
c - component that will use UI instance
Returns:
instance of the WebRadioButtonMenuItemUI

getPropertyPrefix

protected java.lang.String getPropertyPrefix()
Returns property prefix for this specific UI.

Overrides:
getPropertyPrefix in class javax.swing.plaf.basic.BasicMenuItemUI
Returns:
property prefix for this specific UI

getCheckColor

public java.awt.Color getCheckColor()
Returns radiobutton menu item check color.

Returns:
radiobutton menu item check color

setCheckColor

public void setCheckColor(java.awt.Color color)
Sets radiobutton menu item check color.

Parameters:
color - radiobutton menu item check color

getNorthCornerFill

public java.awt.Paint getNorthCornerFill()
Returns paint used to fill north popup menu corner when this component is first in the menu.

Overrides:
getNorthCornerFill in class WebMenuItemUI
Returns:
paint used to fill north popup menu corner when this component is first in the menu

getSouthCornerFill

public java.awt.Paint getSouthCornerFill()
Returns paint used to fill south popup menu corner when this component is last in the menu.

Overrides:
getSouthCornerFill in class WebMenuItemUI
Returns:
paint used to fill south popup menu corner when this component is last in the menu

paintBackground

protected void paintBackground(java.awt.Graphics2D g2d,
                               javax.swing.JMenuItem menuItem,
                               int x,
                               int y,
                               int w,
                               int h,
                               boolean selected,
                               boolean ltr)
Paints menu item background.

Overrides:
paintBackground in class WebMenuItemUI
Parameters:
g2d - graphics context
menuItem - menu item
x - icon placeholder X coordinate
y - icon placeholder Y coordinate
w - icon placeholder width
h - icon placeholder height
selected - whether menu item is selected or not
ltr - whether menu item has left-to-right orientation or not

paintIcon

protected void paintIcon(java.awt.Graphics2D g2d,
                         javax.swing.JMenuItem menuItem,
                         int x,
                         int y,
                         int w,
                         int h,
                         boolean selected,
                         boolean ltr)
Paints menu item icon.

Overrides:
paintIcon in class WebMenuItemUI
Parameters:
g2d - graphics context
menuItem - menu item
x - icon placeholder X coordinate
y - icon placeholder Y coordinate
w - icon placeholder width
h - icon placeholder height
selected - whether menu item is selected or not
ltr - whether menu item has left-to-right orientation or not