public final class RenderingUtils
extends java.lang.Object
Note: This class is not part of the public JGoodies Common API. It should be treated as library internal and should not be used by API users. It may be removed or changed without further notice.
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.reflect.Method |
drawStringMethod
Holds the public static method
SwingUtilities2#drawString. |
private static java.lang.reflect.Method |
drawStringUnderlineCharAtMethod
Holds the public static method
SwingUtilities2#drawStringUnderlinedAt. |
private static java.lang.reflect.Method |
getFontMetricsMethod
Holds the public static method
SwingUtilities2#getFontMetrics. |
private static java.lang.String |
PROP_DESKTOPHINTS |
private static java.lang.String |
SWING_UTILITIES2_NAME |
| Modifier | Constructor and Description |
|---|---|
private |
RenderingUtils() |
| Modifier and Type | Method and Description |
|---|---|
private static java.util.Map |
desktopHints(java.awt.Graphics2D g2) |
static void |
drawString(javax.swing.JComponent c,
java.awt.Graphics g,
java.lang.String text,
int x,
int y)
Draws the string at the specified location underlining the specified
character.
|
static void |
drawStringUnderlineCharAt(javax.swing.JComponent c,
java.awt.Graphics g,
java.lang.String text,
int underlinedIndex,
int x,
int y)
Draws the string at the specified location underlining the specified
character.
|
static java.awt.FontMetrics |
getFontMetrics(javax.swing.JComponent c,
java.awt.Graphics g)
Returns the FontMetrics for the current Font of the passed
in Graphics.
|
private static java.lang.reflect.Method |
getMethodDrawString() |
private static java.lang.reflect.Method |
getMethodDrawStringUnderlineCharAt() |
private static java.lang.reflect.Method |
getMethodGetFontMetrics() |
private static java.util.Map |
installDesktopHints(java.awt.Graphics2D g2) |
private static boolean |
isPrinting(java.awt.Graphics g) |
private static final java.lang.String PROP_DESKTOPHINTS
private static final java.lang.String SWING_UTILITIES2_NAME
private static java.lang.reflect.Method drawStringMethod
SwingUtilities2#drawString.private static java.lang.reflect.Method drawStringUnderlineCharAtMethod
SwingUtilities2#drawStringUnderlinedAt.private static java.lang.reflect.Method getFontMetricsMethod
SwingUtilities2#getFontMetrics.public static void drawString(javax.swing.JComponent c,
java.awt.Graphics g,
java.lang.String text,
int x,
int y)
c - JComponent that will display the string, may be nullg - Graphics to draw the text totext - String to displayx - X coordinate to draw the text aty - Y coordinate to draw the text atpublic static void drawStringUnderlineCharAt(javax.swing.JComponent c,
java.awt.Graphics g,
java.lang.String text,
int underlinedIndex,
int x,
int y)
c - JComponent that will display the string, may be nullg - Graphics to draw the text totext - String to displayunderlinedIndex - Index of a character in the string to underlinex - X coordinate to draw the text aty - Y coordinate to draw the text atpublic static java.awt.FontMetrics getFontMetrics(javax.swing.JComponent c,
java.awt.Graphics g)
Callers should pass in a non-null JComponent, the exception to this is if a JComponent is not readily available at the time of painting.
This does not necessarily return the FontMetrics from the Graphics.
c - JComponent requesting FontMetrics, may be nullg - Graphics Graphicsprivate static java.lang.reflect.Method getMethodDrawString()
private static java.lang.reflect.Method getMethodDrawStringUnderlineCharAt()
private static java.lang.reflect.Method getMethodGetFontMetrics()
private static java.util.Map installDesktopHints(java.awt.Graphics2D g2)
private static java.util.Map desktopHints(java.awt.Graphics2D g2)
private static boolean isPrinting(java.awt.Graphics g)