org.apache.batik.apps.svgbrowser

Class DOMDocumentTree

public class DOMDocumentTree extends JTree implements Autoscroll

A swing tree to represent DOM Document.
Nested Class Summary
static classDOMDocumentTree.DOMDocumentTreeAdapter
The adapter for the DOMDocumentTreeListener.
static classDOMDocumentTree.DOMDocumentTreeEvent
Event to pass to listener.
static interfaceDOMDocumentTree.DOMDocumentTreeListener
The DOMDocumentTreeListener.
static classDOMDocumentTree.DropCompletedInfo
Contains the info for the 'dropCompleted' Event.
static classDOMDocumentTree.TransferableTreeNode
Transferable tree node.
static classDOMDocumentTree.TransferData
The data being transfered on dnd.
classDOMDocumentTree.TreeDragSource
The JTree drag source wrapper.
classDOMDocumentTree.TreeDropTargetListener
Tree as a drop target listener.
Field Summary
protected InsetsautoscrollInsets
The insets where autoscrolling is active.
protected DOMDocumentTreeControllercontroller
The controller for this tree.
protected EventListenerListeventListeners
Listeners list.
protected InsetsscrollUnits
How much to scroll.
Constructor Summary
DOMDocumentTree(TreeNode root, DOMDocumentTreeController controller)
Creates the DOMDocumentTree.
Method Summary
voidaddListener(DOMDocumentTree.DOMDocumentTreeListener listener)
Adds the listener to the listener list.
voidautoscroll(Point point)
voidfireDropCompleted(DOMDocumentTree.DOMDocumentTreeEvent event)
Fires the dropCompleted event.
voidfireOnAutoscroll(DOMDocumentTree.DOMDocumentTreeEvent event)
Fires the dropCompleted event.
InsetsgetAutoscrollInsets()
protected NodegetDomNodeFromTreeNode(DefaultMutableTreeNode treeNode)
Gets the associated org.w3c.dom.Node from the DefaultMutableTreeNode
protected ArrayListgetNodeListForParent(ArrayList potentialChildren, Node parentNode)
Finds and returns a group of nodes that can be appended to the given parent node.

Field Detail

autoscrollInsets

protected Insets autoscrollInsets
The insets where autoscrolling is active.

controller

protected DOMDocumentTreeController controller
The controller for this tree.

eventListeners

protected EventListenerList eventListeners
Listeners list.

scrollUnits

protected Insets scrollUnits
How much to scroll.

Constructor Detail

DOMDocumentTree

public DOMDocumentTree(TreeNode root, DOMDocumentTreeController controller)
Creates the DOMDocumentTree.

Parameters: root Root node controller The tree controller

Method Detail

addListener

public void addListener(DOMDocumentTree.DOMDocumentTreeListener listener)
Adds the listener to the listener list.

Parameters: listener The listener to add

autoscroll

public void autoscroll(Point point)

fireDropCompleted

public void fireDropCompleted(DOMDocumentTree.DOMDocumentTreeEvent event)
Fires the dropCompleted event.

Parameters: event The associated DndTreeSupportEvent event

fireOnAutoscroll

public void fireOnAutoscroll(DOMDocumentTree.DOMDocumentTreeEvent event)
Fires the dropCompleted event.

Parameters: event The associated DndTreeSupportEvent event

getAutoscrollInsets

public Insets getAutoscrollInsets()

getDomNodeFromTreeNode

protected Node getDomNodeFromTreeNode(DefaultMutableTreeNode treeNode)
Gets the associated org.w3c.dom.Node from the DefaultMutableTreeNode

Parameters: treeNode The given DefaultMutableTreeNode

Returns: the associated Node

getNodeListForParent

protected ArrayList getNodeListForParent(ArrayList potentialChildren, Node parentNode)
Finds and returns a group of nodes that can be appended to the given parent node.

Parameters: potentialChildren The given potential children parentNode The given parent node

Returns: list of nodes that can be appended to the given parent

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