java.lang.Object
io.sf.carte.echosvg.parser.AWTPolylineProducer
- All Implemented Interfaces:
PointsHandler,ShapeProducer
- Direct Known Subclasses:
AWTPolygonProducer
This class produces a polyline shape from a reader.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanIs the current path a new one?protected GeneralPathThe current path.protected intThe winding rule to use to construct the path. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ShapecreateShape(Reader r, int wr) Utility method for creating an ExtendedGeneralPath.voidImplementsPointsHandler.endPoints().getShape()Returns the Shape object initialized during the last parsing.intReturns the current winding rule.voidpoint(float x, float y) ImplementsPointsHandler.point(float,float).voidsetWindingRule(int i) Sets the winding rule used to construct the path.voidImplementsPointsHandler.startPoints().
-
Field Details
-
path
The current path. -
newPath
protected boolean newPathIs the current path a new one? -
windingRule
protected int windingRuleThe winding rule to use to construct the path.
-
-
Constructor Details
-
AWTPolylineProducer
public AWTPolylineProducer()
-
-
Method Details
-
createShape
Utility method for creating an ExtendedGeneralPath.- Parameters:
r- The reader used to read the path specification.wr- The winding rule to use for creating the path.- Throws:
IOExceptionParseException
-
setWindingRule
public void setWindingRule(int i) Sets the winding rule used to construct the path.- Specified by:
setWindingRulein interfaceShapeProducer
-
getWindingRule
public int getWindingRule()Returns the current winding rule.- Specified by:
getWindingRulein interfaceShapeProducer
-
getShape
Returns the Shape object initialized during the last parsing.- Specified by:
getShapein interfaceShapeProducer- Returns:
- the shape or null if this handler has not been used by a parser.
-
startPoints
ImplementsPointsHandler.startPoints().- Specified by:
startPointsin interfacePointsHandler- Throws:
ParseException- if an error occured while processing the points
-
point
ImplementsPointsHandler.point(float,float).- Specified by:
pointin interfacePointsHandler- Parameters:
x- the x coordinate of the pointy- the y coordinate of the point- Throws:
ParseException- if an error occured while processing the points
-
endPoints
ImplementsPointsHandler.endPoints().- Specified by:
endPointsin interfacePointsHandler- Throws:
ParseException- if an error occured while processing the points
-