org.apache.batik.bridge

Class SVGDocumentBridge

public class SVGDocumentBridge extends Object implements DocumentBridge, BridgeUpdateHandler, SVGContext

Bridge class for an SVGDocument node.
Field Summary
protected BridgeContextctx
The bridge context.
protected Documentdocument
The document node this bridge is associated with.
protected RootGraphicsNodenode
The graphics node constructed by this bridge.
Constructor Summary
SVGDocumentBridge()
Constructs a new bridge the SVG document.
Method Summary
voidbuildGraphicsNode(BridgeContext ctx, Document doc, RootGraphicsNode node)
Builds using the specified BridgeContext and element, the specified graphics node.
RootGraphicsNodecreateGraphicsNode(BridgeContext ctx, Document doc)
Creates a GraphicsNode according to the specified parameters.
voiddispose()
Disposes this BridgeUpdateHandler and releases all resources.
Rectangle2DgetBBox()
AffineTransformgetCTM()
floatgetFontSize()
AffineTransformgetGlobalTransform()
BridgegetInstance()
Returns a new instance of this bridge.
StringgetLocalName()
Returns the local name of the element this Bridge is dedicated to.
StringgetNamespaceURI()
Returns the namespace URI of the element this Bridge is dedicated to.
floatgetPixelToMM()
Returns the size of a px CSS unit in millimeters.
floatgetPixelUnitToMillimeter()
Returns the size of a px CSS unit in millimeters.
AffineTransformgetScreenTransform()
floatgetViewportHeight()
floatgetViewportWidth()
voidhandleAnimatedAttributeChanged(AnimatedLiveAttributeValue alav)
Invoked when the animated value of an animated attribute has changed.
voidhandleCSSEngineEvent(CSSEngineEvent evt)
Invoked when an CSSEngineEvent is fired.
voidhandleDOMAttrModifiedEvent(MutationEvent evt)
Invoked when an MutationEvent of type 'DOMAttrModified' is fired.
voidhandleDOMCharacterDataModified(MutationEvent evt)
Invoked when an MutationEvent of type 'DOMCharacterDataModified' is fired.
voidhandleDOMNodeInsertedEvent(MutationEvent evt)
Invoked when an MutationEvent of type 'DOMNodeInserted' is fired.
voidhandleDOMNodeRemovedEvent(MutationEvent evt)
Invoked when an MutationEvent of type 'DOMNodeRemoved' is fired.
voidhandleOtherAnimationChanged(String type)
Invoked when an 'other' animation value has changed.
voidsetScreenTransform(AffineTransform at)

Field Detail

ctx

protected BridgeContext ctx
The bridge context.

document

protected Document document
The document node this bridge is associated with.

node

protected RootGraphicsNode node
The graphics node constructed by this bridge.

Constructor Detail

SVGDocumentBridge

public SVGDocumentBridge()
Constructs a new bridge the SVG document.

Method Detail

buildGraphicsNode

public void buildGraphicsNode(BridgeContext ctx, Document doc, RootGraphicsNode node)
Builds using the specified BridgeContext and element, the specified graphics node. This is called after all the children of the node have been constructed and added, so it is safe to do work that depends on being able to see your children nodes in this method.

Parameters: ctx the bridge context to use doc the document node that describes the graphics node to build node the graphics node to build

createGraphicsNode

public RootGraphicsNode createGraphicsNode(BridgeContext ctx, Document doc)
Creates a GraphicsNode according to the specified parameters. This is called before children have been added to the returned GraphicsNode (obviously since you construct and return it).

Parameters: ctx the bridge context to use doc the document node that describes the graphics node to build

Returns: a graphics node that represents the specified document node

dispose

public void dispose()
Disposes this BridgeUpdateHandler and releases all resources.

getBBox

public Rectangle2D getBBox()

getCTM

public AffineTransform getCTM()

getFontSize

public float getFontSize()

getGlobalTransform

public AffineTransform getGlobalTransform()

getInstance

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

getLocalName

public String getLocalName()
Returns the local name of the element this Bridge is dedicated to. Returns null, as a Document node has no local name.

getNamespaceURI

public String getNamespaceURI()
Returns the namespace URI of the element this Bridge is dedicated to. Returns null, as a Document node has no namespace URI.

getPixelToMM

public float getPixelToMM()
Returns the size of a px CSS unit in millimeters. This will be removed after next release.

See Also: getPixelUnitToMillimeter

getPixelUnitToMillimeter

public float getPixelUnitToMillimeter()
Returns the size of a px CSS unit in millimeters.

getScreenTransform

public AffineTransform getScreenTransform()

getViewportHeight

public float getViewportHeight()

getViewportWidth

public float getViewportWidth()

handleAnimatedAttributeChanged

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

handleCSSEngineEvent

public void handleCSSEngineEvent(CSSEngineEvent evt)
Invoked when an CSSEngineEvent is fired.

handleDOMAttrModifiedEvent

public void handleDOMAttrModifiedEvent(MutationEvent evt)
Invoked when an MutationEvent of type 'DOMAttrModified' is fired.

handleDOMCharacterDataModified

public void handleDOMCharacterDataModified(MutationEvent evt)
Invoked when an MutationEvent of type 'DOMCharacterDataModified' is fired.

handleDOMNodeInsertedEvent

public void handleDOMNodeInsertedEvent(MutationEvent evt)
Invoked when an MutationEvent of type 'DOMNodeInserted' is fired.

handleDOMNodeRemovedEvent

public void handleDOMNodeRemovedEvent(MutationEvent evt)
Invoked when an MutationEvent of type 'DOMNodeRemoved' is fired.

handleOtherAnimationChanged

public void handleOtherAnimationChanged(String type)
Invoked when an 'other' animation value has changed.

setScreenTransform

public void setScreenTransform(AffineTransform at)
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.