public class XyQuadraticCurve extends java.lang.Object implements XyPath<XyQuadraticCurve>
Copyright 2007 Partner Software, inc.
| Constructor and Description |
|---|
XyQuadraticCurve(XyPoint startPoint,
XyPoint endPoint,
XyPoint controlPoint)
Creates a new quadratic curve with the given start, end, and control
points.
|
| Modifier and Type | Method and Description |
|---|---|
XyBounds |
getBounds()
Returns an XyBounds object representing the rectangular extents of this
shape.
|
XyPoint |
getControlPoint() |
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() |
XyQuadraticCurve |
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.
|
XyQuadraticCurve |
translatedBy(double offsetX,
double offsetY)
Translate the shape by adding all coordinates to the given x and y
offsets.
|
public double getLength()
XyPathgetLength in interface XyPath<XyQuadraticCurve>public XyPoint getStartPoint()
XyPathgetStartPoint in interface XyPath<XyQuadraticCurve>public XyPoint getEndPoint()
XyPathgetEndPoint in interface XyPath<XyQuadraticCurve>public XyPolyline toPolyline()
XyPathXyPath.toPolyline(XyAngle) with a default angle granularity of
1/60 circle (6 degrees, pi/30 radians).toPolyline in interface XyPath<XyQuadraticCurve>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<XyQuadraticCurve>public XyBounds getBounds()
XyShapegetBounds in interface XyShape<XyQuadraticCurve>public XyQuadraticCurve scaledBy(double factor)
XyShapescaledBy in interface XyShape<XyQuadraticCurve>factor - scaling factorpublic XyShape transformedBy(XyTransform transform)
XyShapetransformedBy in interface XyShape<XyQuadraticCurve>transform - affine transform to apply.public XyQuadraticCurve translatedBy(double offsetX, double offsetY)
XyShapetranslatedBy in interface XyShape<XyQuadraticCurve>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 getControlPoint()