|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--javax.swing.tree.DefaultMutableTreeNode
|
+--org.stringer.ui.TransferableTreeNode
A Custom Transferable object.
During a drag operation on a Jtree this the TransferableTreeNode is
the object that is dragged around. Any DefaultMutableTreeNode can be
dragged around, so you do not have to do anything special to create
tree nodes just for draggable trees. Its primary
job is to return the proper object from
public Object getTransferData(DataFlavor flavor),
based upon the requested flavor from the drop point. To support our custom
flavor, we need to create a DataFlavor and be sure
public DataFlavor[] getTransferDataFlavors()
returns it, along with the other supported flavors.
Implements the Transferable interface for classes that
can be used to provide data for a transfer operation.
| Field Summary | |
private javax.swing.tree.DefaultMutableTreeNode |
data
|
static java.awt.datatransfer.DataFlavor |
DEFAULT_MUTABLE_TREENODE_FLAVOR
|
private static java.util.List |
flavorList
the types of data that we can provide expressed as a Collection |
(package private) static java.awt.datatransfer.DataFlavor[] |
flavors
the types of data that we can provide |
(package private) static int |
TREE
|
| Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject |
| Constructor Summary | |
TransferableTreeNode(javax.swing.tree.DefaultMutableTreeNode data)
|
|
| Method Summary | |
java.lang.Object |
getTransferData(java.awt.datatransfer.DataFlavor flavor)
|
java.awt.datatransfer.DataFlavor[] |
getTransferDataFlavors()
|
boolean |
isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
|
java.lang.String |
toString()
|
| 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 |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
static final int TREE
public static final java.awt.datatransfer.DataFlavor DEFAULT_MUTABLE_TREENODE_FLAVOR
static java.awt.datatransfer.DataFlavor[] flavors
private static final java.util.List flavorList
Collection
private javax.swing.tree.DefaultMutableTreeNode data
| Constructor Detail |
public TransferableTreeNode(javax.swing.tree.DefaultMutableTreeNode data)
| Method Detail |
public java.lang.String toString()
toString in class javax.swing.tree.DefaultMutableTreeNodepublic java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
getTransferDataFlavors in interface java.awt.datatransfer.Transferable
public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor)
throws java.awt.datatransfer.UnsupportedFlavorException,
java.io.IOException
getTransferData in interface java.awt.datatransfer.Transferablejava.awt.datatransfer.UnsupportedFlavorException
java.io.IOExceptionpublic boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
isDataFlavorSupported in interface java.awt.datatransfer.Transferable
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||