Package org.apache.batik.bridge
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.
- Version:
- $Id: SVGDocumentBridge.java 1733416 2016-03-03 07:07:13Z gadams $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BridgeContext
The bridge context.protected Document
The document node this bridge is associated with.protected RootGraphicsNode
The graphics node constructed by this bridge.Fields inherited from interface org.apache.batik.dom.svg.SVGContext
PERCENTAGE_FONT_SIZE, PERCENTAGE_VIEWPORT_HEIGHT, PERCENTAGE_VIEWPORT_SIZE, PERCENTAGE_VIEWPORT_WIDTH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
buildGraphicsNode
(BridgeContext ctx, Document doc, RootGraphicsNode node) Builds using the specified BridgeContext and element, the specified graphics node.createGraphicsNode
(BridgeContext ctx, Document doc) Creates aGraphicsNode
according to the specified parameters.void
dispose()
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.float
Returns 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 thisBridge
is dedicated to.Returns the namespace URI of the element thisBridge
is dedicated to.float
Returns the size of a px CSS unit in millimeters.float
Returns the size of a px CSS unit in millimeters.Returns the transform from the global transform space to pixels.float
Returns the height of the viewport which directly contains the associated element.float
Returns the width of the viewport which directly contains the associated element.void
Invoked when the animated value of an animated attribute has changed.void
Invoked when an CSSEngineEvent is fired.void
Invoked when an MutationEvent of type 'DOMAttrModified' is fired.void
Invoked when an MutationEvent of type 'DOMCharacterDataModified' is fired.void
Invoked when an MutationEvent of type 'DOMNodeInserted' is fired.void
Invoked when an MutationEvent of type 'DOMNodeRemoved' is fired.void
Invoked when an 'other' animation value has changed.void
Sets 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 thisBridge
is dedicated to. Returnsnull
, as a Document node has no namespace URI.- Specified by:
getNamespaceURI
in interfaceBridge
-
getLocalName
Returns the local name of the element thisBridge
is dedicated to. Returnsnull
, as a Document node has no local name.- Specified by:
getLocalName
in interfaceBridge
-
getInstance
Returns a new instance of this bridge.- Specified by:
getInstance
in interfaceBridge
-
createGraphicsNode
Creates aGraphicsNode
according 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:
createGraphicsNode
in 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:
buildGraphicsNode
in 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:
handleDOMAttrModifiedEvent
in interfaceBridgeUpdateHandler
-
handleDOMNodeInsertedEvent
Invoked when an MutationEvent of type 'DOMNodeInserted' is fired.- Specified by:
handleDOMNodeInsertedEvent
in interfaceBridgeUpdateHandler
-
handleDOMNodeRemovedEvent
Invoked when an MutationEvent of type 'DOMNodeRemoved' is fired.- Specified by:
handleDOMNodeRemovedEvent
in interfaceBridgeUpdateHandler
-
handleDOMCharacterDataModified
Invoked when an MutationEvent of type 'DOMCharacterDataModified' is fired.- Specified by:
handleDOMCharacterDataModified
in interfaceBridgeUpdateHandler
-
handleCSSEngineEvent
Invoked when an CSSEngineEvent is fired.- Specified by:
handleCSSEngineEvent
in interfaceBridgeUpdateHandler
-
handleAnimatedAttributeChanged
Invoked when the animated value of an animated attribute has changed.- Specified by:
handleAnimatedAttributeChanged
in interfaceBridgeUpdateHandler
-
handleOtherAnimationChanged
Invoked when an 'other' animation value has changed.- Specified by:
handleOtherAnimationChanged
in interfaceBridgeUpdateHandler
-
dispose
public void dispose()Disposes this BridgeUpdateHandler and releases all resources.- Specified by:
dispose
in interfaceBridgeUpdateHandler
-
getPixelUnitToMillimeter
public float getPixelUnitToMillimeter()Returns the size of a px CSS unit in millimeters.- Specified by:
getPixelUnitToMillimeter
in interfaceSVGContext
-
getPixelToMM
public float getPixelToMM()Returns the size of a px CSS unit in millimeters. This will be removed after next release.- Specified by:
getPixelToMM
in interfaceSVGContext
- See Also:
-
getBBox
Description copied from interface:SVGContext
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).- Specified by:
getBBox
in interfaceSVGContext
-
getScreenTransform
Description copied from interface:SVGContext
Returns the transform from the global transform space to pixels.- Specified by:
getScreenTransform
in interfaceSVGContext
-
setScreenTransform
Description copied from interface:SVGContext
Sets the transform to be used from the global transform space to pixels.- Specified by:
setScreenTransform
in interfaceSVGContext
-
getCTM
Description copied from interface:SVGContext
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.- Specified by:
getCTM
in interfaceSVGContext
-
getGlobalTransform
Description copied from interface:SVGContext
Returns the global transformation matrix from the current element to the root.- Specified by:
getGlobalTransform
in interfaceSVGContext
-
getViewportWidth
public float getViewportWidth()Description copied from interface:SVGContext
Returns the width of the viewport which directly contains the associated element.- Specified by:
getViewportWidth
in interfaceSVGContext
-
getViewportHeight
public float getViewportHeight()Description copied from interface:SVGContext
Returns the height of the viewport which directly contains the associated element.- Specified by:
getViewportHeight
in interfaceSVGContext
-
getFontSize
public float getFontSize()Description copied from interface:SVGContext
Returns the font-size on the associated element.- Specified by:
getFontSize
in interfaceSVGContext
-