|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectscenic.path.PathBuilder
public class PathBuilder
This class offers a convenient interface for creating paths.
| Constructor Summary | |
|---|---|
PathBuilder()
Creates a new PathBuilder object. |
|
| Method Summary | |
|---|---|
void |
addSegment(Segment s)
Adds a segment to the current subpath. |
void |
arc(double x,
double y,
double xRadius,
double yRadius,
double rotation,
double startAngle,
double stopAngle)
Draws an elliptic arc starting from the given position. |
void |
arcTo(double xRadius,
double yRadius,
double rotation,
double startAngle,
double stopAngle)
Draws an elliptic arc starting from the current position. |
void |
close()
Closes the current subpath. |
Path |
createPath()
Creates a Path object that contains the created path. |
void |
curveTo(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2)
Draws a quadratic Bezier-curve using the given control points. |
void |
curveTo(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2,
java.awt.geom.Point2D p3)
Draws a cubic Bezier-curve using the given control points. |
SubPath[] |
getSubPaths()
Get the subpaths as an array. |
void |
lineTo(double x,
double y)
Draws a straight line to the given position. |
void |
moveTo(double x,
double y)
Begins a new subpath from the given position. |
void |
rectangle(double x,
double y,
double width,
double height)
Draws a rectangle. |
void |
roundedRectangle(double x,
double y,
double width,
double height,
double radius)
Draws a rectangle with rounded edges. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PathBuilder()
| Method Detail |
|---|
public void moveTo(double x,
double y)
public void lineTo(double x,
double y)
public void curveTo(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2)
p1 - the second control point.p2 - the third control point.
public void curveTo(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2,
java.awt.geom.Point2D p3)
p1 - the second control point.p2 - the third control point.p3 - the fourth control point.
public void arcTo(double xRadius,
double yRadius,
double rotation,
double startAngle,
double stopAngle)
xRadius - the x radius of the ellipse.yRadius - the y radius of the ellipse.rotation - the rotation of the ellipse in degrees.startAngle - the start angle of the arc in degrees.stopAngle - the stop angle of the arc in degrees.
public void arc(double x,
double y,
double xRadius,
double yRadius,
double rotation,
double startAngle,
double stopAngle)
x - the x-coordinate of the starting point of the arc.y - the y-coordinate of the starting point of the arc.xRadius - the x radius of the ellipse.yRadius - the y radius of the ellipse.rotation - the rotation of the ellipse in degrees.startAngle - the start angle of the arc in degrees.stopAngle - the stop angle of the arc in degrees.
public void rectangle(double x,
double y,
double width,
double height)
x - the left side of the rectangle.y - the top of the rectangle.width - the width of the rectangle.height - the height of the rectangle.
public void roundedRectangle(double x,
double y,
double width,
double height,
double radius)
x - the left side of the rectangle.y - the top of the rectangle.width - the width of the rectangle.height - the height of the rectangle.radius - the radius of the rounded edges.public void addSegment(Segment s)
s - the segment to be added.public void close()
public Path createPath()
public SubPath[] getSubPaths()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||