org.apache.batik.apps.svgbrowser
public class DOMViewer.Panel extends JPanel
Nested Class Summary | |
---|---|
protected class | DOMViewer.Panel.AttributeModificationHandler
Handles "DOMAttrModified" event. |
protected class | DOMViewer.Panel.CapturingClickHandler
Handles the capturing "mouseclick" event. |
protected class | DOMViewer.Panel.CharacterPanel
The CharacterData panel text area. |
protected class | DOMViewer.Panel.CharDataModificationHandler
Handles "DOMCharacterDataModified" event. |
protected class | DOMViewer.Panel.DOMTreeSelectionListener
To listen to the tree selection. |
protected class | DOMViewer.Panel.NodeCSSValuesModel
To display the CSS properties of a DOM node in a table. |
protected class | DOMViewer.Panel.NodeInsertionHandler
Handles "DOMNodeInserted" event. |
protected class | DOMViewer.Panel.NodeRemovalHandler
Handles "DOMNodeRemoved" event. |
protected class | DOMViewer.Panel.NodeRenderer
To render the tree nodes. |
protected class | DOMViewer.Panel.NodeTemplateParser
Parser for the Element template. |
protected class | DOMViewer.Panel.TreeNodeAdder
Handles tree pop-up menu action for adding new node. |
protected class | DOMViewer.Panel.TreeNodeRemover
Handles tree pop-up menu action for removing nodes. |
protected class | DOMViewer.Panel.TreePopUpListener
Tree popup listener. |
Field Summary | |
---|---|
static String | ATTRIBUTE_MODIFIED |
protected NodePickerPanel | attributePanel
The panel to show the nodes attributes. |
protected GridBagConstraints | attributePanelLayout
The layout for the attribute panel. |
protected EventListener | attrModification
"Attribute modified" DOM Mutation Listener. |
protected EventListener | capturingListener
Capturing "click" event type listener. |
protected DOMViewer.Panel.CharacterPanel | characterDataPanel
The CharacterData node panel. |
protected EventListener | charDataModification
"Character data modified" DOM Mutation Listener. |
static String | CHAR_DATA_MODIFIED |
protected Document | document
The DOM document. |
protected JTextArea | documentInfo
The documentInfo panel text area. |
protected JPanel | documentInfoPanel
The documentInfo node panel. |
protected JPanel | elementPanel
The element panel. |
protected EventListener | nodeInsertion
"Node inserted" DOM Mutation Listener. |
protected EventListener | nodeRemoval
"Node removed" DOM Mutation Listener. |
static String | NODE_INSERTED |
static String | NODE_REMOVED |
protected JTable | propertiesTable
The properties table. |
protected GridBagConstraints | propertiesTableLayout
The layout for the properties table. |
protected JPanel | rightPanel
The right panel. |
protected JSplitPane | splitPane
The split pane. |
protected DOMDocumentTree | tree
The tree. |
protected ViewCSS | viewCSS
The ViewCSS object associated with the document. |
Constructor Summary | |
---|---|
Panel()
Creates a new Panel object. |
Method Summary | |
---|---|
protected void | addCapturingListener(Document doc)
Registers capturing "click" listener on the document element of the
given document.
|
protected void | addDomMutationListeners(Document doc)
Registers DOM Mutation Listener on the given document.
|
protected JMenu | createTemplatesMenu(String name)
Creates JMenu menu using NodeTemplates.
|
protected MutableTreeNode | createTree(Node node, boolean showWhitespace)
Creates a swing tree from a DOM document. |
protected DefaultMutableTreeNode | findNode(JTree theTree, Node node)
Finds and returns the node in the tree that represents the given node
in the document.
|
protected void | refreshGUI(Runnable runnable)
Checks whether the DOMViewer can be used to edit the document and if
true refreshes the DOMViewer after the DOM Mutation event occured.
|
protected void | registerAttributeAdded(MutationEvent mevt)
Adds the "DOMAttrModified" Mutation event, of the
MutationEvent.ADDITION type to current history browser's
interface compound command
|
protected void | registerAttributeChanged(MutationEvent mevt)
Checks what type of the "DOMAttrModified" mutation event occured, and
invokes the appropriate method to register the change.
|
protected void | registerAttributeModified(MutationEvent mevt)
Adds the "DOMAttrModified" Mutation event, of the
MutationEvent.MODIFICATION type to current history browser's
interface compound command
|
protected void | registerAttributeRemoved(MutationEvent mevt)
Adds the "DOMAttrModified" Mutation event, of the
MutationEvent.REMOVAL type to current history browser's
interface compound command
|
protected void | registerCharDataModified(MutationEvent mevt)
Adds the "DOMCharDataModified" Mutation event to current history
browser's interface compound command
|
protected void | registerDocumentChange(MutationEvent mevt)
Puts the document change in the current history browser's interface
compound command if the document change occured outside of the
DOMViewer.
|
protected void | registerNodeInserted(MutationEvent mevt)
Adds the "DOMNodeInserted" Mutation event to current history
browser's interface compound command
|
protected void | registerNodeRemoved(MutationEvent mevt)
Adds the "DOMNodeRemoved" Mutation event to current history browser's
interface compound command
|
protected void | removeCapturingListener(Document doc)
Removes previously registered capturing "click" event listener from
the document element of the given document.
|
protected void | removeDomMutationListeners(Document doc)
Removes previously registered mutation listeners from the document.
|
void | selectNode(Node targetNode)
Finds and selects the given node in the document tree.
|
void | setDocument(Document doc)
Sets the document to display. |
void | setDocument(Document doc, ViewCSS view)
Sets the document to display and its ViewCSS. |
protected boolean | shouldRegisterDocumentChange()
Checks if the document change that occured should be registered. |
Parameters: doc The given document
Parameters: doc The given document
Parameters: name The name of the submenu
Returns: The JMenu submenu
Parameters: theTree The given JTree node The given org.w3c.dom.Node
Returns: Node or null if not found
Parameters: runnable The runnable to invoke for refresh
Parameters: mevt The Mutation Event
Parameters: mevt The Mutation Event
Parameters: mevt The Mutation Event
Parameters: mevt The Mutation Event
Parameters: mevt The Mutation Event
Parameters: mevt The info on the event. Use to describe the document change to the history browser
Parameters: mevt The Mutation Event
Parameters: mevt The Mutation Event
Parameters: doc The given document
Parameters: doc The document
Parameters: targetNode The node to be selected
Returns: True if the DOMViewer can edit the document and the history browser state is IDLE at the moment