Package com.mxgraph.util.svg
Class AWTPolylineProducer
- java.lang.Object
-
- com.mxgraph.util.svg.AWTPolylineProducer
-
- All Implemented Interfaces:
PointsHandler
,ShapeProducer
- Direct Known Subclasses:
AWTPolygonProducer
public class AWTPolylineProducer extends java.lang.Object implements PointsHandler, ShapeProducer
This class produces a polyline shape from a reader.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
newPath
Is the current path a new one?protected java.awt.geom.GeneralPath
path
The current path.protected int
windingRule
The winding rule to use to construct the path.
-
Constructor Summary
Constructors Constructor Description AWTPolylineProducer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.awt.Shape
createShape(java.lang.String text, int wr)
Utility method for creating an ExtendedGeneralPath.void
endPoints()
ImplementsPointsHandler.endPoints()
.java.awt.Shape
getShape()
Returns the Shape object initialized during the last parsing.int
getWindingRule()
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
startPoints()
ImplementsPointsHandler.startPoints()
.
-
-
-
Method Detail
-
createShape
public static java.awt.Shape createShape(java.lang.String text, int wr) throws ParseException
Utility method for creating an ExtendedGeneralPath.- Parameters:
text
- The text representation of the path specification.wr
- The winding rule to use for creating the path.- Throws:
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
public java.awt.Shape 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
public void startPoints() throws ParseException
ImplementsPointsHandler.startPoints()
.- Specified by:
startPoints
in interfacePointsHandler
- Throws:
ParseException
- if an error occured while processing the points
-
point
public void point(float x, float y) throws ParseException
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
public void endPoints() throws ParseException
ImplementsPointsHandler.endPoints()
.- Specified by:
endPoints
in interfacePointsHandler
- Throws:
ParseException
- if an error occured while processing the points
-
-