Class QuaquaUtilities
java.lang.Object
javax.swing.plaf.basic.BasicGraphicsUtils
org.pushingpixels.substance.internal.contrib.randelshofer.quaqua.QuaquaUtilities
- All Implemented Interfaces:
SwingConstants
Utility class for the Quaqua LAF.
-
Field Summary
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
-
Method Summary
Modifier and TypeMethodDescriptionstatic final Object
beginGraphics
(Graphics2D graphics2d) static Component
compositeRequestFocus
(Component component) Copied from BasicLookAndFeel.static void
static BufferedImage
createBufferedImage
(URL location) static TexturePaint
createTexturePaint
(URL location) static void
drawStringUnderlineCharAt
(Graphics g, String text, int underlinedIndex, int x, int y) Draw a string with the graphicsg
at location (x
,y
) just likeg.drawString
would.static final void
endGraphics
(Graphics2D graphics2d, Object oldHints) static String
getKeyModifiersText
(int modifiers, boolean leftToRight) Returns a Mac OS X specific String describing the modifier key(s), such as "Shift", or "Ctrl+Shift".static int
getLeftSideBearing
(Font f, String string) static final boolean
static boolean
static boolean
Returns true if the component is on a Dialog or a Frame, which is active, or if it is on a Window, which is focused.static String
layoutCompoundLabel
(FontMetrics fm, String text, Icon icon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, Rectangle viewR, Rectangle iconR, Rectangle textR, int textIconGap) Compute and return the location of the icons origin, the location of origin of the text baseline, and a possibly clipped version of the compound labels string.static String
layoutCompoundLabel
(JComponent c, FontMetrics fm, String text, Icon icon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, Rectangle viewR, Rectangle iconR, Rectangle textR, int textIconGap) Compute and return the location of the icons origin, the location of origin of the text baseline, and a possibly clipped version of the compound labels string.static void
repaintBorder
(JComponent component) Methods inherited from class javax.swing.plaf.basic.BasicGraphicsUtils
drawBezel, drawDashedRect, drawEtchedRect, drawGroove, drawLoweredBezel, drawString, drawString, drawStringUnderlineCharAt, getClippedString, getEtchedInsets, getGrooveInsets, getPreferredButtonSize, getStringWidth
-
Method Details
-
isLeftToRight
-
drawStringUnderlineCharAt
public static void drawStringUnderlineCharAt(Graphics g, String text, int underlinedIndex, int x, int y) Draw a string with the graphicsg
at location (x
,y
) just likeg.drawString
would. The character at indexunderlinedIndex
in text will be underlined. Ifindex
is beyond the bounds oftext
(including < 0), nothing will be underlined.- Parameters:
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- Since:
- 1.4
-
isOnActiveWindow
Returns true if the component is on a Dialog or a Frame, which is active, or if it is on a Window, which is focused. Always returns true, if the component has no parent window. -
getKeyModifiersText
Returns a Mac OS X specific String describing the modifier key(s), such as "Shift", or "Ctrl+Shift".- Returns:
- string a text description of the combination of modifier keys that were held down during the event
-
repaintBorder
-
beginGraphics
-
endGraphics
-
isFocused
-
getLeftSideBearing
-
createBufferedImage
-
createTexturePaint
-
layoutCompoundLabel
public static String layoutCompoundLabel(JComponent c, FontMetrics fm, String text, Icon icon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, Rectangle viewR, Rectangle iconR, Rectangle textR, int textIconGap) Compute and return the location of the icons origin, the location of origin of the text baseline, and a possibly clipped version of the compound labels string. Locations are computed relative to the viewR rectangle. The JComponents orientation (LEADING/TRAILING) will also be taken into account and translated into LEFT/RIGHT values accordingly. -
layoutCompoundLabel
public static String layoutCompoundLabel(FontMetrics fm, String text, Icon icon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, Rectangle viewR, Rectangle iconR, Rectangle textR, int textIconGap) Compute and return the location of the icons origin, the location of origin of the text baseline, and a possibly clipped version of the compound labels string. Locations are computed relative to the viewR rectangle. This layoutCompoundLabel() does not know how to handle LEADING/TRAILING values in horizontalTextPosition (they will default to RIGHT) and in horizontalAlignment (they will default to CENTER). Use the other version of layoutCompoundLabel() instead. -
configureGraphics
-
compositeRequestFocus
Copied from BasicLookAndFeel.
-