|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcynosurex.graphics2D.DrawRoutines
public class DrawRoutines
The drawRoutines
class contains several useful drawing
primitives. It cannot be instantiated.
Field Summary |
---|
Fields inherited from interface cynosurex.internal.CommonInterface |
---|
copyright, copyrightYears, notice, program, version |
Fields inherited from interface cynosurex.internal.AuthorCommon |
---|
author, copyrightSymbol, noticeMsg, rights |
Fields inherited from interface cynosurex.internal.CompanyCommon |
---|
company, email, website |
Method Summary | |
---|---|
static void |
draw3DCircle(java.awt.Graphics g,
int x,
int y,
int radius,
boolean raised)
Draws a 3D circle of radius r at location (x,y) |
static void |
draw3DRect(java.awt.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. |
static void |
drawArc(java.awt.Graphics g,
int x,
int y,
int width,
int height,
int startAngle,
int arcAngle,
int lineWidth)
Draws an arc with the specified pen width. |
static void |
drawArc(java.awt.Graphics g,
java.awt.Point center,
double major,
double minor,
double startAngle,
double sweepAngle,
double rotateAngle)
Draws an arc on the specified Graphics object. |
static void |
drawCircle(java.awt.Graphics g,
int x,
int y,
int r)
Draws a circle on the Graphics object. |
static void |
drawCircle(java.awt.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. |
static void |
drawEllipse(java.awt.Graphics g,
java.awt.Point center,
double major,
double minor,
double angle)
Draws an ellipse on the specified Graphics object. |
static void |
drawEllipse(java.awt.Graphics g,
java.awt.Point center,
double major,
double minor,
double angle,
boolean fill)
Draws an ellipse on the specified Graphics object. |
static void |
drawLine(java.awt.Graphics g,
int x1,
int y1,
int x2,
int y2,
int lineWidth)
Draws a line using the specified pen thickness. |
static void |
drawOval(java.awt.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. |
static void |
drawRect(java.awt.Graphics g,
int left,
int top,
int width,
int height,
int lineWidth)
Draws a rectangle at the specified location with the supplied pen thickness. |
static void |
drawRoundRect(java.awt.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. |
static void |
fillCircle(java.awt.Graphics g,
int x,
int y,
int radius)
Draws a filled circle. |
static void |
fillEllipse(java.awt.Graphics g,
java.awt.Point center,
double major,
double minor,
double angle)
Draws a solid ellipse on the specified Graphics object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void draw3DRect(java.awt.Graphics g, int left, int top, int width, int height, boolean isRaised, int lineWidth)
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.public static void drawArc(java.awt.Graphics g, int x, int y, int width, int height, int startAngle, int arcAngle, int lineWidth)
g
- The Graphics object.x
- The left side of the bounding rectangley
- The top of the bounding rectanglewidth
- The width of the bounding rectangleheight
- The height of the bounding rectanglestartAngle
- 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).public static void drawCircle(java.awt.Graphics g, int x, int y, int r)
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.public static void drawCircle(java.awt.Graphics g, int x, int y, int radius, int lineWidth)
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.public static void draw3DCircle(java.awt.Graphics g, int x, int y, int radius, boolean raised)
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.public static void fillCircle(java.awt.Graphics g, int x, int y, int radius)
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.public static void drawArc(java.awt.Graphics g, java.awt.Point center, double major, double minor, double startAngle, double sweepAngle, double rotateAngle)
g
- the Graphics objectcenter
- specifies the center of the arcmajor
- 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)public static void drawEllipse(java.awt.Graphics g, java.awt.Point center, double major, double minor, double angle)
g
- the graphics objectcenter
- specifies the center of the ellipsemajor
- specifies the length of the major axis.minor
- specifies the length of the minor axis.angle
- specifies the angle (radian) of the rotationpublic static void fillEllipse(java.awt.Graphics g, java.awt.Point center, double major, double minor, double angle)
g
- the Graphics objectcenter
- specifies the center of the ellipsemajor
- specifies the length of the major axis.minor
- specifies the length of the minor axis.angle
- specifies the angle (radian) of the rotationpublic static void drawEllipse(java.awt.Graphics g, java.awt.Point center, double major, double minor, double angle, boolean fill)
g
- the Graphics objectcenter
- specifies the center of the ellipsemajor
- specifies the length of the major axis.minor
- specifies the length of the minor axis.angle
- specifies the angle (radian) of the rotationfill
- specifies whether the ellipse if solidpublic static void drawLine(java.awt.Graphics g, int x1, int y1, int x2, int y2, int lineWidth)
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.public static void drawOval(java.awt.Graphics g, int x, int y, int width, int height, int lineWidth)
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.public static void drawRect(java.awt.Graphics g, int left, int top, int width, int height, int lineWidth)
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.public static void drawRoundRect(java.awt.Graphics g, int left, int top, int width, int height, int arcWidth, int arcHeight, int lineWidth)
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |