Class cynosurex.graphics2D.DrawRoutines
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.

Method Index

 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 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, int, int, double, double, double)
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.

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 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 drawEllipse
  public static void drawEllipse(Graphics g,
                                 int x,
                                 int y,
                                 double primary,
                                 double secondary,
                                 double angle)
Draws an ellipse on the specified Graphics object.
Parameters:
x - specifies the x-coordinate of the center of the ellipse
y - specifies the y-coordinate of the center of the ellipse
primary - specifies the length of the major axis. The primary axis is not necessarily the longest axis, but rather is the axis whose orientation is specified by the rotation angle.
secondary - specifies the length of the minor axis
angle - specifies the angle of the rotation
 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