org.apache.batik.dom.svg

Class SVGOMDocument

public class SVGOMDocument extends AbstractStylableDocument implements SVGDocument, SVGConstants, CSSNavigableDocument, IdContainer

This class implements SVGDocument.
Nested Class Summary
protected classSVGOMDocument.AnimAttrListener
Listener class for animated attribute changes.
protected classSVGOMDocument.DOMAttrModifiedListenerWrapper
DOM attribute modified listener wrapper.
protected classSVGOMDocument.DOMCharacterDataModifiedListenerWrapper
DOM character data modified listener wrapper.
protected classSVGOMDocument.DOMNodeInsertedListenerWrapper
DOM node inserted listener wrapper.
protected classSVGOMDocument.DOMNodeRemovedListenerWrapper
DOM node removed listener wrapper.
protected classSVGOMDocument.DOMSubtreeModifiedListenerWrapper
DOM subtree modified listener wrapper.
Field Summary
protected LinkedListanimatedAttributeListeners
List of AnimatedAttributeListeners attached to this document.
protected HashMapcssNavigableDocumentListeners
Map of CSSNavigableDocumentListeners to an array of wrapper DOM listeners.
protected booleanisSVG12
Whether the document supports SVG 1.2.
protected LocalizableSupportlocalizableSupport
The localizable support for the error messages.
protected AnimatedAttributeListenermainAnimatedAttributeListener
The main AnimatedAttributeListener that redispatches to all listeners in animatedAttributeListeners.
protected booleanreadonly
Is this document immutable?
protected Stringreferrer
The string representing the referrer.
protected static StringRESOURCES
The error messages bundle class name.
protected SVGContextsvgContext
The SVG context.
protected ParsedURLurl
The URL of the document.
Constructor Summary
protected SVGOMDocument()
Creates a new uninitialized document.
SVGOMDocument(DocumentType dt, DOMImplementation impl)
Creates a new document.
Method Summary
voidaddAnimatedAttributeListener(AnimatedAttributeListener aal)
Adds an AnimatedAttributeListener to this document, to be notified of animated XML attribute changes.
voidaddCSSNavigableDocumentListener(CSSNavigableDocumentListener l)
Adds an event listener for mutations on the CSSNavigableDocument tree.
protected NodecopyInto(Node n)
Copy the fields of the current node into the given node.
AttrcreateAttribute(String name)
DOM: Implements Document#createAttribute(String).
AttrcreateAttributeNS(String namespaceURI, String qualifiedName)
DOM: Implements Document#createAttributeNS(String,String).
CDATASectioncreateCDATASection(String data)
DOM: Implements
CommentcreateComment(String data)
DOM: Implements Document#createComment(String).
DocumentFragmentcreateDocumentFragment()
DOM: Implements Document#createDocumentFragment().
ElementcreateElement(String tagName)
DOM: Implements Document#createElement(String).
ElementcreateElementNS(String namespaceURI, String qualifiedName)
DOM: Implements Document#createElementNS(String,String).
EntityReferencecreateEntityReference(String name)
DOM: Implements Document#createEntityReference(String).
ProcessingInstructioncreateProcessingInstruction(String target, String data)
DOM: Implements Document#createProcessingInstruction(String,String).
TextcreateTextNode(String data)
DOM: Implements Document#createTextNode(String).
protected NodedeepCopyInto(Node n)
Deeply copy the fields of the current node into the given node.
StringformatMessage(String key, Object[] args)
Implements (String,Object[]).
protected AnimatedAttributeListenergetAnimatedAttributeListener()
Returns the AnimatedAttributeListener for the document.
StringgetDomain()
DOM: Implements SVGDocument#getDomain().
CSSStyleDeclarationgetOverrideStyle(Element elt, String pseudoElt)
DOM: Implements DocumentCSS#getOverrideStyle(Element,String).
ParsedURLgetParsedURL()
Returns the URI of the document.
StringgetReferrer()
DOM: Implements SVGDocument#getReferrer().
SVGSVGElementgetRootElement()
DOM: Implements SVGDocument#getRootElement().
SVGContextgetSVGContext()
Returns the SVG context used to get SVG specific informations.
StringgetTitle()
DOM: Implements SVGDocument#getTitle().
StringgetURL()
DOM: Implements
URLgetURLObject()
Returns the URI of the document.
booleanisId(Attr node)
Returns true if the given Attr node represents an 'id' for this document.
booleanisReadonly()
Tests whether this node is readonly.
booleanisSVG12()
Returns whether the document supports SVG 1.2.
protected NodenewNode()
Returns a new uninitialized instance of this object's class.
protected voidoverrideStylePropertyChanged(CSSStylableElement e, String name, String value, String prio)
A property in the override style declaration has been changed.
protected voidoverrideStylePropertyRemoved(CSSStylableElement e, String name)
A property in the override style declaration has been removed.
protected voidoverrideStyleTextChanged(CSSStylableElement e, String text)
The text of the override style declaration for this element has been modified.
voidremoveAnimatedAttributeListener(AnimatedAttributeListener aal)
Removes an AnimatedAttributeListener from this document.
voidremoveCSSNavigableDocumentListener(CSSNavigableDocumentListener l)
Removes an event listener for mutations on the CSSNavigableDocument tree.
voidsetDocumentURI(String uri)
DOM: Implements org.w3c.dom.Document#setDocumentURI(String).
voidsetIsSVG12(boolean b)
Sets whether the document supports SVG 1.2.
voidsetLocale(Locale l)
Implements setLocale.
voidsetParsedURL(ParsedURL url)
Sets the URI of the document.
voidsetReadonly(boolean v)
Sets this node readonly attribute.
voidsetReferrer(String s)
Sets the referrer string.
voidsetSVGContext(SVGContext ctx)
Sets the SVG context to use to get SVG specific informations.
voidsetURLObject(URL url)
Sets the URI of the document.

