|
|||||||||
| Home >> All >> org >> apache >> batik >> [ bridge overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.batik.bridge
Class BridgeContext

java.lang.Objectorg.apache.batik.bridge.BridgeContext
- All Implemented Interfaces:
- org.apache.batik.css.engine.CSSContext, ErrorConstants
- public class BridgeContext
- extends java.lang.Object
- implements ErrorConstants, org.apache.batik.css.engine.CSSContext
- extends java.lang.Object
This class represents a context used by the various bridges and the builder. A bridge context is associated to a particular document and cannot be reused. The context encapsulates the dynamic bindings between DOM elements and GVT nodes, graphic contexts such as a GraphicsNodeRenderContext, and the different objects required by the GVT builder to interpret a SVG DOM tree such as the current viewport or the user agent.
- Version:
- $Id: BridgeContext.java,v 1.83 2005/03/29 10:48:02 deweese Exp $
| Nested Class Summary | |
static class |
BridgeContext.CSSEngineUserAgentWrapper
|
protected class |
BridgeContext.CSSPropertiesChangedListener
The CSSEngineListener invoked when CSS properties are modified on a particular element. |
protected class |
BridgeContext.DOMAttrModifiedEventListener
The DOM EventListener invoked when an attribute is modified. |
protected class |
BridgeContext.DOMCharacterDataModifiedListener
The DOM EventListener invoked when a character data is changed. |
protected class |
BridgeContext.DOMMouseOutEventListener
The DOM EventListener invoked when the mouse exits an element |
protected class |
BridgeContext.DOMMouseOverEventListener
The DOM EventListener invoked when the mouse mouves over a new element. |
protected class |
BridgeContext.DOMNodeInsertedEventListener
The DOM EventListener invoked when a node is added. |
protected class |
BridgeContext.DOMNodeRemovedEventListener
The DOM EventListener invoked when a node is removed. |
protected static class |
BridgeContext.EventListenerMememto
A class used to store an EventListener added to the DOM. |
static class |
BridgeContext.SoftReferenceMememto
|
| Field Summary | |
protected org.apache.batik.css.engine.CSSEngineListener |
cssPropertiesChangedListener
The CSSEngine listener to receive CSSEngineEvent. |
protected CursorManager |
cursorManager
Manages cursors and performs caching when appropriate |
protected org.w3c.dom.Document |
document
The document is bridge context is dedicated to. |
protected DocumentLoader |
documentLoader
The document loader used to load/create Document. |
protected java.awt.geom.Dimension2D |
documentSize
The size of the document. |
protected org.w3c.dom.events.EventListener |
domAttrModifiedEventListener
The DOM EventListener to receive 'DOMAttrModified' event. |
protected org.w3c.dom.events.EventListener |
domCharacterDataModifiedListener
The DOM EventListener to receive 'DOMCharacterDataModified' event. |
protected org.w3c.dom.events.EventListener |
domNodeInsertedEventListener
The DOM EventListener to receive 'DOMNodeInserted' event. |
protected org.w3c.dom.events.EventListener |
domNodeRemovedEventListener
The DOM EventListener to receive 'DOMNodeRemoved' event. |
static int |
DYNAMIC
Indicates that all DOM listeners should be registered. |
protected int |
dynamicStatus
Whether the bridge should support dynamic, or interactive features. |
protected java.util.Map |
elementDataMap
Element Data Map: This is a general location for elements to 'cache' data. |
protected java.util.Map |
elementNodeMap
Binding Map: key is an SVG Element - value is a GraphicsNode |
protected java.util.Set |
eventListenerSet
The list of all EventListener attached by bridges that need to be removed on a dispose() call. |
protected java.util.List |
extensions
|
protected FocusManager |
focusManager
The EventListener that is responsible of managing DOM focus event. |
private java.util.Map |
fontFamilyMap
A Map of all the font families already matched. |
protected static java.util.List |
globalExtensions
Returns the extensions supported by this bridge context. |
protected GVTBuilder |
gvtBuilder
The GVT builder that might be used to create a GVT subtree. |
static int |
INTERACTIVE
Indicates that DOM listeners should be registered to support, 'interactivity' this includes anchors and cursors, but does not include support for DOM modifications. |
protected java.util.Map |
interpreterMap
The interpreter cache per document. |
protected org.apache.batik.script.InterpreterPool |
interpreterPool
The interpreter pool used to handle scripts. |
protected java.util.Map |
namespaceURIMap
Bridge Map: Keys are namespace URI - values are HashMap (with keys are local name and values are a Bridge instance). |
protected java.util.Map |
nodeElementMap
Binding Map: key is GraphicsNode - value is a SVG Element. |
private static org.apache.batik.script.InterpreterPool |
sharedPool
By default we share a unique instance of InterpreterPool. |
static int |
STATIC
Indicates that no DOM listeners should be registered. |
protected org.apache.batik.gvt.TextPainter |
textPainter
The text painter to use. |
protected UpdateManager |
updateManager
The update manager. |
protected UserAgent |
userAgent
The user agent. |
protected java.util.Map |
viewportMap
The viewports. |
protected java.util.List |
viewportStack
The viewport stack. |
| 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_INVALID, ERR_URI_IO, ERR_URI_MALFORMED, ERR_URI_REFERENCE_A_DOCUMENT, ERR_URI_UNSECURE, ERR_XLINK_HREF_CIRCULAR_DEPENDENCIES, MSG_BROKEN_LINK_TITLE |
| Constructor Summary | |
protected |
BridgeContext()
Constructs a new empty bridge context. |
|
BridgeContext(UserAgent userAgent)
Constructs a new bridge context. |
|
BridgeContext(UserAgent userAgent,
DocumentLoader loader)
Constructs a new bridge context. |
|
BridgeContext(UserAgent userAgent,
org.apache.batik.script.InterpreterPool interpreterPool,
DocumentLoader documentLoader)
Constructs a new bridge context. |
| Method Summary | |
void |
addDOMListeners()
Adds EventListeners to the DOM and CSSEngineListener to the CSSEngine to handle any modifications on the DOM tree or style properties and update the GVT tree in response. |
void |
addUIEventListeners(org.w3c.dom.Document doc)
Adds EventListeners to the input document to handle the cursor property. |
void |
bind(org.w3c.dom.Element element,
org.apache.batik.gvt.GraphicsNode node)
Binds the specified GraphicsNode to the specified Element. |
boolean |
checkInteractiveElement(org.w3c.dom.Element e)
used by isInteractiveDocument to check if document contains any 'interactive' elements. |
boolean |
checkInteractiveElement(org.w3c.dom.svg.SVGDocument doc,
org.w3c.dom.Element e)
used by isInteractiveDocument to check if document contains any 'interactive' elements. |
void |
checkLoadExternalResource(org.apache.batik.util.ParsedURL resourceURL,
org.apache.batik.util.ParsedURL docURL)
This method throws a SecurityException if the resource found at url and referenced from docURL should not be loaded. |
void |
closeViewport(org.w3c.dom.Element e)
Closes the viewport associated to the specified element. |
void |
dispose()
Disposes this BridgeContext. |
float |
getBlockHeight(org.w3c.dom.Element elt)
Returns the height of the block which directly contains the given element. |
float |
getBlockWidth(org.w3c.dom.Element elt)
Returns the width of the block which directly contains the given element. |
float |
getBolderFontWeight(float f)
Returns a bolder font-weight. |
Bridge |
getBridge(org.w3c.dom.Element element)
Returns the bridge associated with the specified element. |
Bridge |
getBridge(java.lang.String namespaceURI,
java.lang.String localName)
Returns the bridge associated with the element type |
java.util.List |
getBridgeExtensions(org.w3c.dom.Document doc)
|
protected static BridgeUpdateHandler |
getBridgeUpdateHandler(org.w3c.dom.Node node)
Returns the SVGContext associated to the specified Node or null if any. |
org.apache.batik.css.engine.CSSEngine |
getCSSEngineForElement(org.w3c.dom.Element e)
Returns the CSS engine associated with given element. |
CursorManager |
getCursorManager()
Returns the cursor manager |
org.apache.batik.css.engine.value.Value |
getDefaultFontFamily()
Returns the value corresponding to the default font. |
org.w3c.dom.Document |
getDocument()
Returns the document this bridge context is dedicated to. |
DocumentLoader |
getDocumentLoader()
Returns the document loader used to load external documents. |
java.awt.geom.Dimension2D |
getDocumentSize()
Returns the actual size of the document or null if the document has not been built yet. |
org.w3c.dom.Element |
getElement(org.apache.batik.gvt.GraphicsNode node)
Returns the Element associated to the specified GraphicsNode or null if any. |
java.lang.Object |
getElementData(org.w3c.dom.Node n)
Set Element Data. |
FocusManager |
getFocusManager()
Returns the focus manager. |
java.util.Map |
getFontFamilyMap()
Returns the map of font families |
static java.util.List |
getGlobalBridgeExtensions()
|
org.apache.batik.gvt.GraphicsNode |
getGraphicsNode(org.w3c.dom.Element element)
Returns the GraphicsNode associated to the specified Element or null if any. |
GVTBuilder |
getGVTBuilder()
Returns the GVT builder that is currently used to build the GVT tree. |
org.apache.batik.script.Interpreter |
getInterpreter(java.lang.String language)
Returns a Interpreter for the specified language. |
org.apache.batik.script.InterpreterPool |
getInterpreterPool()
Returns the interpreter pool used to handle scripts. |
float |
getLighterFontWeight(float f)
Returns a lighter font-weight. |
float |
getMediumFontSize()
Returns the medium font size. |
float |
getPixelToMillimeter()
Returns the size of a px CSS unit in millimeters. |
float |
getPixelUnitToMillimeter()
Returns the size of a px CSS unit in millimeters. |
org.w3c.dom.Element |
getReferencedElement(org.w3c.dom.Element e,
java.lang.String uri)
Returns the element referenced by the specified element by the specified uri. |
protected static org.apache.batik.dom.svg.SVGContext |
getSVGContext(org.w3c.dom.Node node)
Returns the SVGContext associated to the specified Node or null if any. |
org.apache.batik.css.engine.value.Value |
getSystemColor(java.lang.String ident)
Returns the Value corresponding to the given system color. |
org.apache.batik.gvt.TextPainter |
getTextPainter()
Returns the text painter that will be used be text nodes. |
UpdateManager |
getUpdateManager()
Returns the update manager, if the bridge supports dynamic features. |
UserAgent |
getUserAgent()
Returns the user agent of this bridge context. |
Viewport |
getViewport(org.w3c.dom.Element e)
Returns the viewport of the specified element. |
boolean |
hasGraphicsNodeBridge(org.w3c.dom.Element element)
Returns true if the specified element has a GraphicsNodeBridge associated to it, false otherwise. |
protected void |
initializeDocument(org.w3c.dom.Document document)
Initializes the given document. |
boolean |
isDynamic()
Returns true if the document is dynamic, false otherwise. |
boolean |
isDynamicDocument(org.w3c.dom.Document doc)
Tells whether the given SVG document is dynamic. |
boolean |
isInteractive()
Returns true if the document is interactive, false otherwise. |
boolean |
isInteractiveDocument(org.w3c.dom.Document doc)
Tells whether the given SVG document is Interactive. |
void |
openViewport(org.w3c.dom.Element e,
Viewport viewport)
Starts a new viewport from the specified element. |
void |
putBridge(Bridge bridge)
Associates the specified Bridge object with it's namespace URI and local name. |
void |
putBridge(java.lang.String namespaceURI,
java.lang.String localName,
Bridge bridge)
Associates the specified Bridge object with the specified namespace URI and local name. |
void |
registerSVGBridges()
Registers the bridges to handle SVG 1.0 elements. |
void |
removeBridge(java.lang.String namespaceURI,
java.lang.String localName)
Removes the Bridge object associated to the specified namespace URI and local name. |
void |
removeUIEventListeners(org.w3c.dom.Document doc)
|
void |
removeViewport(org.w3c.dom.Element e)
|
protected void |
setDocument(org.w3c.dom.Document document)
Sets the document this bridge context is dedicated to, to the specified document. |
protected void |
setDocumentLoader(DocumentLoader newDocumentLoader)
Sets the document loader used to load external documents. |
protected void |
setDocumentSize(java.awt.geom.Dimension2D d)
Sets the size of the document to the specified dimension. |
void |
setDynamic(boolean dynamic)
Sets the document as DYNAMIC if dynamic is true STATIC otherwise. |
void |
setDynamicState(int status)
Sets the document as a STATIC, INTERACTIVE or DYNAMIC document. |
void |
setElementData(org.w3c.dom.Node n,
java.lang.Object data)
Set Element Data. |
protected void |
setFontFamilyMap(java.util.Map fontFamilyMap)
Sets the map of font families to the specified value. |
protected void |
setGVTBuilder(GVTBuilder gvtBuilder)
Sets the GVT builder that uses this context. |
void |
setInteractive(boolean interactive)
Sets the document as INTERACTIVE if interactive is true STATIC otherwise. |
protected void |
setInterpreterPool(org.apache.batik.script.InterpreterPool interpreterPool)
Sets the interpreter pool used to handle scripts to the specified interpreter pool. |
void |
setTextPainter(org.apache.batik.gvt.TextPainter textPainter)
Sets the text painter that will be used by text nodes. |
protected void |
setUpdateManager(UpdateManager um)
Sets the update manager. |
protected void |
setUserAgent(UserAgent userAgent)
Sets the user agent to the specified user agent. |
protected void |
storeEventListener(org.w3c.dom.events.EventTarget t,
java.lang.String s,
org.w3c.dom.events.EventListener l,
boolean b)
Adds to the eventListenerSet the specified event listener registration. |
void |
unbind(org.w3c.dom.Element element)
Removes the binding of the specified Element. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
document
protected org.w3c.dom.Document document
- The document is bridge context is dedicated to.
gvtBuilder
protected GVTBuilder gvtBuilder
- The GVT builder that might be used to create a GVT subtree.
interpreterMap
protected java.util.Map interpreterMap
- The interpreter cache per document.
key is the language -
value is a Interpreter
fontFamilyMap
private java.util.Map fontFamilyMap
- A Map of all the font families already matched. This is
to reduce the number of instances of GVTFontFamilies and to
hopefully reduce the time taken to search for a matching SVG font.
viewportMap
protected java.util.Map viewportMap
- The viewports.
key is an Element -
value is a Viewport
viewportStack
protected java.util.List viewportStack
- The viewport stack. Used in building time.
userAgent
protected UserAgent userAgent
- The user agent.
elementNodeMap
protected java.util.Map elementNodeMap
- Binding Map:
key is an SVG Element -
value is a GraphicsNode
nodeElementMap
protected java.util.Map nodeElementMap
- Binding Map:
key is GraphicsNode -
value is a SVG Element.
namespaceURIMap
protected java.util.Map namespaceURIMap
- Bridge Map:
Keys are namespace URI - values are HashMap (with keys are local
name and values are a Bridge instance).
elementDataMap
protected java.util.Map elementDataMap
- Element Data Map:
This is a general location for elements to 'cache'
data. Such as the graphics tree for a pattern or
the Gradient arrays.
This is a weak hash map and the data is referenced
by SoftReference so both must be referenced elsewhere
to stay live.
interpreterPool
protected org.apache.batik.script.InterpreterPool interpreterPool
- The interpreter pool used to handle scripts.
documentLoader
protected DocumentLoader documentLoader
- The document loader used to load/create Document.
documentSize
protected java.awt.geom.Dimension2D documentSize
- The size of the document.
textPainter
protected org.apache.batik.gvt.TextPainter textPainter
- The text painter to use. Typically, you can specify the text painter that
will be used be text nodes.
STATIC
public static final int STATIC
- Indicates that no DOM listeners should be registered. In this
case the generated GVT tree should be totally independent of
the DOM tree (in practice text holds references to the source
text elements for font resolution).
- See Also:
- Constant Field Values
INTERACTIVE
public static final int INTERACTIVE
- Indicates that DOM listeners should be registered to support,
'interactivity' this includes anchors and cursors, but does not
include support for DOM modifications.
- See Also:
- Constant Field Values
DYNAMIC
public static final int DYNAMIC
- Indicates that all DOM listeners should be registered. This supports
'interactivity' (anchors and cursors), as well as DOM modifications
listeners to update the GVT rendering tree.
- See Also:
- Constant Field Values
dynamicStatus
protected int dynamicStatus
- Whether the bridge should support dynamic, or interactive features.
updateManager
protected UpdateManager updateManager
- The update manager.
sharedPool
private static org.apache.batik.script.InterpreterPool sharedPool
- By default we share a unique instance of InterpreterPool.
eventListenerSet
protected java.util.Set eventListenerSet
- The list of all EventListener attached by bridges that need to
be removed on a dispose() call.
domCharacterDataModifiedListener
protected org.w3c.dom.events.EventListener domCharacterDataModifiedListener
- The DOM EventListener to receive 'DOMCharacterDataModified' event.
domAttrModifiedEventListener
protected org.w3c.dom.events.EventListener domAttrModifiedEventListener
- The DOM EventListener to receive 'DOMAttrModified' event.
domNodeInsertedEventListener
protected org.w3c.dom.events.EventListener domNodeInsertedEventListener
- The DOM EventListener to receive 'DOMNodeInserted' event.
domNodeRemovedEventListener
protected org.w3c.dom.events.EventListener domNodeRemovedEventListener
- The DOM EventListener to receive 'DOMNodeRemoved' event.
cssPropertiesChangedListener
protected org.apache.batik.css.engine.CSSEngineListener cssPropertiesChangedListener
- The CSSEngine listener to receive CSSEngineEvent.
focusManager
protected FocusManager focusManager
- The EventListener that is responsible of managing DOM focus event.
cursorManager
protected CursorManager cursorManager
- Manages cursors and performs caching when appropriate
extensions
protected java.util.List extensions
globalExtensions
protected static java.util.List globalExtensions
- Returns the extensions supported by this bridge context.
| Constructor Detail |
BridgeContext
protected BridgeContext()
- Constructs a new empty bridge context.
BridgeContext
public BridgeContext(UserAgent userAgent)
- Constructs a new bridge context.
BridgeContext
public BridgeContext(UserAgent userAgent, DocumentLoader loader)
- Constructs a new bridge context.
BridgeContext
public BridgeContext(UserAgent userAgent, org.apache.batik.script.InterpreterPool interpreterPool, DocumentLoader documentLoader)
- Constructs a new bridge context.
| Method Detail |
initializeDocument
protected void initializeDocument(org.w3c.dom.Document document)
- Initializes the given document.
getCSSEngineForElement
public org.apache.batik.css.engine.CSSEngine getCSSEngineForElement(org.w3c.dom.Element e)
- Returns the CSS engine associated with given element.
- Specified by:
getCSSEngineForElementin interfaceorg.apache.batik.css.engine.CSSContext
setTextPainter
public void setTextPainter(org.apache.batik.gvt.TextPainter textPainter)
- Sets the text painter that will be used by text nodes. This attributes
might be used by bridges (especially SVGTextElementBridge) to set the
text painter of each TextNode.
getTextPainter
public org.apache.batik.gvt.TextPainter getTextPainter()
- Returns the text painter that will be used be text nodes.
getDocument
public org.w3c.dom.Document getDocument()
- Returns the document this bridge context is dedicated to.
setDocument
protected void setDocument(org.w3c.dom.Document document)
- Sets the document this bridge context is dedicated to, to the
specified document.
getFontFamilyMap
public java.util.Map getFontFamilyMap()
- Returns the map of font families
setFontFamilyMap
protected void setFontFamilyMap(java.util.Map fontFamilyMap)
- Sets the map of font families to the specified value.
setElementData
public void setElementData(org.w3c.dom.Node n, java.lang.Object data)
- Set Element Data.
Associates data object with element so it can be
retrieved later.
getElementData
public java.lang.Object getElementData(org.w3c.dom.Node n)
- Set Element Data.
Associates data object with element so it can be
retrieved later.
getUserAgent
public UserAgent getUserAgent()
- Returns the user agent of this bridge context.
setUserAgent
protected void setUserAgent(UserAgent userAgent)
- Sets the user agent to the specified user agent.
getGVTBuilder
public GVTBuilder getGVTBuilder()
- Returns the GVT builder that is currently used to build the GVT tree.
setGVTBuilder
protected void setGVTBuilder(GVTBuilder gvtBuilder)
- Sets the GVT builder that uses this context.
getInterpreterPool
public org.apache.batik.script.InterpreterPool getInterpreterPool()
- Returns the interpreter pool used to handle scripts.
getFocusManager
public FocusManager getFocusManager()
- Returns the focus manager.
getCursorManager
public CursorManager getCursorManager()
- Returns the cursor manager
setInterpreterPool
protected void setInterpreterPool(org.apache.batik.script.InterpreterPool interpreterPool)
- Sets the interpreter pool used to handle scripts to the
specified interpreter pool.
getInterpreter
public org.apache.batik.script.Interpreter getInterpreter(java.lang.String language)
- Returns a Interpreter for the specified language.
getDocumentLoader
public DocumentLoader getDocumentLoader()
- Returns the document loader used to load external documents.
setDocumentLoader
protected void setDocumentLoader(DocumentLoader newDocumentLoader)
- Sets the document loader used to load external documents.
getDocumentSize
public java.awt.geom.Dimension2D getDocumentSize()
- Returns the actual size of the document or null if the document
has not been built yet.
setDocumentSize
protected void setDocumentSize(java.awt.geom.Dimension2D d)
- Sets the size of the document to the specified dimension.
isDynamic
public boolean isDynamic()
- Returns true if the document is dynamic, false otherwise.
- Specified by:
isDynamicin interfaceorg.apache.batik.css.engine.CSSContext
isInteractive
public boolean isInteractive()
- Returns true if the document is interactive, false otherwise.
- Specified by:
isInteractivein interfaceorg.apache.batik.css.engine.CSSContext
setDynamicState
public void setDynamicState(int status)
- Sets the document as a STATIC, INTERACTIVE or DYNAMIC document.
Call this method before the build phase
(ie. before gvtBuilder.build(...))
otherwise, that will have no effect.
setDynamic
public void setDynamic(boolean dynamic)
- Sets the document as DYNAMIC if dynamic is true
STATIC otherwise.
setInteractive
public void setInteractive(boolean interactive)
- Sets the document as INTERACTIVE if interactive is
true STATIC otherwise.
getUpdateManager
public UpdateManager getUpdateManager()
- Returns the update manager, if the bridge supports dynamic features.
setUpdateManager
protected void setUpdateManager(UpdateManager um)
- Sets the update manager.
getReferencedElement
public org.w3c.dom.Element getReferencedElement(org.w3c.dom.Element e, java.lang.String uri)
- Returns the element referenced by the specified element by the
specified uri. The referenced element can not be a Document.
getViewport
public Viewport getViewport(org.w3c.dom.Element e)
- Returns the viewport of the specified element.
openViewport
public void openViewport(org.w3c.dom.Element e, Viewport viewport)
- Starts a new viewport from the specified element.
removeViewport
public void removeViewport(org.w3c.dom.Element e)
closeViewport
public void closeViewport(org.w3c.dom.Element e)
- Closes the viewport associated to the specified element.
bind
public void bind(org.w3c.dom.Element element, org.apache.batik.gvt.GraphicsNode node)
- Binds the specified GraphicsNode to the specified Element. This method
automatically bind the graphics node to the element and the element to
the graphics node.
unbind
public void unbind(org.w3c.dom.Element element)
- Removes the binding of the specified Element.
getGraphicsNode
public org.apache.batik.gvt.GraphicsNode getGraphicsNode(org.w3c.dom.Element element)
- Returns the GraphicsNode associated to the specified Element or
null if any.
getElement
public org.w3c.dom.Element getElement(org.apache.batik.gvt.GraphicsNode node)
- Returns the Element associated to the specified GraphicsNode or
null if any.
hasGraphicsNodeBridge
public boolean hasGraphicsNodeBridge(org.w3c.dom.Element element)
- Returns true if the specified element has a GraphicsNodeBridge
associated to it, false otherwise.
getBridge
public Bridge getBridge(org.w3c.dom.Element element)
- Returns the bridge associated with the specified element.
getBridge
public Bridge getBridge(java.lang.String namespaceURI, java.lang.String localName)
- Returns the bridge associated with the element type
putBridge
public void putBridge(java.lang.String namespaceURI, java.lang.String localName, Bridge bridge)
- Associates the specified Bridge object with the specified
namespace URI and local name.
putBridge
public void putBridge(Bridge bridge)
- Associates the specified Bridge object with it's
namespace URI and local name.
removeBridge
public void removeBridge(java.lang.String namespaceURI, java.lang.String localName)
- Removes the Bridge object associated to the specified
namespace URI and local name.
addUIEventListeners
public void addUIEventListeners(org.w3c.dom.Document doc)
- Adds EventListeners to the input document to handle the cursor
property.
This is not done in the addDOMListeners method because
addDOMListeners is only used for dynamic content whereas
cursor support is provided for all content.
Also note that it is very important that the listeners be
registered for the capture phase as the 'default' behavior
for cursors is handled by the BridgeContext during the
capture phase and the 'custom' behavior (handling of 'auto'
on anchors, for example), is handled during the bubling phase.
removeUIEventListeners
public void removeUIEventListeners(org.w3c.dom.Document doc)
addDOMListeners
public void addDOMListeners()
- Adds EventListeners to the DOM and CSSEngineListener to the
CSSEngine to handle any modifications on the DOM tree or style
properties and update the GVT tree in response.
storeEventListener
protected void storeEventListener(org.w3c.dom.events.EventTarget t, java.lang.String s, org.w3c.dom.events.EventListener l, boolean b)
- Adds to the eventListenerSet the specified event listener
registration.
dispose
public void dispose()
- Disposes this BridgeContext.
getSVGContext
protected static org.apache.batik.dom.svg.SVGContext getSVGContext(org.w3c.dom.Node node)
- Returns the SVGContext associated to the specified Node or null if any.
getBridgeUpdateHandler
protected static BridgeUpdateHandler getBridgeUpdateHandler(org.w3c.dom.Node node)
- Returns the SVGContext associated to the specified Node or null if any.
getSystemColor
public org.apache.batik.css.engine.value.Value getSystemColor(java.lang.String ident)
- Returns the Value corresponding to the given system color.
- Specified by:
getSystemColorin interfaceorg.apache.batik.css.engine.CSSContext
getDefaultFontFamily
public org.apache.batik.css.engine.value.Value getDefaultFontFamily()
- Returns the value corresponding to the default font.
- Specified by:
getDefaultFontFamilyin interfaceorg.apache.batik.css.engine.CSSContext
getLighterFontWeight
public float getLighterFontWeight(float f)
- Returns a lighter font-weight.
- Specified by:
getLighterFontWeightin interfaceorg.apache.batik.css.engine.CSSContext
getBolderFontWeight
public float getBolderFontWeight(float f)
- Returns a bolder font-weight.
- Specified by:
getBolderFontWeightin interfaceorg.apache.batik.css.engine.CSSContext
getPixelUnitToMillimeter
public float getPixelUnitToMillimeter()
- Returns the size of a px CSS unit in millimeters.
- Specified by:
getPixelUnitToMillimeterin interfaceorg.apache.batik.css.engine.CSSContext
getPixelToMillimeter
public float getPixelToMillimeter()
- Returns the size of a px CSS unit in millimeters.
This will be removed after next release.
- Specified by:
getPixelToMillimeterin interfaceorg.apache.batik.css.engine.CSSContext
getMediumFontSize
public float getMediumFontSize()
- Returns the medium font size.
- Specified by:
getMediumFontSizein interfaceorg.apache.batik.css.engine.CSSContext
getBlockWidth
public float getBlockWidth(org.w3c.dom.Element elt)
- Returns the width of the block which directly contains the
given element.
- Specified by:
getBlockWidthin interfaceorg.apache.batik.css.engine.CSSContext
getBlockHeight
public float getBlockHeight(org.w3c.dom.Element elt)
- Returns the height of the block which directly contains the
given element.
- Specified by:
getBlockHeightin interfaceorg.apache.batik.css.engine.CSSContext
checkLoadExternalResource
public void checkLoadExternalResource(org.apache.batik.util.ParsedURL resourceURL, org.apache.batik.util.ParsedURL docURL) throws java.lang.SecurityException
- This method throws a SecurityException if the resource
found at url and referenced from docURL
should not be loaded.
This is a convenience method to call checkLoadExternalResource
on the ExternalResourceSecurity strategy returned by
getExternalResourceSecurity.
- Specified by:
checkLoadExternalResourcein interfaceorg.apache.batik.css.engine.CSSContext
isDynamicDocument
public boolean isDynamicDocument(org.w3c.dom.Document doc)
- Tells whether the given SVG document is dynamic.
isInteractiveDocument
public boolean isInteractiveDocument(org.w3c.dom.Document doc)
- Tells whether the given SVG document is Interactive.
We say it is, if it has any <title>, <desc>, or <a> elements,
of if the 'cursor' property is anything but Auto on any element.
checkInteractiveElement
public boolean checkInteractiveElement(org.w3c.dom.Element e)
- used by isInteractiveDocument to check if document
contains any 'interactive' elements.
checkInteractiveElement
public boolean checkInteractiveElement(org.w3c.dom.svg.SVGDocument doc, org.w3c.dom.Element e)
- used by isInteractiveDocument to check if document
contains any 'interactive' elements.
registerSVGBridges
public void registerSVGBridges()
- Registers the bridges to handle SVG 1.0 elements.
getBridgeExtensions
public java.util.List getBridgeExtensions(org.w3c.dom.Document doc)
getGlobalBridgeExtensions
public static java.util.List getGlobalBridgeExtensions()
|
|||||||||
| Home >> All >> org >> apache >> batik >> [ bridge overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.apache.batik.bridge.BridgeContext