Class DOMDocumentTree

All Implemented Interfaces:
Autoscroll, ImageObserver, MenuContainer, Serializable, Accessible, Scrollable

public class DOMDocumentTree extends JTree implements Autoscroll
A swing tree to represent DOM Document.
See Also:
  • Field Details

    • eventListeners

      protected EventListenerList eventListeners
      Listeners list.
    • autoscrollInsets

      protected Insets autoscrollInsets
      The insets where autoscrolling is active.
    • scrollUnits

      protected Insets scrollUnits
      How much to scroll.
    • controller

      protected DOMDocumentTreeController controller
      The controller for this tree.
  • Constructor Details

    • DOMDocumentTree

      public DOMDocumentTree(TreeNode root, DOMDocumentTreeController controller)
      Creates the DOMDocumentTree.
      Parameters:
      root - Root node
      controller - The tree controller
  • Method Details

    • autoscroll

      public void autoscroll(Point point)
      Specified by:
      autoscroll in interface Autoscroll
    • getAutoscrollInsets

      public Insets getAutoscrollInsets()
      Specified by:
      getAutoscrollInsets in interface Autoscroll
    • addListener

      public void addListener(DOMDocumentTree.DOMDocumentTreeListener listener)
      Adds the listener to the listener list.
      Parameters:
      listener - The listener to add
    • 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
    • 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