- Type Parameters:
T- the product type
- All Implemented Interfaces:
PathBuilder<T>
- Direct Known Subclasses:
AbstractPathDataBuilder,AffineTransformPathBuilder,AreaMetricsBuilder,AwtPathBuilder,BezierPathBuilder,BoundingBoxBuilder,ContourPathBuilder,FXPathElementsBuilder,FXPathPointsBuilder,FXPolygonBuilder,FXTransformPathBuilder,MarkerPathBuilder,NineRegionsScalingBuilder,PathIteratorPathBuilder,PlinePathBuilder,StartAndEndPointPathBuilder,StartAndEndPointsPathBuilder
- Author:
- Werner Randelshofer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidarcTo(double radiusX, double radiusY, double xAxisRotation, double x, double y, boolean largeArcFlag, boolean sweepFlag) Adds an elliptical arc to the path which goes to the specified end point using the specified parameters.final voidCloses the path by adding a straight line back to the lastPathBuilder.moveTo(java.awt.geom.Point2D)point.final voidcurveTo(double x1, double y1, double x2, double y2, double x, double y) Adds a cubic curve going to the specified end point coordinate using the specified control points.protected voiddoArcTo(double lastX, double lastY, double radiusX, double radiusY, double xAxisRotation, double x, double y, boolean largeArcFlag, boolean sweepFlag) protected abstract voiddoClosePath(double lastX, double lastY, double lastMoveToX, double lastMoveToY) protected abstract voiddoCurveTo(double lastX, double lastY, double x1, double y1, double x2, double y2, double x, double y) protected abstract voiddoLineTo(double lastX, double lastY, double x, double y) protected abstract voiddoMoveTo(double x, double y) protected abstract voidprotected abstract voiddoQuadTo(double lastX, double lastY, double x1, double y1, double x, double y) protected voiddoSmoothCurveTo(double lastX, double lastY, double x1, double y1, double x2, double y2, double x, double y) protected voiddoSmoothQuadTo(double lastX, double lastY, double x1, double y1, double x, double y) doubleGetter.doubleGetter.doubledoubleGetter.doublegetLastX()Getter.doublegetLastY()Getter.final voidlineTo(double x, double y) Adds a straight line to the path going to the specified end point.final voidmoveTo(double x, double y) Adds a point to the path by moving to the specified point coordinates.booleanvoidpathDone()Performs path processing after all the path segments have been added to the builder.final voidquadTo(double x1, double y1, double x, double y) Adds a quadratic curve going to the specified point coordinate using the specified control point.protected voidsetLastCX(double lastCX) protected voidsetLastCY(double lastCY) protected voidsetLastX(double lastX) protected voidsetLastY(double lastY) final voidsmoothCurveTo(double x2, double y2, double x, double y) Adds a smooth cubic curve going to the specified end point coordinate using the specified control point.final voidsmoothQuadTo(double x, double y) Adds a smooth quadratic curve going to the specified end point coordinate.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jhotdraw8.geom.PathBuilder
build, circle, counterClockwiseCircle, curveTo, lineTo, moveTo, quadTo, smoothCurveTo, smoothQuadTo
-
Constructor Details
-
AbstractPathBuilder
public AbstractPathBuilder()
-
-
Method Details
-
arcTo
public void arcTo(double radiusX, double radiusY, double xAxisRotation, double x, double y, boolean largeArcFlag, boolean sweepFlag) Description copied from interface:PathBuilderAdds an elliptical arc to the path which goes to the specified end point using the specified parameters.The elliptical arc is defined by two radii, an angle from the x-axis, a flag to choose the large arc or not, a flag to indicate if we increase or decrease the angles and the final point of the arc.
As specified in SVG elliptical arc commands.
The default implementation of this method has been derived from Apache Batik class org.apache.batik.ext.awt.geom.ExtendedGeneralPath#computArc. The default implementation decomposes the arc into cubic curve segments and invokes corresponding
curveTomethods.- Specified by:
arcToin interfacePathBuilder<T>- Parameters:
radiusX- the x radius of the ellipseradiusY- the y radius of the ellipsexAxisRotation- the angle from the x-axis of the current coordinate system to the x-axis of the ellipse in degrees.x- the x coordinate of the end pointy- the y coordinate of the end pointlargeArcFlag- the large arc flag. If true the arc spanning more than or equal to 180 degrees is chosen, otherwise the arc spanning less than 180 degrees is chosensweepFlag- the sweep flag. If true the line joining center to arc sweeps through decreasing angles otherwise it sweeps through increasing angles
-
closePath
public final void closePath()Description copied from interface:PathBuilderCloses the path by adding a straight line back to the lastPathBuilder.moveTo(java.awt.geom.Point2D)point.If the path is already closed, then this method has no effect.
- Specified by:
closePathin interfacePathBuilder<T>
-
curveTo
public final void curveTo(double x1, double y1, double x2, double y2, double x, double y) Description copied from interface:PathBuilderAdds a cubic curve going to the specified end point coordinate using the specified control points.- Specified by:
curveToin interfacePathBuilder<T>- Parameters:
x1- the x coordinate of control point 1y1- the y coordinate of control point 1x2- the x coordinate of control point 2y2- the y coordinate of control point 2x- the x coordinate of the end pointy- the y coordinate of the end point
-
doArcTo
protected void doArcTo(double lastX, double lastY, double radiusX, double radiusY, double xAxisRotation, double x, double y, boolean largeArcFlag, boolean sweepFlag) -
doClosePath
protected abstract void doClosePath(double lastX, double lastY, double lastMoveToX, double lastMoveToY) -
doPathDone
protected abstract void doPathDone() -
doCurveTo
protected abstract void doCurveTo(double lastX, double lastY, double x1, double y1, double x2, double y2, double x, double y) -
doLineTo
protected abstract void doLineTo(double lastX, double lastY, double x, double y) -
doMoveTo
protected abstract void doMoveTo(double x, double y) -
doQuadTo
protected abstract void doQuadTo(double lastX, double lastY, double x1, double y1, double x, double y) -
doSmoothCurveTo
protected void doSmoothCurveTo(double lastX, double lastY, double x1, double y1, double x2, double y2, double x, double y) -
doSmoothQuadTo
protected void doSmoothQuadTo(double lastX, double lastY, double x1, double y1, double x, double y) -
pathDone
public void pathDone()Description copied from interface:PathBuilderPerforms path processing after all the path segments have been added to the builder.- Specified by:
pathDonein interfacePathBuilder<T>
-
getLastPoint
Description copied from interface:PathBuilderGetter.- Specified by:
getLastPointin interfacePathBuilder<T>- Returns:
- the last end point.
-
getLastX
public double getLastX()Description copied from interface:PathBuilderGetter.- Specified by:
getLastXin interfacePathBuilder<T>- Returns:
- x coordinate of the last end point.
-
getLastY
public double getLastY()Description copied from interface:PathBuilderGetter.- Specified by:
getLastYin interfacePathBuilder<T>- Returns:
- y coordinate of the last control point.
-
getLastMoveToX
public double getLastMoveToX() -
getLastMoveToY
public double getLastMoveToY() -
getLastCX
public double getLastCX()Description copied from interface:PathBuilderGetter.- Specified by:
getLastCXin interfacePathBuilder<T>- Returns:
- x coordinate of the last control point.
-
getLastCY
public double getLastCY()Description copied from interface:PathBuilderGetter.- Specified by:
getLastCYin interfacePathBuilder<T>- Returns:
- y coordinate of the last control point.
-
lineTo
public final void lineTo(double x, double y) Description copied from interface:PathBuilderAdds a straight line to the path going to the specified end point.- Specified by:
lineToin interfacePathBuilder<T>- Parameters:
x- the x coordinate of the end pointy- the y coordinate of the end point
-
moveTo
public final void moveTo(double x, double y) Description copied from interface:PathBuilderAdds a point to the path by moving to the specified point coordinates.- Specified by:
moveToin interfacePathBuilder<T>- Parameters:
x- the x coordinate of the end pointy- the y coordinate of the end point
-
quadTo
public final void quadTo(double x1, double y1, double x, double y) Description copied from interface:PathBuilderAdds a quadratic curve going to the specified point coordinate using the specified control point.The default implementation of this method calls
PathBuilder.quadTo(double, double, double, double).- Specified by:
quadToin interfacePathBuilder<T>- Parameters:
x1- the x coordinate of the control pointy1- the y coordinate of the control pointx- the x coordinate of the end pointy- the y coordinate of the end point
-
smoothCurveTo
public final void smoothCurveTo(double x2, double y2, double x, double y) Description copied from interface:PathBuilderAdds a smooth cubic curve going to the specified end point coordinate using the specified control point.The coordinates of control point 1 is the coordinate of the last control point mirrored along the last end point.
- Specified by:
smoothCurveToin interfacePathBuilder<T>- Parameters:
x2- the x coordinate of control point 2y2- the y coordinate of control point 2x- the x coordinate of the end pointy- the y coordinate of the end point
-
smoothQuadTo
public final void smoothQuadTo(double x, double y) Description copied from interface:PathBuilderAdds a smooth quadratic curve going to the specified end point coordinate.The coordinates of the control point is the coordinate of the last control point mirrored along the last end point.
- Specified by:
smoothQuadToin interfacePathBuilder<T>- Parameters:
x- the x coordinate of the end pointy- the y coordinate of the end point
-
setLastX
protected void setLastX(double lastX) -
setLastY
protected void setLastY(double lastY) -
setLastCX
protected void setLastCX(double lastCX) -
setLastCY
protected void setLastCY(double lastCY) -
needsMoveTo
public boolean needsMoveTo()- Specified by:
needsMoveToin interfacePathBuilder<T>
-