|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jtheque.utils.ui.PaintUtils
public final class PaintUtils
Utility class to paint with Java2D.
The method tileStretchPaint has been recuperated from the Aerith Project.
Method Summary | |
---|---|
static void |
drawAlphaImage(Graphics2D g2,
BufferedImage image,
int x,
int y,
float alpha)
Draw a translucent image. |
static void |
drawAlphaImage(Graphics2D g2,
Image image,
int x,
int y,
int width,
int height,
float alpha)
Draw a translucent image with specified size. |
static void |
drawAlphaImage(Graphics2D g2,
Image image,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
float alpha)
Draw a translucent image with specified source and destination rectangles. |
static void |
drawString(Graphics g2,
String string,
int x,
int y,
Font font)
Draw a string. |
static void |
drawString(Graphics g2,
String string,
int x,
int y,
Font font,
Color color)
Draw a string. |
static void |
fillRect(Graphics g2,
int x,
int y,
int width,
int height,
Color color)
Fill a rectangle. |
static void |
initHints(Graphics2D g2)
Init the base hints for painting. |
static void |
tileStretchPaint(Graphics g,
Component component,
BufferedImage image,
Insets insets)
Draws an image on top of a component by doing a 3x3 grid stretch of the image using the specified insets. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void initHints(Graphics2D g2)
g2
- The graphics to init.public static void drawAlphaImage(Graphics2D g2, BufferedImage image, int x, int y, float alpha)
g2
- The graphics to paint with.image
- The image to paint.x
- The x position of the image.y
- The y position of the image.alpha
- The alpha value of the image painting.public static void drawAlphaImage(Graphics2D g2, Image image, int x, int y, int width, int height, float alpha)
g2
- The graphics to paint with.image
- The image to paint.x
- The x position of the image.y
- The y position of the image.width
- The width of the image.height
- The height of the image.alpha
- The alpha value of the image painting.public static void drawAlphaImage(Graphics2D g2, Image image, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, float alpha)
g2
- The graphics to paint with.image
- The image to paint.dx1
- the x coordinate of the first corner of the destination rectangle.dy1
- the y coordinate of the first corner of the destination rectangle.dx2
- the x coordinate of the second corner of the destination rectangle.dy2
- the y coordinate of the second corner of the destination rectangle.sx1
- the x coordinate of the first corner of the source rectangle.sy1
- the y coordinate of the first corner of the source rectangle.sx2
- the x coordinate of the second corner of the source rectangle.sy2
- the y coordinate of the second corner of the source rectangle.alpha
- The alpha value of the image painting.public static void drawString(Graphics g2, String string, int x, int y, Font font)
g2
- The graphics to paint with.string
- The string to paint.x
- The x position to paint from.y
- The y position to paint from.font
- The font to use.public static void drawString(Graphics g2, String string, int x, int y, Font font, Color color)
g2
- The graphics to paint with.string
- The string to paint.x
- The x position to paint from.y
- The y position to paint from.font
- The font to use.color
- The color to use.public static void fillRect(Graphics g2, int x, int y, int width, int height, Color color)
g2
- The graphics to paint with.x
- The x position to paint from.y
- The y position to paint from.width
- The width of the rectangle.height
- The height of the rectangle.color
- The color to use.public static void tileStretchPaint(Graphics g, Component component, BufferedImage image, Insets insets)
g
- The graphics object to use.component
- The component.image
- The image.insets
- The insets.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |