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 ObjectbeginGraphics(Graphics2D graphics2d) static ComponentcompositeRequestFocus(Component component) Copied from BasicLookAndFeel.static voidstatic BufferedImagecreateBufferedImage(URL location) static TexturePaintcreateTexturePaint(URL location) static voiddrawStringUnderlineCharAt(Graphics g, String text, int underlinedIndex, int x, int y) Draw a string with the graphicsgat location (x,y) just likeg.drawStringwould.static final voidendGraphics(Graphics2D graphics2d, Object oldHints) static StringgetKeyModifiersText(int modifiers, boolean leftToRight) Returns a Mac OS X specific String describing the modifier key(s), such as "Shift", or "Ctrl+Shift".static intgetLeftSideBearing(Font f, String string) static final booleanstatic booleanstatic booleanReturns 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 StringlayoutCompoundLabel(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 StringlayoutCompoundLabel(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 voidrepaintBorder(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 graphicsgat location (x,y) just likeg.drawStringwould. The character at indexunderlinedIndexin text will be underlined. Ifindexis 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.
-