org.apache.batik.bridge

Class SVGPathElementBridge

public class SVGPathElementBridge extends SVGDecoratedShapeElementBridge implements SVGPathContext

Bridge class for the <path> element.
Field Summary
protected static ShapeDEFAULT_SHAPE
default shape for the update of 'd' when the value is the empty string.
protected PathLengthpathLength
The cached PathLength object used for computing the path length.
protected ShapepathLengthShape
The cached Shape used for computing the path length.
Constructor Summary
SVGPathElementBridge()
Constructs a new bridge for the <path> element.
Method Summary
protected voidbuildShape(BridgeContext ctx, Element e, ShapeNode shapeNode)
Constructs a path according to the specified parameters.
BridgegetInstance()
Returns a new instance of this bridge.
StringgetLocalName()
Returns 'path'.
protected PathLengthgetPathLengthObj()
Returns the PathLength object that tracks the length of the path.
intgetPathSegAtLength(float distance)
Returns the index of the path segment at the given distance along the path.
Point2DgetPointAtLength(float distance)
Returns the point at the given distance along the path.
floatgetTotalLength()
Returns the total length of the path.
voidhandleAnimatedAttributeChanged(AnimatedLiveAttributeValue alav)
Invoked when the animated value of an animatable attribute has changed.
protected voidhandleCSSPropertyChanged(int property)

Field Detail

DEFAULT_SHAPE

protected static final Shape DEFAULT_SHAPE
default shape for the update of 'd' when the value is the empty string.

pathLength

protected PathLength pathLength
The cached PathLength object used for computing the path length.

pathLengthShape

protected Shape pathLengthShape
The cached Shape used for computing the path length.

Constructor Detail

SVGPathElementBridge

public SVGPathElementBridge()
Constructs a new bridge for the <path> element.

Method Detail

buildShape

protected void buildShape(BridgeContext ctx, Element e, ShapeNode shapeNode)
Constructs a path according to the specified parameters.

Parameters: ctx the bridge context to use e the element that describes a rect element shapeNode the shape node to initialize

getInstance

public Bridge getInstance()
Returns a new instance of this bridge.

getLocalName

public String getLocalName()
Returns 'path'.

getPathLengthObj

protected PathLength getPathLengthObj()
Returns the PathLength object that tracks the length of the path.

getPathSegAtLength

public int getPathSegAtLength(float distance)
Returns the index of the path segment at the given distance along the path.

getPointAtLength

public Point2D getPointAtLength(float distance)
Returns the point at the given distance along the path.

getTotalLength

public float getTotalLength()
Returns the total length of the path.

handleAnimatedAttributeChanged

public void handleAnimatedAttributeChanged(AnimatedLiveAttributeValue alav)
Invoked when the animated value of an animatable attribute has changed.

handleCSSPropertyChanged

protected void handleCSSPropertyChanged(int property)
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.