public class IlGraphicPrim extends Object
Modifier | Constructor and Description |
---|---|
protected |
IlGraphicPrim()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
static void |
_FillRect(Graphics g,
int x1,
int y1,
int x2,
int y2)
Deprecated.
Please use
Graphics#fillRect instead. |
static Image |
createImage(ImageProducer p)
Creates a new image given the image producer.
|
static Image |
CreateServerSideImage(int width,
int height)
Creates an off-screen image on the server side.
|
static void |
DrawCloud(Graphics2D g,
int x,
int y,
int width,
int height)
Draws the outline of a cloud with a line width of 1.
|
static void |
DrawDiamond(Graphics g,
int x1,
int y1,
int x2,
int y2)
Draws the border of a diamond with thickness 1 in the current color.
|
static void |
DrawEllipse(Graphics2D g,
int x,
int y,
int width,
int height)
Draws the outline of an ellipse with a line width of 1.
|
static void |
DrawLine(Graphics g,
int x1,
int y1,
int x2,
int y2)
Draws a line of thickness 1 in the current color.
|
static void |
DrawLineClipX(Graphics g,
int x1,
int y1,
int x2,
int y2,
int xmin,
int xmax)
Draws a line of thickness 1 in the current color, restricted to x
in the range xmin <= x <= xmax.
|
static void |
DrawLineClipY(Graphics g,
int x1,
int y1,
int x2,
int y2,
int ymin,
int ymax)
Draws a line of thickness 1 in the current color, restricted to y
in the range ymin <= y <= ymax.
|
static void |
DrawPoint(Graphics g,
int x1,
int y1)
Deprecated.
Please use
java.awt.Graphics#drawLine instead. |
static void |
DrawRect(Graphics g,
int x1,
int y1,
int x2,
int y2)
Draws a rectangle boundary with thickness 1 in the current color.
|
static void |
DrawRect(Graphics g,
int x1,
int y1,
int x2,
int y2,
float thickness,
int cap)
Draws a rectangle outline with a given thickness in the current color.
|
static void |
DrawRoundRect(Graphics g,
int x1,
int y1,
int x2,
int y2,
int xradius,
int yradius)
Draws an outlined rounded corner rectangle with a line width of 1.
|
static void |
FillCloud(Graphics2D g,
int x,
int y,
int width,
int height)
Fills a cloud bounded by the specified rectangle with the
current color.
|
static void |
FillEllipse(Graphics2D g,
int x,
int y,
int width,
int height)
Fills an ellipse bounded by the specified rectangle with the
current color.
|
static void |
FillRect(Graphics g,
int x1,
int y1,
int x2,
int y2)
Draws a filled rectangle with thickness 1 in the current color.
|
static void |
FillRect(Graphics g,
int x1,
int y1,
int x2,
int y2,
float thickness,
int cap)
Draws a filled rectangle with a given thickness in the current color.
|
static void |
FillRoundRect(Graphics g,
int x1,
int y1,
int x2,
int y2,
int xradius,
int yradius)
Fills a rounded corner rectangle in the current color.
|
static Area |
getCloudArea(int width,
int height)
Returns an Area for a cloud with given dimensions.
|
static Dimension |
GetSize(Image image)
Returns the size of the given Image.
|
static int[] |
GrabImage(Image image,
int width,
int height)
Grabs the pixels belonging to an off-screen image into an array.
|
static boolean |
InsideRoundRect(int x,
int y,
int x1,
int y1,
int x2,
int y2,
int xradius,
int yradius)
Tests for containment in a rounded rectangle, including its border.
|
static void |
XORDrawRect(Graphics g,
int x1,
int y1,
int x2,
int y2)
Draws a rectangle boundary with thickness 1 in the current color in
XOR mode.
|
public static Image CreateServerSideImage(int width, int height)
createGraphics()
to get a graphics context
for drawing into the image.
Note: The resulting image is initially filled with a background color, and will not be transparent.
width
- Must be greater than 0.height
- Must be greater than 0.public static Dimension GetSize(Image image)
Note that if the Image is not yet loaded, this method waits for the Image to be loaded and then returns its size.
image
- Image being queriedpublic static int[] GrabImage(Image image, int width, int height)
image
- a server side imagewidth
- must be > 0height
- must be > 0@Deprecated public static void DrawPoint(Graphics g, int x1, int y1)
java.awt.Graphics#drawLine
instead.public static void DrawLine(Graphics g, int x1, int y1, int x2, int y2)
public static void DrawLineClipX(Graphics g, int x1, int y1, int x2, int y2, int xmin, int xmax)
public static void DrawLineClipY(Graphics g, int x1, int y1, int x2, int y2, int ymin, int ymax)
public static void DrawRect(Graphics g, int x1, int y1, int x2, int y2)
public static void XORDrawRect(Graphics g, int x1, int y1, int x2, int y2)
g
- x1
- y1
- x2
- y2
- @Deprecated public static void _FillRect(Graphics g, int x1, int y1, int x2, int y2)
Graphics#fillRect
instead.public static void FillRect(Graphics g, int x1, int y1, int x2, int y2)
public static void DrawRect(Graphics g, int x1, int y1, int x2, int y2, float thickness, int cap)
public static void FillRect(Graphics g, int x1, int y1, int x2, int y2, float thickness, int cap)
public static void DrawRoundRect(Graphics g, int x1, int y1, int x2, int y2, int xradius, int yradius)
This method works around the JDK bug 4151279 for Graphics.drawRoundRect(int, int, int, int, int, int)
g
- The graphic context.x1
- Coordinate of the first corner defining the rectangle.y1
- Coordinate of the first corner defining the rectangle.x2
- Coordinate of the second corner defining the rectangle.y2
- Coordinate of the second corner defining the rectangle.xradius
- Radius of the corners on the x axis. Must be positive.yradius
- Radius of the corners on the y axis. Must be positive.public static void FillRoundRect(Graphics g, int x1, int y1, int x2, int y2, int xradius, int yradius)
Note: The border is not predictable. To have a predictable
border, call DrawRoundRect
with the same arguments afterwards
(in the same color, on in another color if you want).
g
- The graphic context.x1
- Coordinate of the first corner defining the rectangle.y1
- Coordinate of the first corner defining the rectangle.x2
- Coordinate of the second corner defining the rectangle.y2
- Coordinate of the second corner defining the rectangle.xradius
- Radius of the corners on the x axis. Must be positive.yradius
- Radius of the corners on the y axis. Must be positive.public static boolean InsideRoundRect(int x, int y, int x1, int y1, int x2, int y2, int xradius, int yradius)
x
- Coordinate of the point being tested.y
- Coordinate of the point being tested.x1
- Coordinate of the first corner defining the rectangle.y1
- Coordinate of the first corner defining the rectangle.x2
- Coordinate of the second corner defining the rectangle.y2
- Coordinate of the second corner defining the rectangle.xradius
- Radius of the corners on the x axis. Must be positive.yradius
- Radius of the corners on the y axis. Must be positive.public static void DrawEllipse(Graphics2D g, int x, int y, int width, int height)
x
, y
,
width
, and height
arguments.
The oval covers an area that is width
pixels wide
and height
pixels tall.
This method works around the JDK bug 4151279 for Graphics.drawOval(int, int, int, int)
g
- the graphic context.x
- the x coordinate of the upper left corner of
the oval to be drawn.y
- the y coordinate of the upper left corner of
the oval to be drawn.width
- the width of the oval to be drawn.height
- the height of the oval to be drawn.public static void FillEllipse(Graphics2D g, int x, int y, int width, int height)
This method works around the JDK bug 4151279 for Graphics.drawOval(int, int, int, int)
g
- the graphic context.x
- the x coordinate of the upper left corner
of the oval to be filled.y
- the y coordinate of the upper left corner
of the oval to be filled.width
- the width of the oval to be filled.height
- the height of the oval to be filled.public static void DrawCloud(Graphics2D g, int x, int y, int width, int height)
x
, y
,
width
, and height
arguments.
This method works around the JDK bug 4151279.
g
- the graphic context.x
- the x coordinate of the upper left corner of
the cloud to be drawn.y
- the y coordinate of the upper left corner of
the cloud to be drawn.width
- the width of the cloud to be drawn.height
- the height of the cloud to be drawn.public static void FillCloud(Graphics2D g, int x, int y, int width, int height)
This method works around the JDK bug 4151279
g
- the graphic context.x
- the x coordinate of the upper left corner
of the cloud to be filled.y
- the y coordinate of the upper left corner
of the cloud to be filled.width
- the width of the cloud to be filled.height
- the height of the cloud to be filled.public static Area getCloudArea(int width, int height)
width
- The width of the cloudheight
- The height of the cloudpublic static void DrawDiamond(Graphics g, int x1, int y1, int x2, int y2)
public static Image createImage(ImageProducer p)
p
- Image producer© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.