|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.batik.bridge.AbstractSVGBridge
org.apache.batik.bridge.AnimatableSVGBridge
org.apache.batik.bridge.AbstractGraphicsNodeBridge
public abstract class AbstractGraphicsNodeBridge
The base bridge class for SVG graphics node. By default, the namespace URI is
the SVG namespace. Override the getNamespaceURI if you want to add
custom GraphicsNode with a custom namespace.
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 UnitProcessor.Context |
unitContext
The unit context for length conversions. |
| Fields inherited from class org.apache.batik.bridge.AnimatableSVGBridge |
|---|
ctx, e, targetListeners |
| Fields inherited from interface org.apache.batik.dom.svg.SVGContext |
|---|
PERCENTAGE_FONT_SIZE, PERCENTAGE_VIEWPORT_HEIGHT, PERCENTAGE_VIEWPORT_SIZE, PERCENTAGE_VIEWPORT_WIDTH |
| Fields inherited from interface org.apache.batik.bridge.ErrorConstants |
|---|
ERR_ATTRIBUTE_MISSING, ERR_ATTRIBUTE_VALUE_MALFORMED, ERR_CSS_LENGTH_NEGATIVE, ERR_CSS_URI_BAD_TARGET, ERR_LENGTH_NEGATIVE, ERR_URI_BAD_TARGET, ERR_URI_IMAGE_BROKEN, ERR_URI_IMAGE_INVALID, ERR_URI_IO, ERR_URI_MALFORMED, ERR_URI_REFERENCE_A_DOCUMENT, ERR_URI_UNSECURE, ERR_XLINK_HREF_CIRCULAR_DEPENDENCIES, URI_IMAGE_ERROR |
| 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(org.w3c.dom.svg.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 static void |
disposeTree(Node node)
Disposes all resources related to the specified node and its subtree. |
protected static 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. |
| Methods inherited from class org.apache.batik.bridge.AnimatableSVGBridge |
|---|
addTargetListener, fireBaseAttributeListeners, removeTargetListener |
| Methods inherited from class org.apache.batik.bridge.AbstractSVGBridge |
|---|
getInstance, getNamespaceURI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.batik.bridge.GraphicsNodeBridge |
|---|
getInstance, isComposite |
| Methods inherited from interface org.apache.batik.bridge.Bridge |
|---|
getLocalName, getNamespaceURI |
| Field Detail |
|---|
protected GraphicsNode node
protected boolean isSVG12
protected UnitProcessor.Context unitContext
protected SoftReference bboxShape
protected Rectangle2D bbox
| Constructor Detail |
|---|
protected AbstractGraphicsNodeBridge()
| Method Detail |
|---|
public GraphicsNode createGraphicsNode(BridgeContext ctx,
Element e)
GraphicsNode according to the specified parameters.
createGraphicsNode in interface GraphicsNodeBridgectx - the bridge context to usee - the element that describes the graphics node to build
protected abstract GraphicsNode instantiateGraphicsNode()
public void buildGraphicsNode(BridgeContext ctx,
Element e,
GraphicsNode node)
buildGraphicsNode in interface GraphicsNodeBridgectx - the bridge context to usee - the element that describes the graphics node to buildnode - the graphics node to buildpublic boolean getDisplay(Element e)
getDisplay in interface GraphicsNodeBridge
protected AffineTransform computeTransform(org.w3c.dom.svg.SVGTransformable te,
BridgeContext ctx)
AffineTransform that is the transformation to
be applied to the node.
protected void setTransform(GraphicsNode n,
Element e,
BridgeContext ctx)
protected void associateSVGContext(BridgeContext ctx,
Element e,
GraphicsNode node)
SVGContext with the element. This method should
be called even for static documents, since some bridges will need to
access animated attribute values even during the first build.
protected void initializeDynamicSupport(BridgeContext ctx,
Element e,
GraphicsNode node)
public void handleDOMAttrModifiedEvent(MutationEvent evt)
handleDOMAttrModifiedEvent in interface BridgeUpdateHandlerprotected void handleGeometryChanged()
protected void fireShapeChangeEvent()
public 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 dispose()
dispose in interface BridgeUpdateHandlerprotected static void disposeTree(Node node)
protected static void disposeTree(Node node,
boolean removeContext)
SVGContext.
public void handleCSSEngineEvent(CSSEngineEvent evt)
handleCSSEngineEvent in interface BridgeUpdateHandlerprotected void handleCSSPropertyChanged(int property)
public void handleAnimatedAttributeChanged(AnimatedLiveAttributeValue alav)
handleAnimatedAttributeChanged in interface BridgeUpdateHandlerpublic void handleOtherAnimationChanged(String type)
handleOtherAnimationChanged in interface BridgeUpdateHandlerprotected void checkBBoxChange()
protected void fireBBoxChangeEvent()
public float getPixelUnitToMillimeter()
getPixelUnitToMillimeter in interface SVGContextpublic float getPixelToMM()
getPixelToMM in interface SVGContextgetPixelUnitToMillimeter()public Rectangle2D getBBox()
getBBox in interface SVGContextpublic AffineTransform getCTM()
getCTM in interface SVGContextpublic AffineTransform getScreenTransform()
getScreenTransform in interface SVGContextpublic void setScreenTransform(AffineTransform at)
setScreenTransform in interface SVGContextpublic AffineTransform getGlobalTransform()
getGlobalTransform in interface SVGContextpublic float getViewportWidth()
getViewportWidth in interface SVGContextpublic float getViewportHeight()
getViewportHeight in interface SVGContextpublic float getFontSize()
getFontSize in interface SVGContext
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||