org.apache.batik.bridge

Class SVGShapeElementBridge

public abstract class SVGShapeElementBridge extends AbstractGraphicsNodeBridge

The base bridge class for shapes. Subclasses bridge ShapeNode.
Field Summary
protected booleanhasNewShapePainter
This flag bit indicates if a new shape painter has already been created.
Constructor Summary
protected SVGShapeElementBridge()
Constructs a new bridge for SVG shapes.
Method Summary
voidbuildGraphicsNode(BridgeContext ctx, Element e, GraphicsNode node)
Builds using the specified BridgeContext and element, the specified graphics node.
protected abstract voidbuildShape(BridgeContext ctx, Element e, ShapeNode node)
Initializes the specified ShapeNode's shape defined by the specified Element and using the specified bridge context.
GraphicsNodecreateGraphicsNode(BridgeContext ctx, Element e)
Creates a graphics node using the specified BridgeContext and for the specified element.
protected ShapePaintercreateShapePainter(BridgeContext ctx, Element e, ShapeNode shapeNode)
Creates the shape painter associated to the specified element.
voidhandleCSSEngineEvent(CSSEngineEvent evt)
Invoked when CSS properties have changed on an element.
protected voidhandleCSSPropertyChanged(int property)
Invoked for each CSS property that has changed.
protected voidhandleGeometryChanged()
Invoked when the geometry of an graphical element has changed.
protected GraphicsNodeinstantiateGraphicsNode()
Creates a ShapeNode.
booleanisComposite()
Returns false as shapes are not a container.

Field Detail

hasNewShapePainter

protected boolean hasNewShapePainter
This flag bit indicates if a new shape painter has already been created. Avoid creating one ShapePainter per CSS property change

Constructor Detail

SVGShapeElementBridge

protected SVGShapeElementBridge()
Constructs a new bridge for SVG shapes.

Method Detail

buildGraphicsNode

public void buildGraphicsNode(BridgeContext ctx, Element e, GraphicsNode node)
Builds using the specified BridgeContext and element, the specified graphics node.

Parameters: ctx the bridge context to use e the element that describes the graphics node to build node the graphics node to build

buildShape

protected abstract void buildShape(BridgeContext ctx, Element e, ShapeNode node)
Initializes the specified ShapeNode's shape defined by the specified Element and using the specified bridge context.

Parameters: ctx the bridge context to use e the element that describes the shape node to build node the shape node to initialize

createGraphicsNode

public GraphicsNode createGraphicsNode(BridgeContext ctx, Element e)
Creates a graphics node using the specified BridgeContext and for the specified element.

Parameters: ctx the bridge context to use e the element that describes the graphics node to build

Returns: a graphics node that represents the specified element

createShapePainter

protected ShapePainter createShapePainter(BridgeContext ctx, Element e, ShapeNode shapeNode)
Creates the shape painter associated to the specified element. This implementation creates a shape painter considering the various fill and stroke properties.

Parameters: ctx the bridge context to use e the element that describes the shape painter to use shapeNode the shape node that is interested in its shape painter

handleCSSEngineEvent

public void handleCSSEngineEvent(CSSEngineEvent evt)
Invoked when CSS properties have changed on an element.

Parameters: evt the CSSEngine event that describes the update

handleCSSPropertyChanged

protected void handleCSSPropertyChanged(int property)
Invoked for each CSS property that has changed.

handleGeometryChanged

protected void handleGeometryChanged()
Invoked when the geometry of an graphical element has changed.

instantiateGraphicsNode

protected GraphicsNode instantiateGraphicsNode()
Creates a ShapeNode.

isComposite

public boolean isComposite()
Returns false as shapes are not a container.
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.