public class XyCubicCurve extends java.lang.Object implements XyPath<XyCubicCurve>
| Constructor and Description |
|---|
XyCubicCurve(XyPoint startPoint,
XyPoint endPoint,
XyPoint controlPoint1,
XyPoint controlPoint2) |
| Modifier and Type | Method and Description |
|---|---|
XyBounds |
getBounds()
Returns an XyBounds object representing the rectangular extents of this
shape.
|
XyPoint |
getControlPoint1() |
XyPoint |
getControlPoint2() |
XyPoint |
getEndPoint()
Returns the last point in the shape.
|
double |
getLength()
Returns the length of the path.
|
XyPoint |
getStartPoint()
Returns the first point in the shape.
|
java.util.Iterator<XyPoint> |
iterator() |
XyCubicCurve |
scaledBy(double factor)
Return a scaled version of the shape by multiplying all coordinates by
the given factor in both dimensions.
|
XyPolyline |
toPolyline()
Same as
XyPath.toPolyline(XyAngle) with a default angle granularity of
1/60 circle (6 degrees, pi/30 radians). |
XyPolyline |
toPolyline(XyAngle granularity)
Converts this area to a polyline which approximates it in some fashion.
|
XyShape |
transformedBy(XyTransform transform)
Transform the shape using the given transform.
|
XyCubicCurve |
translatedBy(double offsetX,
double offsetY)
Translate the shape by adding all coordinates to the given x and y
offsets.
|
XyCubicCurve |
withControlPoint1(XyPoint newControlPoint1)
Returns a modified version of XyCubicCurve with the given first control
point.
|
XyCubicCurve |
withControlPoint2(XyPoint newControlPoint2)
Returns a modified version of XyCubicCurve with the given second control
point.
|
XyCubicCurve |
withEndPoint(XyPoint newEndPoint)
Returns a modified version of XyCubicCurve with the given end point.
|
XyCubicCurve |
withStartPoint(XyPoint newStartPoint)
Returns a modified version of XyCubicCurve with the given start point.
|
public XyCubicCurve withStartPoint(XyPoint newStartPoint)
public XyCubicCurve withEndPoint(XyPoint newEndPoint)
public XyCubicCurve withControlPoint1(XyPoint newControlPoint1)
public XyCubicCurve withControlPoint2(XyPoint newControlPoint2)
public double getLength()
XyPathgetLength in interface XyPath<XyCubicCurve>public XyPoint getStartPoint()
XyPathgetStartPoint in interface XyPath<XyCubicCurve>public XyPoint getEndPoint()
XyPathgetEndPoint in interface XyPath<XyCubicCurve>public XyPolyline toPolyline(XyAngle granularity)
XyPathThe angle parameter allows a certain level of control of the output. Essentially it dictates the minimum angular granularity used to approximate curved paths. For example, an arc would be turned into a polyline by placing points around the arc's slice of a circle, separated by the given angle.
toPolyline in interface XyPath<XyCubicCurve>public XyPolyline toPolyline()
XyPathXyPath.toPolyline(XyAngle) with a default angle granularity of
1/60 circle (6 degrees, pi/30 radians).toPolyline in interface XyPath<XyCubicCurve>public XyBounds getBounds()
XyShapegetBounds in interface XyShape<XyCubicCurve>public XyCubicCurve scaledBy(double factor)
XyShapescaledBy in interface XyShape<XyCubicCurve>factor - scaling factorpublic XyShape transformedBy(XyTransform transform)
XyShapetransformedBy in interface XyShape<XyCubicCurve>transform - affine transform to apply.public XyCubicCurve translatedBy(double offsetX, double offsetY)
XyShapetranslatedBy in interface XyShape<XyCubicCurve>offsetX - offset for the x dimensionoffsetY - offset for the y dimensionpublic java.util.Iterator<XyPoint> iterator()
iterator in interface java.lang.Iterable<XyPoint>public XyPoint getControlPoint1()
public XyPoint getControlPoint2()