org.apache.batik.dom.svg

Class AbstractElement

public abstract class AbstractElement extends AbstractElement implements NodeEventTarget, CSSNavigableNode, SVGConstants

This class provides a superclass to implement an SVG element, or an element interoperable with the SVG elements.
Nested Class Summary
protected classAbstractElement.ExtendedNamedNodeHashMap
An implementation of the NamedNodeMap.
Field Summary
protected DoublyIndexedTableliveAttributeValues
The live attribute values.
Constructor Summary
protected AbstractElement()
Creates a new Element object.
protected AbstractElement(String prefix, AbstractDocument owner)
Creates a new Element object.
Method Summary
protected voidattrAdded(Attr node, String newv)
Called when an attribute has been added.
protected voidattrModified(Attr node, String oldv, String newv)
Called when an attribute has been modified.
protected voidattrRemoved(Attr node, String oldv)
Called when an attribute has been removed.
protected NamedNodeMapcreateAttributes()
Creates the attribute list.
protected NodedeepExport(Node n, AbstractDocument d)
Deeply exports this node to the given document.
protected Nodeexport(Node n, AbstractDocument d)
Exports this node to the given document.
voidfireDOMAttrModifiedEvent(String name, Attr node, String oldv, String newv, short change)
protected AttributeInitializergetAttributeInitializer()
Returns the AttributeInitializer for this element type.
NodegetCSSFirstChild()
Returns the CSS first child node of this node.
NodegetCSSLastChild()
Returns the CSS last child of this node.
NodegetCSSNextSibling()
Returns the CSS next sibling node of this node.
NodegetCSSParentNode()
Returns the CSS parent node of this node.
NodegetCSSPreviousSibling()
Returns the CSS previous sibling node of this node.
LiveAttributeValuegetLiveAttributeValue(String ns, String ln)
Returns the live attribute value associated with given attribute, if any.
protected voidinitializeAttributes()
Initializes the attributes of this element to their default value.
booleanisHiddenFromSelectors()
Returns whether this node is the root of a (conceptual) hidden tree that selectors will not work across.
voidputLiveAttributeValue(String ns, String ln, LiveAttributeValue val)
Associates a live attribute value to this element.
protected booleanresetAttribute(String ns, String prefix, String ln)
Resets an attribute to the default value.
voidsetUnspecifiedAttribute(String nsURI, String name, String value)
Sets an unspecified attribute.

Field Detail

liveAttributeValues

protected transient DoublyIndexedTable liveAttributeValues
The live attribute values.

Constructor Detail

AbstractElement

protected AbstractElement()
Creates a new Element object.

AbstractElement

protected AbstractElement(String prefix, AbstractDocument owner)
Creates a new Element object.

Parameters: prefix The namespace prefix. owner The owner document.

Method Detail

attrAdded

protected void attrAdded(Attr node, String newv)
Called when an attribute has been added.

attrModified

protected void attrModified(Attr node, String oldv, String newv)
Called when an attribute has been modified.

attrRemoved

protected void attrRemoved(Attr node, String oldv)
Called when an attribute has been removed.

createAttributes

protected NamedNodeMap createAttributes()
Creates the attribute list.

deepExport

protected Node deepExport(Node n, AbstractDocument d)
Deeply exports this node to the given document.

export

protected Node export(Node n, AbstractDocument d)
Exports this node to the given document.

fireDOMAttrModifiedEvent

public void fireDOMAttrModifiedEvent(String name, Attr node, String oldv, String newv, short change)

getAttributeInitializer

protected AttributeInitializer getAttributeInitializer()
Returns the AttributeInitializer for this element type.

Returns: null if this element has no attribute with a default value.

getCSSFirstChild

public Node getCSSFirstChild()
Returns the CSS first child node of this node.

getCSSLastChild

public Node getCSSLastChild()
Returns the CSS last child of this node.

getCSSNextSibling

public Node getCSSNextSibling()
Returns the CSS next sibling node of this node.

getCSSParentNode

public Node getCSSParentNode()
Returns the CSS parent node of this node.

getCSSPreviousSibling

public Node getCSSPreviousSibling()
Returns the CSS previous sibling node of this node.

getLiveAttributeValue

public LiveAttributeValue getLiveAttributeValue(String ns, String ln)
Returns the live attribute value associated with given attribute, if any.

Parameters: ns The attribute's namespace. ln The attribute's local name.

initializeAttributes

protected void initializeAttributes()
Initializes the attributes of this element to their default value.

isHiddenFromSelectors

public boolean isHiddenFromSelectors()
Returns whether this node is the root of a (conceptual) hidden tree that selectors will not work across.

putLiveAttributeValue

public void putLiveAttributeValue(String ns, String ln, LiveAttributeValue val)
Associates a live attribute value to this element.

Parameters: ns The attribute's namespace. ln The attribute's local name. val The live value.

resetAttribute

protected boolean resetAttribute(String ns, String prefix, String ln)
Resets an attribute to the default value.

Returns: true if a default value is known for the given attribute.

setUnspecifiedAttribute

public void setUnspecifiedAttribute(String nsURI, String name, String value)
Sets an unspecified attribute.

Parameters: nsURI The attribute namespace URI. name The attribute's qualified name. value The attribute's default value.

Copyright B) 2008 Apache Software Foundation. All Rights Reserved.