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
Modifier and TypeFieldDescriptionprotected boolean
Is the current path a new one?protected GeneralPath
The current path.protected int
The winding rule to use to construct the path. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Shape
createShape
(Reader r, int wr) Utility method for creating an ExtendedGeneralPath.void
ImplementsPointsHandler.endPoints()
.getShape()
Returns the Shape object initialized during the last parsing.int
Returns the current winding rule.void
point
(float x, float y) ImplementsPointsHandler.point(float,float)
.void
setWindingRule
(int i) Sets the winding rule used to construct the path.void
ImplementsPointsHandler.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:
IOException
ParseException
-
setWindingRule
public void setWindingRule(int i) Sets the winding rule used to construct the path.- Specified by:
setWindingRule
in interfaceShapeProducer
-
getWindingRule
public int getWindingRule()Returns the current winding rule.- Specified by:
getWindingRule
in interfaceShapeProducer
-
getShape
Returns the Shape object initialized during the last parsing.- Specified by:
getShape
in interfaceShapeProducer
- Returns:
- the shape or null if this handler has not been used by a parser.
-
startPoints
ImplementsPointsHandler.startPoints()
.- Specified by:
startPoints
in interfacePointsHandler
- Throws:
ParseException
- if an error occured while processing the points
-
point
ImplementsPointsHandler.point(float,float)
.- Specified by:
point
in 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:
endPoints
in interfacePointsHandler
- Throws:
ParseException
- if an error occured while processing the points
-