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 {@link PathHandler#arcAbs(float,float,float,boolean,boolean,float,float)}.
voidarcRel(float rx, float ry, float xAxisRotation, boolean largeArcFlag, boolean sweepFlag, float x, float y)
Implements {@link PathHandler#arcRel(float,float,float,boolean,boolean,float,float)}.
voidclosePath()
Implements {@link PathHandler#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 {@link PathHandler#curvetoCubicAbs(float,float,float,float,float,float)}.
voidcurvetoCubicRel(float x1, float y1, float x2, float y2, float x, float y)
Implements {@link PathHandler#curvetoCubicRel(float,float,float,float,float,float)}.
voidcurvetoCubicSmoothAbs(float x2, float y2, float x, float y)
Implements {@link PathHandler#curvetoCubicSmoothAbs(float,float,float,float)}.
voidcurvetoCubicSmoothRel(float x2, float y2, float x, float y)
Implements {@link PathHandler#curvetoCubicSmoothRel(float,float,float,float)}.
voidcurvetoQuadraticAbs(float x1, float y1, float x, float y)
Implements {@link PathHandler#curvetoQuadraticAbs(float,float,float,float)}.
voidcurvetoQuadraticRel(float x1, float y1, float x, float y)
Implements {@link PathHandler#curvetoQuadraticRel(float,float,float,float)}.
voidcurvetoQuadraticSmoothAbs(float x, float y)
Implements {@link PathHandler#curvetoQuadraticSmoothAbs(float,float)}.
voidcurvetoQuadraticSmoothRel(float x, float y)
Implements {@link PathHandler#curvetoQuadraticSmoothRel(float,float)}.
voidendPath()
Implements {@link PathHandler#endPath()}.
ShapegetShape()
Returns the Shape object initialized during the last parsing.
intgetWindingRule()
Returns the current winding rule.
voidlinetoAbs(float x, float y)
Implements {@link PathHandler#linetoAbs(float,float)}.
voidlinetoHorizontalAbs(float x)
Implements {@link PathHandler#linetoHorizontalAbs(float)}.
voidlinetoHorizontalRel(float x)
Implements {@link PathHandler#linetoHorizontalRel(float)}.
voidlinetoRel(float x, float y)
Implements {@link PathHandler#linetoRel(float,float)}.
voidlinetoVerticalAbs(float y)
Implements {@link PathHandler#linetoVerticalAbs(float)}.
voidlinetoVerticalRel(float y)
Implements {@link PathHandler#linetoVerticalRel(float)}.
voidmovetoAbs(float x, float y)
Implements {@link PathHandler#movetoAbs(float,float)}.
voidmovetoRel(float x, float y)
Implements {@link PathHandler#movetoRel(float,float)}.
voidsetWindingRule(int i)
Sets the winding rule used to construct the path.
voidstartPath()
Implements {@link PathHandler#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 {@link PathHandler#arcAbs(float,float,float,boolean,boolean,float,float)}.

arcRel

public void arcRel(float rx, float ry, float xAxisRotation, boolean largeArcFlag, boolean sweepFlag, float x, float y)
Implements {@link PathHandler#arcRel(float,float,float,boolean,boolean,float,float)}.

closePath

public void closePath()
Implements {@link PathHandler#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 {@link PathHandler#curvetoCubicAbs(float,float,float,float,float,float)}.

curvetoCubicRel

public void curvetoCubicRel(float x1, float y1, float x2, float y2, float x, float y)
Implements {@link PathHandler#curvetoCubicRel(float,float,float,float,float,float)}.

curvetoCubicSmoothAbs

public void curvetoCubicSmoothAbs(float x2, float y2, float x, float y)
Implements {@link PathHandler#curvetoCubicSmoothAbs(float,float,float,float)}.

curvetoCubicSmoothRel

public void curvetoCubicSmoothRel(float x2, float y2, float x, float y)
Implements {@link PathHandler#curvetoCubicSmoothRel(float,float,float,float)}.

curvetoQuadraticAbs

public void curvetoQuadraticAbs(float x1, float y1, float x, float y)
Implements {@link PathHandler#curvetoQuadraticAbs(float,float,float,float)}.

curvetoQuadraticRel

public void curvetoQuadraticRel(float x1, float y1, float x, float y)
Implements {@link PathHandler#curvetoQuadraticRel(float,float,float,float)}.

curvetoQuadraticSmoothAbs

public void curvetoQuadraticSmoothAbs(float x, float y)
Implements {@link PathHandler#curvetoQuadraticSmoothAbs(float,float)}.

curvetoQuadraticSmoothRel

public void curvetoQuadraticSmoothRel(float x, float y)
Implements {@link PathHandler#curvetoQuadraticSmoothRel(float,float)}.

endPath

public void endPath()
Implements {@link PathHandler#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 {@link PathHandler#linetoAbs(float,float)}.

linetoHorizontalAbs

public void linetoHorizontalAbs(float x)
Implements {@link PathHandler#linetoHorizontalAbs(float)}.

linetoHorizontalRel

public void linetoHorizontalRel(float x)
Implements {@link PathHandler#linetoHorizontalRel(float)}.

linetoRel

public void linetoRel(float x, float y)
Implements {@link PathHandler#linetoRel(float,float)}.

linetoVerticalAbs

public void linetoVerticalAbs(float y)
Implements {@link PathHandler#linetoVerticalAbs(float)}.

linetoVerticalRel

public void linetoVerticalRel(float y)
Implements {@link PathHandler#linetoVerticalRel(float)}.

movetoAbs

public void movetoAbs(float x, float y)
Implements {@link PathHandler#movetoAbs(float,float)}.

movetoRel

public void movetoRel(float x, float y)
Implements {@link PathHandler#movetoRel(float,float)}.

setWindingRule

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

startPath

public void startPath()
Implements {@link PathHandler#startPath()}.
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.