public class SVGDocumentBridge extends java.lang.Object implements DocumentBridge, BridgeUpdateHandler, SVGContext
Modifier and Type | Field and Description |
---|---|
protected BridgeContext |
ctx
The bridge context.
|
protected Document |
document
The document node this bridge is associated with.
|
protected RootGraphicsNode |
node
The graphics node constructed by this bridge.
|
PERCENTAGE_FONT_SIZE, PERCENTAGE_VIEWPORT_HEIGHT, PERCENTAGE_VIEWPORT_SIZE, PERCENTAGE_VIEWPORT_WIDTH
Constructor and Description |
---|
SVGDocumentBridge()
Constructs a new bridge the SVG document.
|
Modifier and Type | Method and Description |
---|---|
void |
buildGraphicsNode(BridgeContext ctx,
Document doc,
RootGraphicsNode node)
Builds using the specified BridgeContext and element, the
specified graphics node.
|
RootGraphicsNode |
createGraphicsNode(BridgeContext ctx,
Document doc)
Creates a
GraphicsNode according to the specified parameters. |
void |
dispose()
Disposes this BridgeUpdateHandler and releases all resources.
|
java.awt.geom.Rectangle2D |
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).
|
java.awt.geom.AffineTransform |
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 |
getFontSize()
Returns the font-size on the associated element.
|
java.awt.geom.AffineTransform |
getGlobalTransform()
Returns the global transformation matrix from the current
element to the root.
|
Bridge |
getInstance()
Returns a new instance of this bridge.
|
java.lang.String |
getLocalName()
Returns the local name of the element this
Bridge is dedicated
to. |
java.lang.String |
getNamespaceURI()
Returns the namespace URI of the element this
Bridge is
dedicated to. |
float |
getPixelToMM()
Returns the size of a px CSS unit in millimeters.
|
float |
getPixelUnitToMillimeter()
Returns the size of a px CSS unit in millimeters.
|
java.awt.geom.AffineTransform |
getScreenTransform()
Returns the transform from the global transform space to pixels.
|
float |
getViewportHeight()
Returns the height of the viewport which directly contains the
associated element.
|
float |
getViewportWidth()
Returns the width of the viewport which directly contains the
associated element.
|
void |
handleAnimatedAttributeChanged(AnimatedLiveAttributeValue alav)
Invoked when the animated value of an animated attribute has changed.
|
void |
handleCSSEngineEvent(CSSEngineEvent evt)
Invoked when an CSSEngineEvent is fired.
|
void |
handleDOMAttrModifiedEvent(MutationEvent evt)
Invoked when an MutationEvent of type 'DOMAttrModified' is fired.
|
void |
handleDOMCharacterDataModified(MutationEvent evt)
Invoked when an MutationEvent of type 'DOMCharacterDataModified'
is fired.
|
void |
handleDOMNodeInsertedEvent(MutationEvent evt)
Invoked when an MutationEvent of type 'DOMNodeInserted' is fired.
|
void |
handleDOMNodeRemovedEvent(MutationEvent evt)
Invoked when an MutationEvent of type 'DOMNodeRemoved' is fired.
|
void |
handleOtherAnimationChanged(java.lang.String type)
Invoked when an 'other' animation value has changed.
|
void |
setScreenTransform(java.awt.geom.AffineTransform at)
Sets the transform to be used from the global transform space to pixels.
|
protected Document document
protected RootGraphicsNode node
protected BridgeContext ctx
public SVGDocumentBridge()
public java.lang.String getNamespaceURI()
Bridge
is
dedicated to. Returns null
, as a Document node has no
namespace URI.getNamespaceURI
in interface Bridge
public java.lang.String getLocalName()
Bridge
is dedicated
to. Returns null
, as a Document node has no local name.getLocalName
in interface Bridge
public Bridge getInstance()
getInstance
in interface Bridge
public RootGraphicsNode createGraphicsNode(BridgeContext ctx, Document doc)
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).createGraphicsNode
in interface DocumentBridge
ctx
- the bridge context to usedoc
- the document node that describes the graphics node to buildpublic void buildGraphicsNode(BridgeContext ctx, Document doc, RootGraphicsNode node)
buildGraphicsNode
in interface DocumentBridge
ctx
- the bridge context to usedoc
- the document node that describes the graphics node to buildnode
- the graphics node to buildpublic void handleDOMAttrModifiedEvent(MutationEvent evt)
handleDOMAttrModifiedEvent
in interface BridgeUpdateHandler
public void handleDOMNodeInsertedEvent(MutationEvent evt)
handleDOMNodeInsertedEvent
in interface BridgeUpdateHandler
public void handleDOMNodeRemovedEvent(MutationEvent evt)
handleDOMNodeRemovedEvent
in interface BridgeUpdateHandler
public void handleDOMCharacterDataModified(MutationEvent evt)
handleDOMCharacterDataModified
in interface BridgeUpdateHandler
public void handleCSSEngineEvent(CSSEngineEvent evt)
handleCSSEngineEvent
in interface BridgeUpdateHandler
public void handleAnimatedAttributeChanged(AnimatedLiveAttributeValue alav)
handleAnimatedAttributeChanged
in interface BridgeUpdateHandler
public void handleOtherAnimationChanged(java.lang.String type)
handleOtherAnimationChanged
in interface BridgeUpdateHandler
public void dispose()
dispose
in interface BridgeUpdateHandler
public float getPixelUnitToMillimeter()
getPixelUnitToMillimeter
in interface SVGContext
public float getPixelToMM()
getPixelToMM
in interface SVGContext
getPixelUnitToMillimeter()
public java.awt.geom.Rectangle2D getBBox()
SVGContext
getBBox
in interface SVGContext
public java.awt.geom.AffineTransform getScreenTransform()
SVGContext
getScreenTransform
in interface SVGContext
public void setScreenTransform(java.awt.geom.AffineTransform at)
SVGContext
setScreenTransform
in interface SVGContext
public java.awt.geom.AffineTransform getCTM()
SVGContext
getCTM
in interface SVGContext
public java.awt.geom.AffineTransform getGlobalTransform()
SVGContext
getGlobalTransform
in interface SVGContext
public float getViewportWidth()
SVGContext
getViewportWidth
in interface SVGContext
public float getViewportHeight()
SVGContext
getViewportHeight
in interface SVGContext
public float getFontSize()
SVGContext
getFontSize
in interface SVGContext
Copyright © 2022 Apache Software Foundation. All Rights Reserved.