Package org.apache.batik.bridge.svg12
Class ContentManager
- java.lang.Object
-
- org.apache.batik.bridge.svg12.ContentManager
-
public class ContentManager extends java.lang.ObjectA class to manage all XBL content elements in a shadow tree.- Version:
- $Id: ContentManager.java 1851346 2019-01-15 13:41:00Z ssteiner $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classContentManager.ContentElementDOMAttrModifiedEventListenerThe DOM EventListener invoked when an attribute is modified, for content elements.protected classContentManager.DOMAttrModifiedEventListenerThe DOM EventListener invoked when an attribute is modified.protected classContentManager.DOMNodeInsertedEventListenerThe DOM EventListener invoked when a node is added.protected classContentManager.DOMNodeRemovedEventListenerThe DOM EventListener invoked when a node is removed.protected classContentManager.DOMSubtreeModifiedEventListenerThe DOM EventListener invoked when a subtree has changed.protected classContentManager.ShadowTreeNodeInsertedListenerThe DOM EventListener invoked when a node in the shadow tree has been inserted.protected classContentManager.ShadowTreeNodeRemovedListenerThe DOM EventListener invoked when a node in the shadow tree has been removed.protected classContentManager.ShadowTreeSubtreeModifiedListenerThe DOM EventListener invoked when a subtree of the shadow tree has changed.
-
Field Summary
Fields Modifier and Type Field Description protected org.w3c.dom.ElementboundElementThe bound element that owns the shadow tree.protected ContentManager.ContentElementDOMAttrModifiedEventListenercontentElementDomAttrModifiedEventListenerDOMAttrModified listener for content elements.protected java.util.LinkedListcontentElementListList of content elements.protected ContentManager.DOMAttrModifiedEventListenerdomAttrModifiedEventListenerDOMAttrModified listener for bound element children.protected ContentManager.DOMNodeInsertedEventListenerdomNodeInsertedEventListenerDOMNodeInserted listener for bound element children.protected ContentManager.DOMNodeRemovedEventListenerdomNodeRemovedEventListenerDOMNodeRemoved listener for bound element children.protected ContentManager.DOMSubtreeModifiedEventListenerdomSubtreeModifiedEventListenerDOMSubtreeModified listener for shadow tree nodes.protected java.util.HashMaplistenersMap of XBLContentElement objects to EventListenerList objects.protected org.w3c.dom.NoderemovedNodeThe recently removed node from the shadow tree.protected java.util.HashMapselectedNodesMap of content elements to a list of nodes that were selected by that content element.protected java.util.HashMapselectorsMap of content elements to selectors.protected XBLOMShadowTreeElementshadowTreeThe shadow tree whose content elements this object is managing.protected ContentManager.ShadowTreeNodeInsertedListenershadowTreeNodeInsertedListenerDOMNodeInserted listener for content elements in the shadow tree.protected ContentManager.ShadowTreeNodeRemovedListenershadowTreeNodeRemovedListenerDOMNodeRemoved listener for content elements in the shadow tree.protected ContentManager.ShadowTreeSubtreeModifiedListenershadowTreeSubtreeModifiedListenerDOMSubtreeModified listener for content elements in the shadow tree.protected DefaultXBLManagerxblManagerThe XBL manager.
-
Constructor Summary
Constructors Constructor Description ContentManager(XBLOMShadowTreeElement s, XBLManager xm)Creates a new ContentManager object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddContentSelectionChangedListener(XBLOMContentElement e, ContentSelectionChangedListener l)Adds the specified ContentSelectionChangedListener to the listener list.protected voiddispatchContentSelectionChangedEvent(XBLOMContentElement e)Dispatches the ContentSelectionChangedEvent to the registered listeners.voiddispose()Disposes this ContentManager.protected XBLOMContentElementgetContentElement(org.w3c.dom.Node n)Returns the content element that selected a given node.protected java.lang.StringgetContentSelectorLanguage(org.w3c.dom.Element e)Returns the selector language to be used for the given xbl:content element.org.w3c.dom.NodeListgetSelectedContent(XBLOMContentElement e)Returns a NodeList of the content that was selected by the given content element.voidremoveContentSelectionChangedListener(XBLOMContentElement e, ContentSelectionChangedListener l)Removes the specified ContentSelectionChangedListener from the listener list.protected voidupdate(boolean first)Updates all content elements.protected booleanupdate(boolean first, org.w3c.dom.Node n)
-
-
-
Field Detail
-
shadowTree
protected XBLOMShadowTreeElement shadowTree
The shadow tree whose content elements this object is managing.
-
boundElement
protected org.w3c.dom.Element boundElement
The bound element that owns the shadow tree.
-
xblManager
protected DefaultXBLManager xblManager
The XBL manager.
-
selectors
protected java.util.HashMap selectors
Map of content elements to selectors. [XBLContentElement, AbstractContentSelector]
-
selectedNodes
protected java.util.HashMap selectedNodes
Map of content elements to a list of nodes that were selected by that content element. [XBLContentElement, NodeList]
-
contentElementList
protected java.util.LinkedList contentElementList
List of content elements. [XBLContentElement]
-
removedNode
protected org.w3c.dom.Node removedNode
The recently removed node from the shadow tree.
-
listeners
protected java.util.HashMap listeners
Map of XBLContentElement objects to EventListenerList objects.
-
contentElementDomAttrModifiedEventListener
protected ContentManager.ContentElementDOMAttrModifiedEventListener contentElementDomAttrModifiedEventListener
DOMAttrModified listener for content elements.
-
domAttrModifiedEventListener
protected ContentManager.DOMAttrModifiedEventListener domAttrModifiedEventListener
DOMAttrModified listener for bound element children.
-
domNodeInsertedEventListener
protected ContentManager.DOMNodeInsertedEventListener domNodeInsertedEventListener
DOMNodeInserted listener for bound element children.
-
domNodeRemovedEventListener
protected ContentManager.DOMNodeRemovedEventListener domNodeRemovedEventListener
DOMNodeRemoved listener for bound element children.
-
domSubtreeModifiedEventListener
protected ContentManager.DOMSubtreeModifiedEventListener domSubtreeModifiedEventListener
DOMSubtreeModified listener for shadow tree nodes.
-
shadowTreeNodeInsertedListener
protected ContentManager.ShadowTreeNodeInsertedListener shadowTreeNodeInsertedListener
DOMNodeInserted listener for content elements in the shadow tree.
-
shadowTreeNodeRemovedListener
protected ContentManager.ShadowTreeNodeRemovedListener shadowTreeNodeRemovedListener
DOMNodeRemoved listener for content elements in the shadow tree.
-
shadowTreeSubtreeModifiedListener
protected ContentManager.ShadowTreeSubtreeModifiedListener shadowTreeSubtreeModifiedListener
DOMSubtreeModified listener for content elements in the shadow tree.
-
-
Constructor Detail
-
ContentManager
public ContentManager(XBLOMShadowTreeElement s, XBLManager xm)
Creates a new ContentManager object.- Parameters:
s- the shadow tree element whose content elements this object will be managingxm- the XBLManager for this document
-
-
Method Detail
-
dispose
public void dispose()
Disposes this ContentManager.
-
getSelectedContent
public org.w3c.dom.NodeList getSelectedContent(XBLOMContentElement e)
Returns a NodeList of the content that was selected by the given content element.
-
getContentElement
protected XBLOMContentElement getContentElement(org.w3c.dom.Node n)
Returns the content element that selected a given node.
-
addContentSelectionChangedListener
public void addContentSelectionChangedListener(XBLOMContentElement e, ContentSelectionChangedListener l)
Adds the specified ContentSelectionChangedListener to the listener list.
-
removeContentSelectionChangedListener
public void removeContentSelectionChangedListener(XBLOMContentElement e, ContentSelectionChangedListener l)
Removes the specified ContentSelectionChangedListener from the listener list.
-
dispatchContentSelectionChangedEvent
protected void dispatchContentSelectionChangedEvent(XBLOMContentElement e)
Dispatches the ContentSelectionChangedEvent to the registered listeners.
-
update
protected void update(boolean first)
Updates all content elements.- Parameters:
first- Whether this is the first update for this ContentManager.
-
update
protected boolean update(boolean first, org.w3c.dom.Node n)
-
getContentSelectorLanguage
protected java.lang.String getContentSelectorLanguage(org.w3c.dom.Element e)
Returns the selector language to be used for the given xbl:content element. This will look at the xbl:content element and the document element for an attribute batik:selectorLanguage.
-
-