org.apache.batik.parser

Class AWTPathProducer

public class AWTPathProducer extends Object implements PathHandler, ShapeProducer

This class provides an implementation of the PathHandler that initializes a Shape from the value of a path's 'd' attribute.
Field Summary
protected floatcurrentX
The current x position.
protected floatcurrentY
The current y position.
protected ExtendedGeneralPathpath
The temporary value of extendedGeneralPath.
protected intwindingRule
The winding rule to use to construct the path.
protected floatxCenter
The reference x point for smooth arcs.
protected floatyCenter
The reference y point for smooth arcs.
Method Summary
voidarcAbs(float rx, float ry, float xAxisRotation, boolean largeArcFlag, boolean sweepFlag, float x, float y)
Implements PathHandler.
voidarcRel(float rx, float ry, float xAxisRotation, boolean largeArcFlag, boolean sweepFlag, float x, float y)
Implements PathHandler.
voidclosePath()
Implements closePath.
static ShapecreateShape(Reader r, int wr)
Utility method for creating an ExtendedGeneralPath.
voidcurvetoCubicAbs(float x1, float y1, float x2, float y2, float x, float y)
Implements PathHandler.
voidcurvetoCubicRel(float x1, float y1, float x2, float y2, float x, float y)
Implements PathHandler.
voidcurvetoCubicSmoothAbs(float x2, float y2, float x, float y)
Implements PathHandler.
voidcurvetoCubicSmoothRel(float x2, float y2, float x, float y)
Implements PathHandler.
voidcurvetoQuadraticAbs(float x1, float y1, float x, float y)
Implements PathHandler.
voidcurvetoQuadraticRel(float x1, float y1, float x, float y)
Implements PathHandler.
voidcurvetoQuadraticSmoothAbs(float x, float y)
Implements PathHandler.
voidcurvetoQuadraticSmoothRel(float x, float y)
Implements PathHandler.
voidendPath()
Implements endPath.
ShapegetShape()
Returns the Shape object initialized during the last parsing.
intgetWindingRule()
Returns the current winding rule.
voidlinetoAbs(float x, float y)
Implements PathHandler.
voidlinetoHorizontalAbs(float x)
Implements PathHandler.
voidlinetoHorizontalRel(float x)
Implements PathHandler.
voidlinetoRel(float x, float y)
Implements PathHandler.
voidlinetoVerticalAbs(float y)
Implements PathHandler.
voidlinetoVerticalRel(float y)
Implements PathHandler.
voidmovetoAbs(float x, float y)
Implements PathHandler.
voidmovetoRel(float x, float y)
Implements PathHandler.
voidsetWindingRule(int i)
Sets the winding rule used to construct the path.
voidstartPath()
Implements startPath.

Field Detail

currentX

protected float currentX
The current x position.

currentY

protected float currentY
The current y position.

path

protected ExtendedGeneralPath path
The temporary value of extendedGeneralPath.

windingRule

protected int windingRule
The winding rule to use to construct the path.

xCenter

protected float xCenter
The reference x point for smooth arcs.

yCenter

protected float yCenter
The reference y point for smooth arcs.

Method Detail

arcAbs

public void arcAbs(float rx, float ry, float xAxisRotation, boolean largeArcFlag, boolean sweepFlag, float x, float y)
Implements PathHandler.

arcRel

public void arcRel(float rx, float ry, float xAxisRotation, boolean largeArcFlag, boolean sweepFlag, float x, float y)
Implements PathHandler.

closePath

public void closePath()
Implements closePath.

createShape

public static Shape createShape(Reader r, int wr)
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.

curvetoCubicAbs

public void curvetoCubicAbs(float x1, float y1, float x2, float y2, float x, float y)
Implements PathHandler.

curvetoCubicRel

public void curvetoCubicRel(float x1, float y1, float x2, float y2, float x, float y)
Implements PathHandler.

curvetoCubicSmoothAbs

public void curvetoCubicSmoothAbs(float x2, float y2, float x, float y)
Implements PathHandler.

curvetoCubicSmoothRel

public void curvetoCubicSmoothRel(float x2, float y2, float x, float y)
Implements PathHandler.

curvetoQuadraticAbs

public void curvetoQuadraticAbs(float x1, float y1, float x, float y)
Implements PathHandler.

curvetoQuadraticRel

public void curvetoQuadraticRel(float x1, float y1, float x, float y)
Implements PathHandler.

curvetoQuadraticSmoothAbs

public void curvetoQuadraticSmoothAbs(float x, float y)
Implements PathHandler.

curvetoQuadraticSmoothRel

public void curvetoQuadraticSmoothRel(float x, float y)
Implements PathHandler.

endPath

public void endPath()
Implements endPath.

getShape

public Shape getShape()
Returns the Shape object initialized during the last parsing.

Returns: the shape or null if this handler has not been used by a parser.

getWindingRule

public int getWindingRule()
Returns the current winding rule.

linetoAbs

public void linetoAbs(float x, float y)
Implements PathHandler.

linetoHorizontalAbs

public void linetoHorizontalAbs(float x)
Implements PathHandler.

linetoHorizontalRel

public void linetoHorizontalRel(float x)
Implements PathHandler.

linetoRel

public void linetoRel(float x, float y)
Implements PathHandler.

linetoVerticalAbs

public void linetoVerticalAbs(float y)
Implements PathHandler.

linetoVerticalRel

public void linetoVerticalRel(float y)
Implements PathHandler.

movetoAbs

public void movetoAbs(float x, float y)
Implements PathHandler.

movetoRel

public void movetoRel(float x, float y)
Implements PathHandler.

setWindingRule

public void setWindingRule(int i)
Sets the winding rule used to construct the path.

startPath

public void startPath()
Implements startPath.
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.