public class BasicGraphicsUtils extends Object
| Constructor and Description |
|---|
BasicGraphicsUtils()
|
| Modifier and Type | Method and Description |
|---|---|
static void |
drawBezel(Graphics
|
static void |
drawDashedRect(Graphics
|
static void |
drawEtchedRect(Graphics
|
static void |
drawGroove(Graphics
|
static void |
drawLoweredBezel(Graphics
|
static void |
drawString(Graphics
Draw a string with the graphics
g at location (x,y) just like
g.drawString would.
|
static void |
drawStringUnderlineCharAt(Graphics
Draw a string with the graphics
g at location (
x,
y) just like
g.drawString would.
|
static Insets |
getEtchedInsets()
Returns the amount of space taken up by a border drawn by
drawEtchedRect()
|
static Insets |
getGrooveInsets()
Returns the amount of space taken up by a border drawn by
drawGroove()
|
static Dimension |
getPreferredButtonSize(AbstractButton
|
public static void drawEtchedRect(Graphicsg, int x, int y, int w, int h, Color shadow, Color darkShadow, Color highlight, Color lightHighlight)
public static InsetsgetEtchedInsets()
drawEtchedRect()
public static void drawGroove(Graphicsg, int x, int y, int w, int h, Color shadow, Color highlight)
public static InsetsgetGrooveInsets()
drawGroove()
public static void drawBezel(Graphicsg, int x, int y, int w, int h, boolean isPressed, boolean isDefault, Color shadow, Color darkShadow, Color highlight, Color lightHighlight)
public static void drawLoweredBezel(Graphicsg, int x, int y, int w, int h, Color shadow, Color darkShadow, Color highlight, Color lightHighlight)
public static void drawString(Graphicsg, String text, int underlinedChar, int x, int y)
g at location (x,y) just like
g.drawString would. The first occurrence of
underlineChar in text will be underlined. The matching algorithm is not case sensitive.
public static void drawStringUnderlineCharAt(Graphicsg, 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 with
text - String to draw
underlinedIndex - Index of character in text to underline
x - x coordinate to draw at
y - y coordinate to draw at
public static void drawDashedRect(Graphicsg, int x, int y, int width, int height)
public static DimensiongetPreferredButtonSize(AbstractButton b, int textIconGap)