edu.jhu.ece.iacl.jist.pipeline.tree
Class DraggableNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by edu.jhu.ece.iacl.jist.pipeline.tree.DraggableNode
All Implemented Interfaces:
java.awt.datatransfer.Transferable, java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode
Direct Known Subclasses:
PipeAlgorithmFactory.AlgorithmNode, PipeDestinationFactory.DestinationNode, PipeSourceFactory.SourceNode

public abstract class DraggableNode
extends javax.swing.tree.DefaultMutableTreeNode
implements java.awt.datatransfer.Transferable

A draggable node is a tree node that the user can drag.

Author:
Blake Lucas (bclucas@jhu.edu)
See Also:
Serialized Form

Field Summary
protected  PipeModuleFactory factory
          The factory.
protected  javax.swing.ImageIcon icon
          The icon.
static java.awt.datatransfer.DataFlavor MODULE_FLAVOR
          The Constant MODULE_FLAVOR.
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
DraggableNode()
          Default constructor.
DraggableNode(PipeModuleFactory factory)
          Default constructor.
 
Method Summary
 PipeModuleFactory getFactory()
          Get module factory.
 javax.swing.ImageIcon getIcon()
          Gets the icon.
 java.lang.String getName()
          Get module name for this node.
 java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor df)
          implements Transferable interface.
 java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
          implements Transferable interface.
 boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor df)
          Returns true if data flavor is module type.
 
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 Detail

MODULE_FLAVOR

public static final java.awt.datatransfer.DataFlavor MODULE_FLAVOR
The Constant MODULE_FLAVOR.


factory

protected PipeModuleFactory factory
The factory.


icon

protected javax.swing.ImageIcon icon
The icon.

Constructor Detail

DraggableNode

public DraggableNode()
Default constructor.


DraggableNode

public DraggableNode(PipeModuleFactory factory)
Default constructor.

Parameters:
factory - module factory
Method Detail

getIcon

public javax.swing.ImageIcon getIcon()
Gets the icon.

Returns:
the icon

getFactory

public PipeModuleFactory getFactory()
Get module factory.

Returns:
the factory

getName

public java.lang.String getName()
Get module name for this node.

Returns:
module name

getTransferData

public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor df)
                                 throws java.awt.datatransfer.UnsupportedFlavorException,
                                        java.io.IOException
implements Transferable interface.

Specified by:
getTransferData in interface java.awt.datatransfer.Transferable
Parameters:
df - the df
Returns:
the transfer data
Throws:
java.awt.datatransfer.UnsupportedFlavorException - the unsupported flavor exception
java.io.IOException - Signals that an I/O exception has occurred.

getTransferDataFlavors

public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
implements Transferable interface.

Specified by:
getTransferDataFlavors in interface java.awt.datatransfer.Transferable
Returns:
the transfer data flavors

isDataFlavorSupported

public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor df)
Returns true if data flavor is module type.

Specified by:
isDataFlavorSupported in interface java.awt.datatransfer.Transferable
Parameters:
df - the df
Returns:
true, if checks if is data flavor supported