Field Detail

animatedAttributeListeners

protected LinkedList animatedAttributeListeners
List of AnimatedAttributeListeners attached to this document.

cssNavigableDocumentListeners

protected HashMap cssNavigableDocumentListeners
Map of CSSNavigableDocumentListeners to an array of wrapper DOM listeners.

isSVG12

protected boolean isSVG12
Whether the document supports SVG 1.2.

localizableSupport

protected transient LocalizableSupport localizableSupport
The localizable support for the error messages.

mainAnimatedAttributeListener

protected AnimatedAttributeListener mainAnimatedAttributeListener
The main AnimatedAttributeListener that redispatches to all listeners in animatedAttributeListeners.

readonly

protected transient boolean readonly
Is this document immutable?

referrer

protected String referrer
The string representing the referrer.

RESOURCES

protected static final String RESOURCES
The error messages bundle class name.

svgContext

protected transient SVGContext svgContext
The SVG context.

url

protected ParsedURL url
The URL of the document.

Constructor Detail

SVGOMDocument

protected SVGOMDocument()
Creates a new uninitialized document.

SVGOMDocument

public SVGOMDocument(DocumentType dt, DOMImplementation impl)
Creates a new document.

Method Detail

addAnimatedAttributeListener

public void addAnimatedAttributeListener(AnimatedAttributeListener aal)
Adds an AnimatedAttributeListener to this document, to be notified of animated XML attribute changes.

addCSSNavigableDocumentListener

public void addCSSNavigableDocumentListener(CSSNavigableDocumentListener l)
Adds an event listener for mutations on the CSSNavigableDocument tree.

copyInto

protected Node copyInto(Node n)
Copy the fields of the current node into the given node.

Parameters: n a node of the type of this.

createAttribute

public Attr createAttribute(String name)
DOM: Implements Document#createAttribute(String).

createAttributeNS

public Attr createAttributeNS(String namespaceURI, String qualifiedName)
DOM: Implements Document#createAttributeNS(String,String).

createCDATASection

public CDATASection createCDATASection(String data)
DOM: Implements Document#createCDATASection(String)

createComment

public Comment createComment(String data)
DOM: Implements Document#createComment(String).

createDocumentFragment

public DocumentFragment createDocumentFragment()
DOM: Implements Document#createDocumentFragment().

