public class CurveConverter extends Object
endArc()
to force the end of the current ArcaddCubicCurve(CubicCurve2D)
for each new CubicCurveaddQuadCurve(QuadCurve2D)
for each new QuadCurveModifier and Type | Class and Description |
---|---|
class |
CurveConverter.AngleSegment
Represents an Angle Segment.
|
Modifier and Type | Field and Description |
---|---|
static int |
CURRENT_ARC
The current state of the converter when an Arc is detected.
|
static int |
END_ARC
The current state of the converter when the end of an Arc is detected.
|
static int |
NO_ARC
The current state of the converter when no Arc is detected.
|
Constructor and Description |
---|
CurveConverter()
Constructor of the converter.
|
CurveConverter(boolean allowCircles)
Constructor of the converter.
|
Modifier and Type | Method and Description |
---|---|
int |
addCubicCurve(CubicCurve2D cubic)
Add a CubicCurve to the curve Vector.
|
int |
addQuadCurve(QuadCurve2D quad)
Add a QuadCurve to the Curve Vector.
|
void |
allowCircles(boolean allowCircles)
Set the conversion policy.
|
void |
clear()
Clear this converter to allow the creation of new Curves.
|
int |
endArc()
Force the end of an Arc.
|
int |
getCurrentState()
Return the current state.
|
Shape |
getLastShape()
Return the last Shape issued from the conversion process.
|
List<Shape> |
getShapes()
Return the Shapes issued from the conversion process.
|
boolean |
hasShapes()
Return true if this converter contain some converted Shapes.
|
boolean |
isAllowingCircles()
Return the conversion policy.
|
protected List<Shape> |
toArc2D()
Convert the current curve Vector to a Vector of Arc2D.
|
public static final int NO_ARC
public static final int CURRENT_ARC
public static final int END_ARC
public CurveConverter()
public CurveConverter(boolean allowCircles)
allowCircles
- tyue if circles are allowed as results of the conversionpublic void clear()
public int getCurrentState()
public boolean isAllowingCircles()
public void allowCircles(boolean allowCircles)
allowCircles
- true if circles are allowaed in the conversionpublic Shape getLastShape()
public List<Shape> getShapes()
public boolean hasShapes()
public int endArc()
END_ARC
if the state is CURRENT_ARC
, and NO_ARC
elsepublic int addCubicCurve(CubicCurve2D cubic)
cubic
- the CubicCurvepublic int addQuadCurve(QuadCurve2D quad)
quad
- the QuadCurve