All Packages Class Hierarchy This Package Previous Next Index
Class cynosurex.graphics2D.DrawRoutines
java.lang.Object
|
+----cynosurex.graphics2D.DrawRoutines
- public class DrawRoutines
- extends Object
The drawRoutines
class contains several useful drawing
primitives. It cannot be instantiated.
-
draw3DCircle(Graphics, int, int, int, boolean)
- Draws a 3D circle of radius r at location (x,y)
-
draw3DRect(Graphics, int, int, int, int, boolean, int)
- Draws a 3D rectangle in the specified location
with the given line thickness.
-
drawArc(Graphics, int, int, int, int, int, int, int)
- Draws an arc with the specified pen width.
-
drawArc(Graphics, Point, double, double, double, double, double)
- Draws an arc on the specified Graphics object.
-
drawCircle(Graphics, int, int, int)
-
Draws a circle on the Graphics object.
-
drawCircle(Graphics, int, int, int, int)
- Draws a circle of radius r at location (x,y) with
the specified line width.
-
drawEllipse(Graphics, Point, double, double, double)
- Draws an ellipse on the specified Graphics object.
-
drawEllipse(Graphics, Point, double, double, double, boolean)
- Draws an ellipse on the specified Graphics object.
-
drawLine(Graphics, int, int, int, int, int)
- Draws a line using the specified pen thickness.
-
drawOval(Graphics, int, int, int, int, int)
- Draws an oval in the specified bounding rectangle
with the specified pen thickness.
-
drawRect(Graphics, int, int, int, int, int)
- Draws a rectangle at the specified location
with the supplied pen thickness.
-
drawRoundRect(Graphics, int, int, int, int, int, int, int)
- Draws a rounded rectangle at the specified
location with the supplied pen thickness.
-
fillCircle(Graphics, int, int, int)
- Draws a filled circle.
-
fillEllipse(Graphics, Point, double, double, double)
- Draws a solid ellipse on the specified Graphics object.
draw3DRect
public static void draw3DRect(Graphics g,
int left,
int top,
int width,
int height,
boolean isRaised,
int lineWidth)
- Draws a 3D rectangle in the specified location
with the given line thickness.
- Parameters:
- g - The Graphics object.
- left - Center of left side edge.
- top - Center of the top edge.
- width - Distance from center of L side to
center of R side.
- height - Distance from center of top side to
center of bottom side.
- isRaised - A boolean variable that determines
if the right and bottom sides are
shaded to try to make the rectangle
look like it is higher than
background (true) or lower (false).
Works best with relatively thin
lines and gray colors.
- lineWidth - The pen thickness.
drawArc
public static void drawArc(Graphics g,
int x,
int y,
int width,
int height,
int startAngle,
int arcAngle,
int lineWidth)
- Draws an arc with the specified pen width. Note
that the rectangle specified falls in the
middle of the thick line (half inside it,
half outside).
- Parameters:
- g - The Graphics object.
- x - The left side of the bounding rectangle
- y - The top of the bounding rectangle
- width - The width of the bounding rectangle
- height - The height of the bounding rectangle
- startAngle - The beginning angle
in degrees. 0 is 3
o'clock, increasing
counterclockwise.
- arcAngle - The sweep angle in degrees
(going counterclockwise).
- lineWidth - The pen width (thickness of
line drawn).
drawCircle
public static void drawCircle(Graphics g,
int x,
int y,
int r)
- Draws a circle on the Graphics object.
- Parameters:
- g - The Graphics object.
- x - The x-coordinate of the center of the circle.
- y - The y-coordinate of the center of the circle.
- r - The radius of the circle.
drawCircle
public static void drawCircle(Graphics g,
int x,
int y,
int radius,
int lineWidth)
- Draws a circle of radius r at location (x,y) with
the specified line width.
- Parameters:
- g - The Graphics object.
- x - The x-coordinate of the center of the circle.
- y - The y-coordinate of the center of the circle.
- radius - The radius of the circle. (From center of the
circle to the center of the ring.)
- lineWidth - Pen thickness of circle drawn.
draw3DCircle
public static void draw3DCircle(Graphics g,
int x,
int y,
int radius,
boolean raised)
- Draws a 3D circle of radius r at location (x,y)
- Parameters:
- g - The Graphics object.
- x - The x-coordinate of the center of the circle.
- y - The y-coordinate of the center of the circle.
- radius - The radius of the circle. (From center of the
circle to the center of the ring.)
- raised - True for raised circle.
fillCircle
public static void fillCircle(Graphics g,
int x,
int y,
int radius)
- Draws a filled circle.
- Parameters:
- g - The Graphics object.
- x - The x-coordinate of the center of the
circle.
- y - The y-coordinate of the center of the
circle.
- radius - The radius of the circle.
drawArc
public static void drawArc(Graphics g,
Point center,
double major,
double minor,
double startAngle,
double sweepAngle,
double rotateAngle)
- Draws an arc on the specified Graphics object.
- Parameters:
- point - specifies the center of the arc
- major - specifies the length of the major axis.
- minor - specifies the length of the minor axis.
- startAngle - specifies the start angle (radian)
- sweepAngle - specifies the sweep angle (radian)
- rotateAngle - specifies the rotation angle (radian)
drawEllipse
public static void drawEllipse(Graphics g,
Point center,
double major,
double minor,
double angle)
- Draws an ellipse on the specified Graphics object.
- Parameters:
- point - specifies the center of the ellipse
- major - specifies the length of the major axis.
- minor - specifies the length of the minor axis.
- angle - specifies the angle (radian) of the rotation
fillEllipse
public static void fillEllipse(Graphics g,
Point center,
double major,
double minor,
double angle)
- Draws a solid ellipse on the specified Graphics object.
- Parameters:
- point - specifies the center of the ellipse
- major - specifies the length of the major axis.
- minor - specifies the length of the minor axis.
- angle - specifies the angle (radian) of the rotation
drawEllipse
public static void drawEllipse(Graphics g,
Point center,
double major,
double minor,
double angle,
boolean fill)
- Draws an ellipse on the specified Graphics object.
- Parameters:
- point - specifies the center of the ellipse
- major - specifies the length of the major axis.
- minor - specifies the length of the minor axis.
- angle - specifies the angle (radian) of the rotation
- fill - specifies whether the ellipse if solid
drawLine
public static void drawLine(Graphics g,
int x1,
int y1,
int x2,
int y2,
int lineWidth)
- Draws a line using the specified pen thickness.
- Parameters:
- g - The Graphics object.
- x1 - x-position of start of line.
- y1 - y-position of start of line.
- x2 - x-position of end of line.
- y2 - y-position of end of line.
- lineWidth - Thickness of line drawn.
drawOval
public static void drawOval(Graphics g,
int x,
int y,
int width,
int height,
int lineWidth)
- Draws an oval in the specified bounding rectangle
with the specified pen thickness.
- Parameters:
- g - The Graphics object.
- x - The left side of the bounding rectangle.
- y - The y-coordinate of the top of the
bounding rectangle.
- width - The width of the bounding rectangle.
- height - The height of the bounding rectangle.
- lineWidth - The pen thickness.
drawRect
public static void drawRect(Graphics g,
int left,
int top,
int width,
int height,
int lineWidth)
- Draws a rectangle at the specified location
with the supplied pen thickness.
- Parameters:
- g - The Graphics object.
- left - Center of left side edge.
- top - Center of the top edge.
- width - Distance from center of L side to
center of R side.
- height - Distance from center of top side to
center of bottom side.
- lineWidth - Pen thickness.
drawRoundRect
public static void drawRoundRect(Graphics g,
int left,
int top,
int width,
int height,
int arcWidth,
int arcHeight,
int lineWidth)
- Draws a rounded rectangle at the specified
location with the supplied pen thickness.
- Parameters:
- g - The Graphics object.
- left - Center of left side edge.
- top - Center of the top edge.
- width - Distance from center of L side to
center of R side.
- height - Distance from center of top side to
center of bottom side.
- arcWidth - Horizontal diameter of arc at
corners.
- arcHeight - Vertical diameter of arc at
corners.
- lineWidth - Pen thickness.
All Packages Class Hierarchy This Package Previous Next Index