Class SVGDocumentBridge
java.lang.Object
org.apache.batik.bridge.SVGDocumentBridge
- All Implemented Interfaces:
Bridge, BridgeUpdateHandler, DocumentBridge, SVGContext
public class SVGDocumentBridge
extends Object
implements DocumentBridge, BridgeUpdateHandler, SVGContext
Bridge class for an SVGDocument node.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BridgeContextThe bridge context.protected DocumentThe document node this bridge is associated with.protected RootGraphicsNodeThe graphics node constructed by this bridge.Fields inherited from interface SVGContext
PERCENTAGE_FONT_SIZE, PERCENTAGE_VIEWPORT_HEIGHT, PERCENTAGE_VIEWPORT_SIZE, PERCENTAGE_VIEWPORT_WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildGraphicsNode(BridgeContext ctx, Document doc, RootGraphicsNode node) Builds using the specified BridgeContext and element, the specified graphics node.createGraphicsNode(BridgeContext ctx, Document doc) Creates aGraphicsNodeaccording to the specified parameters.voiddispose()Disposes this BridgeUpdateHandler and releases all resources.getBBox()Returns the tight bounding box in current user space (i.e., after application of the transform attribute, if any) on the geometry of all contained graphics elements, exclusive of stroke-width and filter effects).getCTM()Returns the transformation matrix from current user units (i.e., after application of the transform attribute, if any) to the viewport coordinate system for the nearestViewportElement.floatReturns the font-size on the associated element.Returns the global transformation matrix from the current element to the root.Returns a new instance of this bridge.Returns the local name of the element thisBridgeis dedicated to.Returns the namespace URI of the element thisBridgeis dedicated to.floatReturns the size of a px CSS unit in millimeters.floatReturns the size of a px CSS unit in millimeters.Returns the transform from the global transform space to pixels.floatReturns the height of the viewport which directly contains the associated element.floatReturns the width of the viewport which directly contains the associated element.voidInvoked when the animated value of an animated attribute has changed.voidInvoked when an CSSEngineEvent is fired.voidInvoked when an MutationEvent of type 'DOMAttrModified' is fired.voidInvoked when an MutationEvent of type 'DOMCharacterDataModified' is fired.voidInvoked when an MutationEvent of type 'DOMNodeInserted' is fired.voidInvoked when an MutationEvent of type 'DOMNodeRemoved' is fired.voidInvoked when an 'other' animation value has changed.voidSets the transform to be used from the global transform space to pixels.
-
Field Details
-
document
The document node this bridge is associated with. -
node
The graphics node constructed by this bridge. -
ctx
The bridge context.
-
-
Constructor Details
-
SVGDocumentBridge
public SVGDocumentBridge()Constructs a new bridge the SVG document.
-
-
Method Details
-
getNamespaceURI
Returns the namespace URI of the element thisBridgeis dedicated to. Returnsnull, as a Document node has no namespace URI.- Specified by:
getNamespaceURIin interfaceBridge
-
getLocalName
Returns the local name of the element thisBridgeis dedicated to. Returnsnull, as a Document node has no local name.- Specified by:
getLocalNamein interfaceBridge
-
getInstance
Returns a new instance of this bridge.- Specified by:
getInstancein interfaceBridge
-
createGraphicsNode
Creates aGraphicsNodeaccording to the specified parameters. This is called before children have been added to the returned GraphicsNode (obviously since you construct and return it).- Specified by:
createGraphicsNodein interfaceDocumentBridge- Parameters:
ctx- the bridge context to usedoc- the document node that describes the graphics node to build- Returns:
- a graphics node that represents the specified document node
-
buildGraphicsNode
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.- Specified by:
buildGraphicsNodein interfaceDocumentBridge- Parameters:
ctx- the bridge context to usedoc- the document node that describes the graphics node to buildnode- the graphics node to build
-
handleDOMAttrModifiedEvent
Invoked when an MutationEvent of type 'DOMAttrModified' is fired.- Specified by:
handleDOMAttrModifiedEventin interfaceBridgeUpdateHandler
-
handleDOMNodeInsertedEvent
Invoked when an MutationEvent of type 'DOMNodeInserted' is fired.- Specified by:
handleDOMNodeInsertedEventin interfaceBridgeUpdateHandler
-
handleDOMNodeRemovedEvent
Invoked when an MutationEvent of type 'DOMNodeRemoved' is fired.- Specified by:
handleDOMNodeRemovedEventin interfaceBridgeUpdateHandler
-
handleDOMCharacterDataModified
Invoked when an MutationEvent of type 'DOMCharacterDataModified' is fired.- Specified by:
handleDOMCharacterDataModifiedin interfaceBridgeUpdateHandler
-
handleCSSEngineEvent
Invoked when an CSSEngineEvent is fired.- Specified by:
handleCSSEngineEventin interfaceBridgeUpdateHandler
-
handleAnimatedAttributeChanged
Invoked when the animated value of an animated attribute has changed.- Specified by:
handleAnimatedAttributeChangedin interfaceBridgeUpdateHandler
-
handleOtherAnimationChanged
Invoked when an 'other' animation value has changed.- Specified by:
handleOtherAnimationChangedin interfaceBridgeUpdateHandler
-
dispose
public void dispose()Disposes this BridgeUpdateHandler and releases all resources.- Specified by:
disposein interfaceBridgeUpdateHandler
-
getPixelUnitToMillimeter
public float getPixelUnitToMillimeter()Returns the size of a px CSS unit in millimeters.- Specified by:
getPixelUnitToMillimeterin interfaceSVGContext
-
getPixelToMM
public float getPixelToMM()Returns the size of a px CSS unit in millimeters. This will be removed after next release.- Specified by:
getPixelToMMin interfaceSVGContext- See Also:
-
getBBox
Description copied from interface:SVGContextReturns the tight bounding box in current user space (i.e., after application of the transform attribute, if any) on the geometry of all contained graphics elements, exclusive of stroke-width and filter effects).- Specified by:
getBBoxin interfaceSVGContext
-
getScreenTransform
Description copied from interface:SVGContextReturns the transform from the global transform space to pixels.- Specified by:
getScreenTransformin interfaceSVGContext
-
setScreenTransform
Description copied from interface:SVGContextSets the transform to be used from the global transform space to pixels.- Specified by:
setScreenTransformin interfaceSVGContext
-
getCTM
Description copied from interface:SVGContextReturns the transformation matrix from current user units (i.e., after application of the transform attribute, if any) to the viewport coordinate system for the nearestViewportElement.- Specified by:
getCTMin interfaceSVGContext
-
getGlobalTransform
Description copied from interface:SVGContextReturns the global transformation matrix from the current element to the root.- Specified by:
getGlobalTransformin interfaceSVGContext
-
getViewportWidth
public float getViewportWidth()Description copied from interface:SVGContextReturns the width of the viewport which directly contains the associated element.- Specified by:
getViewportWidthin interfaceSVGContext
-
getViewportHeight
public float getViewportHeight()Description copied from interface:SVGContextReturns the height of the viewport which directly contains the associated element.- Specified by:
getViewportHeightin interfaceSVGContext
-
getFontSize
public float getFontSize()Description copied from interface:SVGContextReturns the font-size on the associated element.- Specified by:
getFontSizein interfaceSVGContext
-