com.jgoodies.looks.common
Class MenuItemRenderer
java.lang.Object
com.jgoodies.looks.common.MenuItemRenderer
- public final class MenuItemRenderer
- extends Object
Renders and lays out menu items.
- Version:
- $Revision: 1.4 $
- Author:
- Karsten Lentzsch
Constructor Summary |
MenuItemRenderer(JMenuItem menuItem,
boolean iconBorderEnabled,
Font acceleratorFont,
Color selectionForeground,
Color disabledForeground,
Color acceleratorForeground,
Color acceleratorSelectionForeground)
Constructs a MenuItemRenderer for the specified menu item and settings. |
Method Summary |
Dimension |
getPreferredMenuItemSize(JComponent c,
Icon checkIcon,
Icon arrowIcon,
int defaultTextIconGap)
|
void |
paintBackground(Graphics g,
JMenuItem aMenuItem,
Color bgColor)
Draws the background of the menu item.
|
void |
paintMenuItem(Graphics g,
JComponent c,
Icon checkIcon,
Icon arrowIcon,
Color background,
Color foreground,
int defaultTextIconGap)
|
void |
paintText(Graphics g,
JMenuItem aMenuItem,
Rectangle textRectangle,
String text)
Renders the text of the current menu item.
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HTML_KEY
protected static final String HTML_KEY
- See Also:
- Constant Field Values
MenuItemRenderer
public MenuItemRenderer(JMenuItem menuItem,
boolean iconBorderEnabled,
Font acceleratorFont,
Color selectionForeground,
Color disabledForeground,
Color acceleratorForeground,
Color acceleratorSelectionForeground)
- Constructs a MenuItemRenderer for the specified menu item and settings.
getPreferredMenuItemSize
public Dimension getPreferredMenuItemSize(JComponent c,
Icon checkIcon,
Icon arrowIcon,
int defaultTextIconGap)
paintMenuItem
public void paintMenuItem(Graphics g,
JComponent c,
Icon checkIcon,
Icon arrowIcon,
Color background,
Color foreground,
int defaultTextIconGap)
paintBackground
public void paintBackground(Graphics g,
JMenuItem aMenuItem,
Color bgColor)
- Draws the background of the menu item.
Copied from 1.4.1 BasicMenuItem to make it visible to the
MenuItemLayouter
- Parameters:
g
- the paint graphicsaMenuItem
- menu item to be paintedbgColor
- selection background color- Since:
- 1.4
paintText
public void paintText(Graphics g,
JMenuItem aMenuItem,
Rectangle textRectangle,
String text)
- Renders the text of the current menu item.
- Parameters:
g
- graphics contextaMenuItem
- menu item to rendertextRectangle
- bounding rectangle for rendering the texttext
- string to render- Since:
- 1.4
Copyright © 2001-2005 JGoodies Karsten Lentzsch. All Rights Reserved.