SwingConstants
public class QuaquaUtilities extends BasicGraphicsUtils implements SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
Modifier and Type | Method | Description |
---|---|---|
static Object |
beginGraphics(Graphics2D graphics2d) |
|
static Component |
compositeRequestFocus(Component component) |
Copied from BasicLookAndFeel.
|
static void |
configureGraphics(Graphics gr) |
|
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 graphics
g at location
(x , y )
just like g.drawString would. |
static 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 boolean |
isFocused(Component component) |
|
static boolean |
isLeftToRight(Component c) |
|
static boolean |
isOnActiveWindow(Component c) |
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) |
drawBezel, drawDashedRect, drawEtchedRect, drawGroove, drawLoweredBezel, drawString, drawString, drawStringUnderlineCharAt, getClippedString, getEtchedInsets, getGrooveInsets, getPreferredButtonSize, getStringWidth
public static boolean isLeftToRight(Component c)
public static void drawStringUnderlineCharAt(Graphics g, String text, int underlinedIndex, int x, int y)
g
at location
(x
, y
)
just like g.drawString
would.
The character at index underlinedIndex
in text will be underlined. If index
is beyond the
bounds of text
(including < 0), nothing will be
underlined.g
- Graphics to draw withtext
- String to drawunderlinedIndex
- Index of character in text to underlinex
- x coordinate to draw aty
- y coordinate to draw atpublic static boolean isOnActiveWindow(Component c)
public static String getKeyModifiersText(int modifiers, boolean leftToRight)
public static void repaintBorder(JComponent component)
public static final Object beginGraphics(Graphics2D graphics2d)
public static final void endGraphics(Graphics2D graphics2d, Object oldHints)
public static final boolean isFocused(Component component)
public static BufferedImage createBufferedImage(URL location)
public static TexturePaint createTexturePaint(URL location)
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)
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)
public static void configureGraphics(Graphics gr)