|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgoodies.plaf.common.MenuItemRenderer
Renders and lays out menu items.
Field Summary | |
protected static String |
HTML_KEY
|
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 | |
static void |
drawStringUnderlineCharAt(Graphics g,
String text,
int underlinedIndex,
int x,
int y)
Draws a string with the graphics g at location
(x , y )
just like g.drawString would.
|
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 |
Field Detail |
protected static final String HTML_KEY
Constructor Detail |
public MenuItemRenderer(JMenuItem menuItem, boolean iconBorderEnabled, Font acceleratorFont, Color selectionForeground, Color disabledForeground, Color acceleratorForeground, Color acceleratorSelectionForeground)
Method Detail |
public Dimension getPreferredMenuItemSize(JComponent c, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap)
public void paintMenuItem(Graphics g, JComponent c, Icon checkIcon, Icon arrowIcon, Color background, Color foreground, int defaultTextIconGap)
public void paintBackground(Graphics g, JMenuItem aMenuItem, Color bgColor)
g
- the paint graphicsaMenuItem
- menu item to be paintedbgColor
- selection background colorpublic void paintText(Graphics g, JMenuItem aMenuItem, Rectangle textRectangle, String text)
g
- graphics contextaMenuItem
- menu item to rendertextRectangle
- bounding rectangle for rendering the texttext
- string to renderpublic static void drawStringUnderlineCharAt(Graphics g, String text, int underlinedIndex, int x, int y)
g
at location
(x
, y
)
just like g.drawString
would.
The character at index underlinedIndex
in text will be underlined. If index
is beyond the
bounds of text
(including < 0), nothing will be
underlined.
g
- Graphics to draw withtext
- String to drawunderlinedIndex
- Index of character in text to underlinex
- x coordinate to draw aty
- y coordinate to draw at
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |