public class CPolyLine extends CShape
Canvas
. If filled, the fill
paint is used to paint the interior. If outlined, the outline paint and
stroke are used to draw the boundary. The shape is build using path operators
such as lineTo
.Constructor and Description |
---|
CPolyLine()
Builds an empty CPolyLine.
|
CPolyLine(double x,
double y)
Builds a CPolyLine with an initial point (x, y).
|
CPolyLine(java.awt.geom.Point2D pt)
Builds a CPolyLine with an initial point pt.
|
Modifier and Type | Method and Description |
---|---|
CPolyLine |
arcTo(double start,
double extent,
double rx,
double ry)
Adds an arc segment to this polyline.
|
CPolyLine |
close()
Closes this polyLine by drawing a straight line from the current point to
the starting point.
|
CShape |
copyTo(CShape sms)
Copies this shape into a destination shape.
|
CPolyLine |
curveTo(double ctrlx1,
double ctrly1,
double ctrlx2,
double ctrly2,
double xEnd,
double yEnd)
Adds a cubic curve segment to this polyline.
|
CPolyLine |
curveTo(java.awt.geom.Point2D ptCtrl1,
java.awt.geom.Point2D ptCtrl2,
java.awt.geom.Point2D ptEnd)
Adds a cubic curve segment to this polyline.
|
CShape |
duplicate()
Creates a new copy of this shape and returns it.
|
CShape |
fixReferenceShapeToCurrent()
This method can be useful before changing the parent of a shape while keeping
its transformation that can be inherited from its current parent.
|
CPolyLine |
getArrow(double extent,
double sizeArrow)
Builds an arrow to end the current segment of this polyline.
|
java.awt.geom.Point2D |
getCurrentPoint() |
double |
getStartX() |
double |
getStartY() |
CPolyLine |
lineTo(double x,
double y)
Adds a line segment to this polyline from the current point to point (x,
y).
|
CPolyLine |
lineTo(java.awt.geom.Point2D pt)
Adds a line segment to this polyline from the current point to point pt.
|
CPolyLine |
moveTo(double x,
double y)
Sets the current point of this polyLine to point (x, y).
|
CPolyLine |
moveTo(java.awt.geom.Point2D pt)
Sets the current point of this polyLine to point pt.
|
CPolyLine |
quadTo(double ctrlx1,
double ctrly1,
double xEnd,
double yEnd)
Adds a quadric curve segment to this polyline.
|
CPolyLine |
quadTo(java.awt.geom.Point2D ptCtrl,
java.awt.geom.Point2D ptEnd)
Adds a quadric curve segment to this polyline.
|
CPolyLine |
removeLastSegment()
Removes the last segment of this polyline, if any.
|
CPolyLine |
reset(double x,
double y)
Resets this polyline to the unique point (x, y).
|
CPolyLine |
reset(java.awt.geom.Point2D pt)
Resets this polyline to the unique point pt.
|
above, aboveAll, addChild, addGhost, addTag, addTag, addTag, addTo, animate, asEllipse, asImage, asPolyLine, asRectangle, asRectangularShape, asText, attachSM, below, belowAll, canvasToShape, canvasToShapeRef, clone, contains, contains, contains, contains, detachSM, duplicateWithTags, firstShape, getAbsShape, getAbsTransform, getAntialiasedShapes, getBoundingBox, getCanvas, getCenterX, getCenterY, getChild, getChildren, getChildrenCount, getClip, getFilledShapes, getFillPaint, getFirstAntialiasedShape, getFirstFilledShape, getFirstHavingTag, getFirstOutlinedShape, getGhost, getHeight, getHierarchy, getIntersection, getMaxX, getMaxY, getMinX, getMinY, getOutlinedShapes, getOutlinePaint, getParent, getReferenceX, getReferenceY, getRenderingHint, getRotation, getScaleX, getScaleY, getShape, getStroke, getSubtraction, getTags, getTransform, getTranslateX, getTranslateY, getTransparencyFill, getTransparencyOutline, getWidth, hasTag, hasTag, indexOf, intersects, isAbove, isAntialiased, isBelow, isDrawable, isFilled, isOnOutline, isOutlined, isPickable, isPicked, paint, pick, pickStyle, remove, removeAllChildren, removeChild, removeChild, removeGhost, removeTag, removeTag, rotateBy, rotateTo, scaleBy, scaleBy, scaleTo, scaleTo, setAntialiased, setClip, setDrawable, setFilled, setFillPaint, setOutlined, setOutlinePaint, setParent, setPickable, setReferencePoint, setReferencePoint, setRenderingHint, setShape, setStroke, setTransformToIdentity, setTransparencyFill, setTransparencyFill, setTransparencyOutline, setTransparencyOutline, shapeToCanvas, translateBy, translateTo
public CPolyLine()
public CPolyLine(double x, double y)
x
- The x coordinate of the initial pointy
- The y coordinate of the initial pointpublic CPolyLine(java.awt.geom.Point2D pt)
pt
- The initial pointpublic CShape fixReferenceShapeToCurrent()
fixReferenceShapeToCurrent
in interface CElement
fixReferenceShapeToCurrent
in class CShape
public CPolyLine reset(double x, double y)
x
- The x coordinate of the initial pointy
- The y coordinate of the initial pointpublic CPolyLine reset(java.awt.geom.Point2D pt)
pt
- The pointpublic CPolyLine lineTo(double x, double y)
x
- The x coordinate of the last pointy
- the y coordinate of the last pointpublic CPolyLine lineTo(java.awt.geom.Point2D pt)
pt
- The pointpublic CPolyLine moveTo(double x, double y)
x
- The x coordinate of the current point to sety
- the y coordinate of the current point to setpublic CPolyLine moveTo(java.awt.geom.Point2D pt)
pt
- The pointpublic CPolyLine getArrow(double extent, double sizeArrow)
CPolyLine
. It is not linked to this polyline
and it is not added to the canvas.extent
- The extent of the arrow (in radians)sizeArrow
- The length of the arrow.public CPolyLine arcTo(double start, double extent, double rx, double ry)
start
- The starting angle of the ellipseextent
- The extent angle of the arcrx
- The x radius of the ellipsery
- The y radius of the ellipsepublic java.awt.geom.Point2D getCurrentPoint()
public CPolyLine quadTo(double ctrlx1, double ctrly1, double xEnd, double yEnd)
ctrlx1
- The x coordinate of the first Bezier control pointctrly1
- The y coordinate of the first Bezier control pointxEnd
- The x coordinate of the end pointyEnd
- The y coordinate of the end pointpublic CPolyLine quadTo(java.awt.geom.Point2D ptCtrl, java.awt.geom.Point2D ptEnd)
ptCtrl
- The first Bezier control pointptEnd
- The end pointpublic CPolyLine curveTo(double ctrlx1, double ctrly1, double ctrlx2, double ctrly2, double xEnd, double yEnd)
ctrlx1
- The x coordinate of the first Bezier control pointctrly1
- The y coordinate of the first Bezier control pointctrlx2
- The x coordinate of the second Bezier control pointctrly2
- The y coordinate of the second Bezier control pointxEnd
- The x coordinate of the ending pointyEnd
- The y coordinate of the ending pointpublic CPolyLine curveTo(java.awt.geom.Point2D ptCtrl1, java.awt.geom.Point2D ptCtrl2, java.awt.geom.Point2D ptEnd)
ptCtrl1
- The first Bezier control pointptCtrl2
- The second Bezier control pointptEnd
- The ending pointpublic CPolyLine close()
public CPolyLine removeLastSegment()
public CShape copyTo(CShape sms)
public CShape duplicate()
duplicate
in class CShape
CShape.duplicateWithTags()
public double getStartX()
public double getStartY()