< prev index next >

src/java.desktop/share/classes/javax/swing/plaf/synth/SynthGraphicsUtils.java

Print this page

        

*** 171,182 **** * * @return the size of the passed in string. */ public int computeStringWidth(SynthContext ss, Font font, FontMetrics metrics, String text) { ! return SwingUtilities2.stringWidth(ss.getComponent(), metrics, ! text); } /** * Returns the minimum size needed to properly render an icon and text. * --- 171,183 ---- * * @return the size of the passed in string. */ public int computeStringWidth(SynthContext ss, Font font, FontMetrics metrics, String text) { ! JComponent comp = ss.getComponent(); ! return SwingUtilities2.getTextUIDrawing(comp) ! .getStringWidth(comp, metrics, text); } /** * Returns the minimum size needed to properly render an icon and text. *
*** 345,356 **** int x, int y, int mnemonicIndex) { if (text != null) { JComponent c = ss.getComponent(); FontMetrics fm = SwingUtilities2.getFontMetrics(c, g); y += fm.getAscent(); ! SwingUtilities2.drawStringUnderlineCharAt(c, g, text, ! mnemonicIndex, x, y); } } /** * Paints an icon and text. This will render the text as html, if --- 346,357 ---- int x, int y, int mnemonicIndex) { if (text != null) { JComponent c = ss.getComponent(); FontMetrics fm = SwingUtilities2.getFontMetrics(c, g); y += fm.getAscent(); ! SwingUtilities2.getTextUIDrawing(c) ! .drawStringUnderlineCharAt(c, g, text, mnemonicIndex, x, y); } } /** * Paints an icon and text. This will render the text as html, if
< prev index next >