createElement

public Element createElement(String tagName)
DOM: Implements Document#createElement(String).

createElementNS

public Element createElementNS(String namespaceURI, String qualifiedName)
DOM: Implements Document#createElementNS(String,String).

createEntityReference

public EntityReference createEntityReference(String name)
DOM: Implements Document#createEntityReference(String).

createProcessingInstruction

public ProcessingInstruction createProcessingInstruction(String target, String data)
DOM: Implements Document#createProcessingInstruction(String,String).

Returns: a SVGStyleSheetProcessingInstruction if target is "xml-stylesheet" or a GenericProcessingInstruction otherwise.

createTextNode

public Text createTextNode(String data)
DOM: Implements Document#createTextNode(String).

deepCopyInto

protected Node deepCopyInto(Node n)
Deeply copy the fields of the current node into the given node.

Parameters: n a node of the type of this.

formatMessage

public String formatMessage(String key, Object[] args)
Implements (String,Object[]).

getAnimatedAttributeListener

protected AnimatedAttributeListener getAnimatedAttributeListener()
Returns the AnimatedAttributeListener for the document.

getDomain

public String getDomain()
DOM: Implements SVGDocument#getDomain().

getOverrideStyle

public CSSStyleDeclaration getOverrideStyle(Element elt, String pseudoElt)
DOM: Implements DocumentCSS#getOverrideStyle(Element,String).

getParsedURL

public ParsedURL getParsedURL()
Returns the URI of the document.

getReferrer

public String getReferrer()
DOM: Implements SVGDocument#getReferrer().

getRootElement

public SVGSVGElement getRootElement()
DOM: Implements SVGDocument#getRootElement().

getSVGContext

public SVGContext getSVGContext()
Returns the SVG context used to get SVG specific informations.

getTitle

public String getTitle()
DOM: Implements SVGDocument#getTitle().

getURL

public String getURL()
DOM: Implements SVGDocument#getURL()

getURLObject

public URL getURLObject()
Returns the URI of the document. If the document URI cannot be represented as a URL (for example if it uses a data: URI scheme), then null will be returned.

isId

public boolean isId(Attr node)
Returns true if the given Attr node represents an 'id' for this document.

isReadonly

public boolean isReadonly()
Tests whether this node is readonly.

isSVG12

public boolean isSVG12()
Returns whether the document supports SVG 1.2.

newNode

protected Node newNode()
Returns a new uninitialized instance of this object's class.

overrideStylePropertyChanged

protected void overrideStylePropertyChanged(CSSStylableElement e, String name, String value, String prio)
A property in the override style declaration has been changed.

overrideStylePropertyRemoved

protected void overrideStylePropertyRemoved(CSSStylableElement e, String name)
A property in the override style declaration has been removed.

overrideStyleTextChanged

protected void overrideStyleTextChanged(CSSStylableElement e, String text)
The text of the override style declaration for this element has been modified.

removeAnimatedAttributeListener

public void removeAnimatedAttributeListener(AnimatedAttributeListener aal)
Removes an AnimatedAttributeListener from this document.

removeCSSNavigableDocumentListener

public void removeCSSNavigableDocumentListener(CSSNavigableDocumentListener l)
Removes an event listener for mutations on the CSSNavigableDocument tree.

setDocumentURI

public void setDocumentURI(String uri)
DOM: Implements org.w3c.dom.Document#setDocumentURI(String).

setIsSVG12

public void setIsSVG12(boolean b)
Sets whether the document supports SVG 1.2.

setLocale

public void setLocale(Locale l)
Implements setLocale.

setParsedURL

public void setParsedURL(ParsedURL url)
Sets the URI of the document.

setReadonly

public void setReadonly(boolean v)
Sets this node readonly attribute.

setReferrer

public void setReferrer(String s)
Sets the referrer string.

setSVGContext

public void setSVGContext(SVGContext ctx)
Sets the SVG context to use to get SVG specific informations.

Parameters: ctx the SVG context

setURLObject

public void setURLObject(URL url)
Sets the URI of the document.
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.