public abstract class PPath extends PShape
Modifier and Type | Class and Description |
---|---|
static class |
PPath.Double
Path node with coordinates stored in double precision floating point.
|
static class |
PPath.Float
Path node with coordinates stored in single precision floating point.
|
PNode.PSceneGraphDelegate
DEFAULT_PAINT, DEFAULT_STROKE, DEFAULT_STROKE_PAINT
FILL_STRATEGY_ASPECT_COVER, FILL_STRATEGY_ASPECT_FIT, FILL_STRATEGY_EXACT_FIT, PROPERTY_BOUNDS, PROPERTY_CHILDREN, PROPERTY_CHILDREN_PICKABLE, PROPERTY_CLIENT_PROPERTIES, PROPERTY_CODE_BOUNDS, PROPERTY_CODE_CHILDREN, PROPERTY_CODE_CHILDREN_PICKABLE, PROPERTY_CODE_CLIENT_PROPERTIES, PROPERTY_CODE_FULL_BOUNDS, PROPERTY_CODE_PAINT, PROPERTY_CODE_PARENT, PROPERTY_CODE_PICKABLE, PROPERTY_CODE_TRANSFORM, PROPERTY_CODE_TRANSPARENCY, PROPERTY_CODE_VISIBLE, PROPERTY_FULL_BOUNDS, PROPERTY_PAINT, PROPERTY_PARENT, PROPERTY_PICKABLE, PROPERTY_TRANSFORM, PROPERTY_TRANSPARENCY, PROPERTY_VISIBLE, SCENE_GRAPH_DELEGATE
NO_SUCH_PAGE, PAGE_EXISTS
Modifier and Type | Method and Description |
---|---|
void |
append(PathIterator pathIterator,
boolean connect)
Append the geometry of the specified path iterator to this path node, possibly
connecting the new geometry to the existing path segments with a line segment.
|
void |
append(Shape shape,
boolean connect)
Append the geometry of the specified shape to this path node, possibly
connecting the new geometry to the existing path segments with a line
segment.
|
void |
closePath()
Close the current subpath by drawing a straight line back to the coordinates
of the last
moveTo . |
static PPath |
createArc(double x,
double y,
double width,
double height,
double start,
double extent,
int type)
Create and return a new path node with the specified arc in double
precision floating point coordinates.
|
static PPath |
createArc(float x,
float y,
float width,
float height,
float start,
float extent,
int type)
Create and return a new path node with the specified arc in single
precision floating point coordinates.
|
static PPath |
createCubicCurve(double x1,
double y1,
double ctrlx1,
double ctrly1,
double ctrlx2,
double ctrly2,
double x2,
double y2)
Create and return a new path node with the specified cubic curve in double
precision floating point coordinates.
|
static PPath |
createCubicCurve(float x1,
float y1,
float ctrlx1,
float ctrly1,
float ctrlx2,
float ctrly2,
float x2,
float y2)
Create and return a new path node with the specified cubic curve in single
precision floating point coordinates.
|
static PPath |
createEllipse(double x,
double y,
double width,
double height)
Create and return a new path node with the specified ellipse in double
precision floating point coordinates.
|
static PPath |
createEllipse(float x,
float y,
float width,
float height)
Create and return a new path node with the specified ellipse in single
precision floating point coordinates.
|
static PPath |
createLine(double x1,
double y1,
double x2,
double y2)
Create and return a new path node with the specified line in double
precision floating point coordinates.
|
static PPath |
createLine(float x1,
float y1,
float x2,
float y2)
Create and return a new path node with the specified line in single
precision floating point coordinates.
|
static PPath |
createQuadCurve(double x1,
double y1,
double ctrlx,
double ctrly,
double x2,
double y2)
Create and return a new path node with the specified quadratic curve in double
precision floating point coordinates.
|
static PPath |
createQuadCurve(float x1,
float y1,
float ctrlx,
float ctrly,
float x2,
float y2)
Create and return a new path node with the specified quadratic curve in single
precision floating point coordinates.
|
static PPath |
createRectangle(double x,
double y,
double width,
double height)
Create and return a new path node with the specified rectangle in double
precision floating point coordinates.
|
static PPath |
createRectangle(float x,
float y,
float width,
float height)
Create and return a new path node with the specified rectangle in single
precision floating point coordinates.
|
static PPath |
createRoundRectangle(double x,
double y,
double width,
double height,
double arcWidth,
double arcHeight)
Create and return a new path node with the specified round rectangle in double
precision floating point coordinates.
|
static PPath |
createRoundRectangle(float x,
float y,
float width,
float height,
float arcWidth,
float arcHeight)
Create and return a new path node with the specified round rectangle in single
precision floating point coordinates.
|
void |
curveTo(double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
Add a curved segment, defined by three new points, to this path node by drawing
a Bézier curve that intersects both the current coordinates and the specified
coordinates
(x3,y3) , using the specified points (x1,y1)
and (x2,y2) as Bézier control points. |
Path2D |
getPath()
Return a copy of the path backing this path node.
|
Path2D |
getPathReference()
Return the path backing this node.
|
protected Shape |
getShape()
Return the shape for this shape node.
|
void |
lineTo(double x,
double y)
Add a point to this path node by drawing a straight line from the
current coordinates to the new specified coordinates specified in double precision.
|
void |
moveTo(double x,
double y)
Add a point to this path node by moving to the specified coordinates
specified in double precision.
|
void |
quadTo(double x1,
double y1,
double x2,
double y2)
Add a curved segment, defined by two new points, to this path node by
drawing a Quadratic curve that intersects both the current coordinates and
the specified coordinates
(x2,y2) , using the specified point
(x1,y1) as a quadratic parametric control point. |
void |
reset()
Reset the geometry for this path node to empty.
|
protected void |
transform(AffineTransform transform)
Apply the specified transform to the shape for this shape node.
|
getBoundsWithStroke, getStroke, getStrokePaint, internalUpdateBounds, intersects, paint, setStroke, setStrokePaint, updateBoundsFromShape
addActivity, addAttribute, addChild, addChild, addChildren, addInputEventListener, addPropertyChangeListener, addPropertyChangeListener, animateToBounds, animateToColor, animateToPositionScaleRotation, animateToRelativePosition, animateToTransform, animateToTransparency, animateTransformToBounds, centerBoundsOnPoint, centerFullBoundsOnPoint, clone, computeFullBounds, endResizeBounds, findIntersectingNodes, fireChildPropertyChange, firePropertyChange, fullIntersects, fullPaint, fullPick, getAllNodes, getAllNodes, getAttribute, getAttribute, getBooleanAttribute, getBounds, getBoundsChanged, getBoundsReference, getBoundsVolatile, getChild, getChildBoundsInvalid, getChildBoundsVolatile, getChildPaintInvalid, getChildrenCount, getChildrenIterator, getChildrenPickable, getChildrenReference, getClientProperties, getClientPropertyKeysEnumeration, getDoubleAttribute, getFullBounds, getFullBoundsInvalid, getFullBoundsReference, getGlobalBounds, getGlobalFullBounds, getGlobalRotation, getGlobalScale, getGlobalToLocalTransform, getGlobalTranslation, getHeight, getInputEventListeners, getIntegerAttribute, getInverseTransform, getListenerList, getLocalToGlobalTransform, getName, getOccluded, getOffset, getPaint, getPaintInvalid, getParent, getPickable, getPropertyChangeParentMask, getRoot, getRotation, getScale, getTransform, getTransformReference, getTransparency, getUnionOfChildrenBounds, getVisible, getWidth, getX, getXOffset, getY, getYOffset, globalToLocal, globalToLocal, globalToLocal, indexOfChild, invalidateFullBounds, invalidateLayout, invalidatePaint, isAncestorOf, isDescendentOf, isDescendentOfRoot, isOpaque, layoutChildren, lerp, localToGlobal, localToGlobal, localToGlobal, localToParent, localToParent, localToParent, lower, lower, lowerBelow, lowerToBottom, lowerToBottom, offset, paintAfterChildren, parentBoundsChanged, parentToLocal, parentToLocal, parentToLocal, pick, pickAfterChildren, print, print, raise, raise, raiseAbove, raiseToTop, raiseToTop, removeAllChildren, removeChild, removeChild, removeChildren, removeFromParent, removeInputEventListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaintFrom, reparent, replaceWith, resetBounds, rotate, rotateAboutPoint, rotateAboutPoint, rotateInPlace, scale, scaleAboutPoint, scaleAboutPoint, setBounds, setBounds, setBoundsChanged, setChildBoundsInvalid, setChildBoundsVolatile, setChildPaintInvalid, setChildrenPickable, setFullBoundsInvalid, setGlobalRotation, setGlobalScale, setGlobalTranslation, setHeight, setName, setOccluded, setOffset, setOffset, setPaint, setPaintInvalid, setParent, setPickable, setPropertyChangeParentMask, setRotation, setScale, setTransform, setTransparency, setVisible, setWidth, setX, setY, signalBoundsChanged, startResizeBounds, toImage, toImage, toImage, toImage, transformBy, translate, validateFullBounds, validateFullPaint
public static final PPath createArc(float x, float y, float width, float height, float start, float extent, int type)
x
- x coordinate of the upper-left corner of the arc's framing rectangley
- y coordinate of the upper-left corner of the arc's framing rectanglewidth
- width of the full ellipse of which this arc is a partial sectionheight
- height of the full ellipse of which this arc is a partial sectionstart
- starting angle of the arc in degreesextent
- angular extent of the arc in degreestype
- closure type for the arc, one of Arc2D.OPEN
, Arc2D.CHORD
,
or Arc2D.PIE
public static final PPath createCubicCurve(float x1, float y1, float ctrlx1, float ctrly1, float ctrlx2, float ctrly2, float x2, float y2)
x1
- x coordinate of the start pointy1
- y coordinate of the start pointctrlx1
- x coordinate of the first control pointctrly1
- y coordinate of the first control pointctrlx2
- x coordinate of the second control pointctrly2
- y coordinate of the second control pointx2
- x coordinate of the end pointy2
- y coordinate of the end pointpublic static final PPath createEllipse(float x, float y, float width, float height)
x
- x coordinatey
- y coordinatewidth
- widthheight
- heightpublic static final PPath createLine(float x1, float y1, float x2, float y2)
x1
- x coordinate of the start pointy1
- y coordinate of the start pointx2
- x coordinate of the end pointy2
- y coordinate of the end pointpublic static final PPath createQuadCurve(float x1, float y1, float ctrlx, float ctrly, float x2, float y2)
x1
- x coordinate of the start pointy1
- y coordinate of the start pointctrlx
- x coordinate of the control pointctrly
- y coordinate of the control pointx2
- x coordinate of the end pointy2
- y coordinate of the end pointpublic static final PPath createRectangle(float x, float y, float width, float height)
x
- x coordinatey
- y coordinatewidth
- widthheight
- heightpublic static final PPath createRoundRectangle(float x, float y, float width, float height, float arcWidth, float arcHeight)
x
- x coordinatey
- y coordinatewidth
- widthheight
- heightarcWidth
- width of the arc that rounds off the cornersarcHeight
- height of the arc that rounds off the cornerspublic static final PPath createArc(double x, double y, double width, double height, double start, double extent, int type)
x
- x coordinate of the upper-left corner of the arc's framing rectangley
- y coordinate of the upper-left corner of the arc's framing rectanglewidth
- width of the full ellipse of which this arc is a partial sectionheight
- height of the full ellipse of which this arc is a partial sectionstart
- starting angle of the arc in degreesextent
- angular extent of the arc in degreestype
- closure type for the arc, one of Arc2D.OPEN
, Arc2D.CHORD
,
or Arc2D.PIE
public static final PPath createCubicCurve(double x1, double y1, double ctrlx1, double ctrly1, double ctrlx2, double ctrly2, double x2, double y2)
x1
- x coordinate of the start pointy1
- y coordinate of the start pointctrlx1
- x coordinate of the first control pointctrly1
- y coordinate of the first control pointctrlx2
- x coordinate of the second control pointctrly2
- y coordinate of the second control pointx2
- x coordinate of the end pointy2
- y coordinate of the end pointpublic static final PPath createEllipse(double x, double y, double width, double height)
x
- x coordinatey
- y coordinatewidth
- widthheight
- heightpublic static final PPath createLine(double x1, double y1, double x2, double y2)
x1
- x coordinate of the start pointy1
- y coordinate of the start pointx2
- x coordinate of the end pointy2
- y coordinate of the end pointpublic static final PPath createQuadCurve(double x1, double y1, double ctrlx, double ctrly, double x2, double y2)
x1
- x coordinate of the start pointy1
- y coordinate of the start pointctrlx
- x coordinate of the control pointctrly
- y coordinate of the control pointx2
- x coordinate of the end pointy2
- y coordinate of the end pointpublic static final PPath createRectangle(double x, double y, double width, double height)
x
- x coordinatey
- y coordinatewidth
- widthheight
- heightpublic static final PPath createRoundRectangle(double x, double y, double width, double height, double arcWidth, double arcHeight)
x
- x coordinatey
- y coordinatewidth
- widthheight
- heightarcWidth
- width of the arc that rounds off the cornersarcHeight
- height of the arc that rounds off the cornerspublic final Path2D getPath()
public final Path2D getPathReference()
path
property change listeners will not be notified.public final void append(Shape shape, boolean connect)
moveTo
in the geometry of the appended shape is turned into
a lineTo
segment. If the destination coordinates of such a connecting
lineTo
segment match the ending coordinates of a currently open subpath
then the segment is omitted as superfluous. The winding rule of the specified
shape is ignored and the appended geometry is governed by the winding
rule specified for this path node.shape
- shape to append to this path nodeconnect
- true to turn an initial moveTo
segment into a
lineTo
segment to connect the new geometry to the existing pathpublic final void append(PathIterator pathIterator, boolean connect)
moveTo
in the geometry of the appended path iterator is turned into a lineTo
segment.
If the destination coordinates of such a connecting lineTo
segment match
the ending coordinates of a currently open subpath then the segment is omitted
as superfluous.pathIterator
- path iterator to append to this path nodeconnect
- true to turn an initial moveTo
segment into a
lineTo
segment to connect the new geometry to the existing pathpublic final void curveTo(double x1, double y1, double x2, double y2, double x3, double y3)
(x3,y3)
, using the specified points (x1,y1)
and (x2,y2)
as Bézier control points. All coordinates are specified in
double precision.x1
- x coordinate of the first Bézier control pointy1
- y coordinate of the first Bézier control pointx2
- x coordinate of the second Bézier control pointy2
- y coordinate of the second Bézier control pointx3
- x coordinate of the final end pointy3
- y coordinate of the final end pointpublic final void lineTo(double x, double y)
x
- x coordinatey
- y coordinatepublic final void moveTo(double x, double y)
x
- x coordinatey
- y coordinatepublic final void quadTo(double x1, double y1, double x2, double y2)
(x2,y2)
, using the specified point
(x1,y1)
as a quadratic parametric control point. All coordinates
are specified in double precision.x1
- x coordinate of the quadratic control pointy1
- y coordinate of the quadratic control pointx2
- x coordinate of the final end pointy2
- y coordinate of the final end pointpublic final void reset()
public final void closePath()
moveTo
. If the path is already closed then this method
has no effect.protected final Shape getShape()
protected final void transform(AffineTransform transform)
Copyright © 1995-2013 Piccolo2D. All Rights Reserved.