|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvitro.Drawing
public class Drawing
A collection of useful utility routines for drawing 2D graphics.
Constructor Summary | |
---|---|
Drawing()
|
Method Summary | |
---|---|
static void |
configureRaster(Graphics g)
Configure a Graphics surface for drawing raster graphics- preference speed and pixel-wise interpolation. |
static void |
configureVector(Graphics g)
Configure a Graphics surface for drawing vector graphics- antialias and preference rendering quality. |
static void |
drawBezelRect(Graphics g,
int x,
int y,
int width,
int height,
int thickness,
Color ulBezel,
Color drBezel,
Color fill)
Draw a '3D' bezeled rectangle. |
static void |
drawBezelRect(Graphics g,
Rectangle bound,
int thickness,
Color ulBezel,
Color drBezel,
Color main)
Draw a '3D' bezeled rectangle. |
static void |
drawCircleCentered(Graphics g,
int x,
int y,
int radius,
Color outline,
Color fill)
Draw a filled circle with a given fill and outline color. |
static void |
drawRoundRect(Graphics g,
int x,
int y,
int width,
int height,
int radius,
Color outline,
Color fill)
Draw a filled rounded rectangle with a given fill and outline color. |
static void |
drawStringCentered(Graphics g,
String s,
int x,
int y)
Draw a String centered vertically and horizontal at a given position onscreen. |
static int |
stringHeight(Graphics g,
String s)
Get the height of a String in pixels given the current drawing context. |
static int |
stringWidth(Graphics g,
String s)
Get the width of a String in pixels given the current drawing context. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Drawing()
Method Detail |
---|
public static int stringWidth(Graphics g, String s)
g
- the target graphics context.s
- the String to consider.
public static int stringHeight(Graphics g, String s)
g
- the target graphics context.s
- the String to consider.
public static void drawStringCentered(Graphics g, String s, int x, int y)
g
- the target graphics surface.s
- the String to draw.x
- the x coordinate of the centerpoint.y
- the y coordinate of the centerpoint.public static void drawCircleCentered(Graphics g, int x, int y, int radius, Color outline, Color fill)
g
- the target graphics surface.x
- the x coordinate of the circle's centerpoint.y
- the y coordinate of the circle's centerpoint.radius
- the circle's radius, in pixels.outline
- the color of the circle's outline.fill
- the color with which to fill the circle.public static void drawRoundRect(Graphics g, int x, int y, int width, int height, int radius, Color outline, Color fill)
g
- the target graphics surface.x
- the x coordinate of the rectangle's top left corner.y
- the y coordinate of the rectangle's top left corner.width
- the width of the rectangle, in pixels.height
- the height of the rectangle, in pixels.radius
- the corner radius, in pixels.outline
- the color of the rectangle's outline.fill
- the color with which to fill the rectangle.public static void drawBezelRect(Graphics g, Rectangle bound, int thickness, Color ulBezel, Color drBezel, Color main)
g
- the target graphics surface.bound
- a rectangle representing the size and position of the bezeled rectangle.thickness
- the thickness of the bezel, in pixels.ulBezel
- the color for the upper and left edges of the bezel.drBezel
- the color for the down and right edges of the bezel.main
- the primary fill for the rectangle.public static void drawBezelRect(Graphics g, int x, int y, int width, int height, int thickness, Color ulBezel, Color drBezel, Color fill)
g
- the target graphics surface.x
- the x coordinate of the rectangle's top left corner.y
- the y coordinate of the rectangle's top left corner.width
- the width of the rectangle, in pixels.height
- the height of the rectangle, in pixels.thickness
- the thickness of the bezel, in pixels.ulBezel
- the color for the upper and left edges of the bezel.drBezel
- the color for the down and right edges of the bezel.fill
- the primary fill for the rectangle.public static void configureRaster(Graphics g)
g
- the target graphics context.public static void configureVector(Graphics g)
g
- the target graphics context.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |