Package docking.dnd
Class DragDropNode
- java.lang.Object
-
- javax.swing.tree.DefaultMutableTreeNode
-
- docking.dnd.DragDropNode
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,javax.swing.tree.MutableTreeNode
,javax.swing.tree.TreeNode
public abstract class DragDropNode extends javax.swing.tree.DefaultMutableTreeNode
Defines a node that is in the DragDropTree.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DragDropNode(java.lang.String name)
Constructs a new DragDropNode with the given name.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract javax.swing.Icon
getIcon(boolean expanded, boolean leaf)
Get the appropriate icon for this node's state; called by the tree cell renderer.java.lang.String
getName()
Get the name of this node.java.lang.String
getToolTipText()
Get the tool tip for this node.javax.swing.tree.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(java.lang.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
-
-
-
-
Method Detail
-
getIcon
public abstract javax.swing.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 expandedleaf
- 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 treedropAction
- DnDConstants value for copy or move
-
getToolTipText
public java.lang.String getToolTipText()
Get the tool tip for this node.
-
getTreePath
public javax.swing.tree.TreePath getTreePath()
Get the tree path for this node.- Returns:
- TreePath
-
setName
public void setName(java.lang.String name)
Set the name for this node.- Parameters:
name
- the name to set on this node.
-
getName
public java.lang.String getName()
Get the name of this node.
-
-