Package docking.dnd

# Class DragDropNode

java.lang.Object
javax.swing.tree.DefaultMutableTreeNode
docking.dnd.DragDropNode

All Implemented Interfaces:
  `Serializable`, `Cloneable`, `MutableTreeNode`, `TreeNode`

public abstract class DragDropNode extends DefaultMutableTreeNode
Defines a node that is in the DragDropTree.

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected String`
  `name`
  `protected TreePath`
  `treePath`

  ### Fields inherited from class javax.swing.tree.DefaultMutableTreeNode

  `allowsChildren, children, EMPTY_ENUMERATION, parent, userObject`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DragDropNode(String name)`
  Constructs a new DragDropNode with the given name.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract Icon`
  `getIcon(boolean expanded, boolean leaf)`
  Get the appropriate icon for this node's state; called by the tree cell renderer.
  `String`
  `getName()`
  Get the name of this node.
  `String`
  `getToolTipText()`
  Get the tool tip for this node.
  `TreePath`
  `getTreePath()`
  Get the tree path for this node.
  `abstract boolean`
  `isDropAllowed(DragDropNode dropNode, int dropAction)`
  Return true if this node can be a drop target.
  `void`
  `setName(String name)`
  Set the name for this node.

  ### Methods inherited from class javax.swing.tree.DefaultMutableTreeNode

  `add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString`

  ### Methods inherited from class java.lang.Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### treePath

    protected TreePath treePath

  - ### name

    protected String name

- ## Constructor Details

  - ### DragDropNode

    public DragDropNode(String name)
    Constructs a new DragDropNode with the given name.
    Parameters:
      `name` - the name to associate with this node.

- ## Method Details

  - ### getIcon

    public abstract Icon getIcon(boolean expanded, boolean leaf)
    Get the appropriate icon for this node's state; called by the tree cell renderer.
    Parameters:
      `expanded` - true if the node is expanded
      `leaf` - true if the node is a leaf node

  - ### isDropAllowed

    public abstract boolean isDropAllowed(DragDropNode dropNode, int dropAction)
    Return true if this node can be a drop target.
    Parameters:
      `dropNode` - node being dragged and dropped; could be null if the drag was initiated outside of the tree
      `dropAction` - DnDConstants value for copy or move

  - ### getToolTipText

    public String getToolTipText()
    Get the tool tip for this node.

  - ### getTreePath

    public TreePath getTreePath()
    Get the tree path for this node.
    Returns:
      TreePath

  - ### setName

    public void setName(String name)
    Set the name for this node.
    Parameters:
      `name` - the name to set on this node.

  - ### getName

    public String getName()
    Get the name of this node.