Package org.apache.batik.parser
Class AWTPolylineProducer
- java.lang.Object
-
- org.apache.batik.parser.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.- Version:
- $Id: AWTPolylineProducer.java 1733416 2016-03-03 07:07:13Z gadams $
-
-
Field Summary
Fields Modifier and Type Field Description protected booleannewPathIs the current path a new one?protected java.awt.geom.GeneralPathpathThe current path.protected intwindingRuleThe 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.ShapecreateShape(java.io.Reader r, int wr)Utility method for creating an ExtendedGeneralPath.voidendPoints()ImplementsPointsHandler.endPoints().java.awt.ShapegetShape()Returns the Shape object initialized during the last parsing.intgetWindingRule()Returns 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.voidstartPoints()ImplementsPointsHandler.startPoints().
-
-
-
Method Detail
-
createShape
public static java.awt.Shape createShape(java.io.Reader r, int wr) throws java.io.IOException, ParseExceptionUtility 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:
java.io.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
public java.awt.Shape 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
public void startPoints() throws ParseExceptionImplementsPointsHandler.startPoints().- Specified by:
startPointsin interfacePointsHandler- Throws:
ParseException- if an error occured while processing the points
-
point
public void point(float x, float y) throws ParseExceptionImplementsPointsHandler.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
public void endPoints() throws ParseExceptionImplementsPointsHandler.endPoints().- Specified by:
endPointsin interfacePointsHandler- Throws:
ParseException- if an error occured while processing the points
-
-