Jet.Concepts
Class Word

java.lang.Object
  extended byjavax.swing.tree.DefaultMutableTreeNode
      extended byJet.Concepts.Word
All Implemented Interfaces:
java.lang.Cloneable, javax.swing.tree.MutableTreeNode, java.io.Serializable, java.awt.datatransfer.Transferable, javax.swing.tree.TreeNode

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

A Word is basically a DefaultMutableTreeNode. Its userObject is the word itself as a String. It does not allow children.
Word instances are transferable.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
Word(java.lang.Object word)
          Creates a tree node with no children and parent, initialized with the word as its user object and that does not allow children.
 
Method Summary
 java.lang.String getName()
          Returns the name of this Word.
 java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor)
          This is a Transferable method.
 java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
          This is a Transferable method.
 boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
          This is a Transferable method.
 boolean isLeaf()
          Overrides the isLeaf() method in DefaultMutableTreeNode so that only Words are treated as leaves and Concepts are always treated as internal nodes.
 
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, 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
 

Constructor Detail

Word

public Word(java.lang.Object word)
Creates a tree node with no children and parent, initialized with the word as its user object and that does not allow children.

Method Detail

getName

public java.lang.String getName()
Returns the name of this Word.

Returns:
the name of this Word

isLeaf

public boolean isLeaf()
Overrides the isLeaf() method in DefaultMutableTreeNode so that only Words are treated as leaves and Concepts are always treated as internal nodes. This is for the graphical representation of tree nodes.

Specified by:
isLeaf in interface javax.swing.tree.TreeNode
Returns:
always true

getTransferData

public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor)
                                 throws java.io.IOException,
                                        java.awt.datatransfer.UnsupportedFlavorException
This is a Transferable method.

Specified by:
getTransferData in interface java.awt.datatransfer.Transferable
Throws:
java.io.IOException
java.awt.datatransfer.UnsupportedFlavorException

getTransferDataFlavors

public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
This is a Transferable method.

Specified by:
getTransferDataFlavors in interface java.awt.datatransfer.Transferable

isDataFlavorSupported

public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
This is a Transferable method.

Specified by:
isDataFlavorSupported in interface java.awt.datatransfer.Transferable