< prev index next >
src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.java
Print this page
@@ -91,11 +91,12 @@
* Windows* class because these colors passes from
* BasicMenuItemUI as protected fields and we can't
* reach them from this class */
g.setColor(b.getForeground());
}
- SwingUtilities2.drawStringUnderlineCharAt(b, g,text, mnemIndex, x, y);
+ SwingUtilities2.getTextUIDrawing(b)
+ .drawStringUnderlineCharAt(b, g,text, mnemIndex, x, y);
} else { /*** paint the text disabled ***/
color = getDisabledTextColor(b);
if (color == null) {
color = UIManager.getColor("Button.shadow");
}
@@ -105,18 +106,18 @@
} else {
if (shadow == null) {
shadow = b.getBackground().darker();
}
g.setColor(shadow);
- SwingUtilities2.drawStringUnderlineCharAt(b, g, text, mnemIndex,
+ SwingUtilities2.getTextUIDrawing(b).drawStringUnderlineCharAt(b, g, text, mnemIndex,
x + 1, y + 1);
}
if (color == null) {
color = b.getBackground().brighter();
}
g.setColor(color);
- SwingUtilities2.drawStringUnderlineCharAt(b, g, text, mnemIndex, x, y);
+ SwingUtilities2.getTextUIDrawing(b).drawStringUnderlineCharAt(b, g, text, mnemIndex, x, y);
}
}
private static Color getDisabledTextColor(AbstractButton b) {
if (b instanceof JCheckBox) {
@@ -174,19 +175,19 @@
Color shadowColor = xp.getColor(b, part, state,
Prop.TEXTSHADOWCOLOR, Color.black);
Point offset = xp.getPoint(b, part, state, Prop.TEXTSHADOWOFFSET);
if (offset != null) {
g.setColor(shadowColor);
- SwingUtilities2.drawStringUnderlineCharAt(b, g, text, mnemIndex,
+ SwingUtilities2.getTextUIDrawing(b).drawStringUnderlineCharAt(b, g, text, mnemIndex,
x + offset.x,
y + offset.y);
}
}
}
g.setColor(textColor);
- SwingUtilities2.drawStringUnderlineCharAt(b, g, text, mnemIndex, x, y);
+ SwingUtilities2.getTextUIDrawing(b).drawStringUnderlineCharAt(b, g, text, mnemIndex, x, y);
}
static boolean isLeftToRight(Component c) {
return c.getComponentOrientation().isLeftToRight();
}
< prev index next >