All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cynosurex.graphics2D.DrawRoutines

java.lang.Object
   |
   +----cynosurex.graphics2D.DrawRoutines

public class DrawRoutines
extends Object
implements CommonInterface
The drawRoutines class contains several useful drawing primitives. It cannot be instantiated.


Method Index

 o draw3DCircle(Graphics, int, int, int, boolean)
Draws a 3D circle of radius r at location (x,y)
 o draw3DRect(Graphics, int, int, int, int, boolean, int)
Draws a 3D rectangle in the specified location with the given line thickness.
 o drawArc(Graphics, int, int, int, int, int, int, int)
Draws an arc with the specified pen width.
 o drawArc(Graphics, Point, double, double, double, double, double)
Draws an arc on the specified Graphics object.
 o drawCircle(Graphics, int, int, int)
Draws a circle on the Graphics object.
 o drawCircle(Graphics, int, int, int, int)
Draws a circle of radius r at location (x,y) with the specified line width.
 o drawEllipse(Graphics, Point, double, double, double)
Draws an ellipse on the specified Graphics object.
 o drawEllipse(Graphics, Point, double, double, double, boolean)
Draws an ellipse on the specified Graphics object.
 o drawLine(Graphics, int, int, int, int, int)
Draws a line using the specified pen thickness.
 o drawOval(Graphics, int, int, int, int, int)
Draws an oval in the specified bounding rectangle with the specified pen thickness.
 o drawRect(Graphics, int, int, int, int, int)
Draws a rectangle at the specified location with the supplied pen thickness.
 o drawRoundRect(Graphics, int, int, int, int, int, int, int)
Draws a rounded rectangle at the specified location with the supplied pen thickness.
 o fillCircle(Graphics, int, int, int)
Draws a filled circle.
 o fillEllipse(Graphics, Point, double, double, double)
Draws a solid ellipse on the specified Graphics object.

Methods

 o 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.
 o 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).
 o 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.
 o 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.
 o 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.
 o 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.
 o 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)
 o 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
 o 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
 o 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
 o 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.
 o 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.
 o 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.
 o 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