public class SVGDocumentBridge extends 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.
|
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).
|
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.
|
AffineTransform |
getGlobalTransform()
Returns the global transformation matrix from the current
element to the root.
|
Bridge |
getInstance()
Returns a new instance of this bridge.
|
String |
getLocalName()
Returns the local name of the element this
Bridge is dedicated
to. |
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.
|
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(String type)
Invoked when an 'other' animation value has changed.
|
void |
setScreenTransform(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 String getNamespaceURI()
Bridge is
dedicated to. Returns null, as a Document node has no
namespace URI.getNamespaceURI in interface Bridgepublic String getLocalName()
Bridge is dedicated
to. Returns null, as a Document node has no local name.getLocalName in interface Bridgepublic Bridge getInstance()
getInstance in interface Bridgepublic 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 DocumentBridgectx - 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 DocumentBridgectx - 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 BridgeUpdateHandlerpublic void handleDOMNodeInsertedEvent(MutationEvent evt)
handleDOMNodeInsertedEvent in interface BridgeUpdateHandlerpublic void handleDOMNodeRemovedEvent(MutationEvent evt)
handleDOMNodeRemovedEvent in interface BridgeUpdateHandlerpublic void handleDOMCharacterDataModified(MutationEvent evt)
handleDOMCharacterDataModified in interface BridgeUpdateHandlerpublic void handleCSSEngineEvent(CSSEngineEvent evt)
handleCSSEngineEvent in interface BridgeUpdateHandlerpublic void handleAnimatedAttributeChanged(AnimatedLiveAttributeValue alav)
handleAnimatedAttributeChanged in interface BridgeUpdateHandlerpublic void handleOtherAnimationChanged(String type)
handleOtherAnimationChanged in interface BridgeUpdateHandlerpublic void dispose()
dispose in interface BridgeUpdateHandlerpublic float getPixelUnitToMillimeter()
getPixelUnitToMillimeter in interface SVGContextpublic float getPixelToMM()
getPixelToMM in interface SVGContextgetPixelUnitToMillimeter()public Rectangle2D getBBox()
SVGContextgetBBox in interface SVGContextpublic AffineTransform getScreenTransform()
SVGContextgetScreenTransform in interface SVGContextpublic void setScreenTransform(AffineTransform at)
SVGContextsetScreenTransform in interface SVGContextpublic AffineTransform getCTM()
SVGContextgetCTM in interface SVGContextpublic AffineTransform getGlobalTransform()
SVGContextgetGlobalTransform in interface SVGContextpublic float getViewportWidth()
SVGContextgetViewportWidth in interface SVGContextpublic float getViewportHeight()
SVGContextgetViewportHeight in interface SVGContextpublic float getFontSize()
SVGContextgetFontSize in interface SVGContextCopyright © 2000–2017 Apache Software Foundation. All rights reserved.