org.apache.batik.bridge
public abstract class AbstractGraphicsNodeBridge extends AnimatableSVGBridge implements SVGContext, BridgeUpdateHandler, GraphicsNodeBridge, ErrorConstants
This class handles various attributes that are defined on most of the SVG graphic elements as described in the SVG specification.
Field Summary | |
---|---|
protected Rectangle2D | bbox |
protected SoftReference | bboxShape |
protected boolean | isSVG12
Whether the document is an SVG 1.2 document. |
protected GraphicsNode | node
The graphics node constructed by this bridge. |
protected Context | unitContext
The unit context for length conversions. |
Constructor Summary | |
---|---|
protected | AbstractGraphicsNodeBridge()
Constructs a new abstract bridge. |
Method Summary | |
---|---|
protected void | associateSVGContext(BridgeContext ctx, Element e, GraphicsNode node)
Associates the SVGContext with the element. |
void | buildGraphicsNode(BridgeContext ctx, Element e, GraphicsNode node)
Builds using the specified BridgeContext and element, the
specified graphics node.
|
protected void | checkBBoxChange()
Checks if the bounding box of the node has changed, and if so,
fires a bboxchange event on the element. |
protected AffineTransform | computeTransform(SVGTransformable te, BridgeContext ctx)
Returns an AffineTransform that is the transformation to
be applied to the node. |
GraphicsNode | createGraphicsNode(BridgeContext ctx, Element e)
Creates a GraphicsNode according to the specified parameters.
|
void | dispose()
Disposes this BridgeUpdateHandler and releases all resources. |
protected void | disposeTree(Node node)
Disposes all resources related to the specified node and its subtree. |
protected void | disposeTree(Node node, boolean removeContext)
Disposes all resources related to the specified node and its subtree,
and optionally removes the nodes' SVGContext. |
protected void | fireBBoxChangeEvent()
Fires an svg:bboxchange event on the element. |
protected void | fireShapeChangeEvent()
Fires a ShapeChange event on the element this bridge is managing. |
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. |
boolean | getDisplay(Element e)
Returns true if the graphics node has to be displayed, false
otherwise. |
float | getFontSize()
Returns the font-size on the associated element. |
AffineTransform | getGlobalTransform()
Returns the global transformation matrix from the current
element to the root. |
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 display transform. |
float | getViewportHeight()
Returns the height of the viewport which directly contains the
given element. |
float | getViewportWidth()
Returns the width of the viewport which directly contains the
given element. |
void | handleAnimatedAttributeChanged(AnimatedLiveAttributeValue alav)
Invoked when the animated value of an animatable attribute has changed. |
void | handleCSSEngineEvent(CSSEngineEvent evt)
Invoked when an CSSEngineEvent is fired. |
protected void | handleCSSPropertyChanged(int property)
Invoked for each CSS property that has changed. |
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. |
protected void | handleGeometryChanged()
Invoked when the geometry of a graphical element has changed. |
void | handleOtherAnimationChanged(String type)
Invoked when an 'other' animation value has changed. |
protected void | initializeDynamicSupport(BridgeContext ctx, Element e, GraphicsNode node)
This method is invoked during the build phase if the document
is dynamic. |
protected abstract GraphicsNode | instantiateGraphicsNode()
Creates the GraphicsNode depending on the GraphicsNodeBridge
implementation. |
void | setScreenTransform(AffineTransform at)
Sets the display transform. |
protected void | setTransform(GraphicsNode n, Element e, BridgeContext ctx)
Sets the graphics node's transform to the current animated transform
value. |
Parameters: ctx the bridge context to use e the element that describes the graphics node to build node the graphics node to build
Parameters: ctx the bridge context to use e the element that describes the graphics node to build
Returns: a graphics node that represents the specified element
See Also: getPixelUnitToMillimeter