Jet.Concepts
Class Concept

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

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

A Concept is basically a DefaultMutableTreeNode. Its userObject is its name as a String. It allows children who can be either a Concept or a word.

Concept instances are transferable.

See Also:
Serialized Form

Field Summary
static java.awt.datatransfer.DataFlavor DEFAULT_MUTABLE_TREENODE_FLAVOR
          The flavor for DefaultMutableTreeNode
protected  java.util.Vector subconcepts
          The Concepts that isa this Concept
protected  java.util.Vector words
          The Words of this Concept
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
Concept(java.lang.Object conceptName)
          Creates a tree node with no children and parent, initialized with the name conceptName and that allows children.
 
Method Summary
 void addConcept(Concept newConcept)
          Adds a new Concept to this Concept.
 void addWord(Word newWord)
          Adds a new Word to this Concept.
 java.util.Enumeration breadthFirstEnumerationOfConcepts()
          Creates and returns an enumeration of the Concepts in the subtree rooted at this node in breadth-first order.
 java.util.Enumeration breadthFirstEnumerationOfWords()
          Creates and returns an enumeration of the Words in the subtree rooted at this node in breadth-first order.
 java.lang.String getName()
          Returns the name of this Concept.
 Concept getSubconceptAt(int index)
          Returns the subconcept at the specified index in this Concept's subconcept array.
 int getSubconceptCount()
          Returns the number of subconcepts of this Concept.
 java.util.Vector getSubconcepts()
          Returns the vector of the subconcepts of this Concept.
 java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor)
          This is a Transferable method.
 java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
          This is a Transferable method.
 Word getWordAt(int index)
          Returns the Word at the specified index in this Concept's Word array.
 int getWordCount()
          Returns the number of Words of this Concept.
 java.util.Vector getWords()
          Returns the vector of the words of this Concept.
 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.
 void removeAllChildren()
          Overrides the removeAllchildren() method of DefaultMutableTreeNode.
 void removeConcept(Concept oldConcept)
          Removes a subconcept with its children from this Concept.
 void removeWord(Word oldWord)
          Removes a word from this Concept.
 
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, removeFromParent, setAllowsChildren, setParent, setUserObject, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

subconcepts

protected java.util.Vector subconcepts
The Concepts that isa this Concept


words

protected java.util.Vector words
The Words of this Concept


DEFAULT_MUTABLE_TREENODE_FLAVOR

public static final java.awt.datatransfer.DataFlavor DEFAULT_MUTABLE_TREENODE_FLAVOR
The flavor for DefaultMutableTreeNode

Constructor Detail

Concept

public Concept(java.lang.Object conceptName)
Creates a tree node with no children and parent, initialized with the name conceptName and that allows children.

Method Detail

getName

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

Returns:
the name of this Concept

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 false

getSubconcepts

public java.util.Vector getSubconcepts()
Returns the vector of the subconcepts of this Concept.

Returns:
the vector of the subconcepts of this Concept

getWords

public java.util.Vector getWords()
Returns the vector of the words of this Concept.

Returns:
the vector of the words of this Concept

getSubconceptCount

public int getSubconceptCount()
Returns the number of subconcepts of this Concept.

Returns:
the number of subconcepts of this Concept

getWordCount

public int getWordCount()
Returns the number of Words of this Concept.

Returns:
the number of Words of this Concept

getSubconceptAt

public Concept getSubconceptAt(int index)
Returns the subconcept at the specified index in this Concept's subconcept array.

Returns:
the subconcept at the specified index in this Concept's subconcept array

getWordAt

public Word getWordAt(int index)
Returns the Word at the specified index in this Concept's Word array.

Returns:
the Word at the specified index in this Concept's Word array

addConcept

public void addConcept(Concept newConcept)
Adds a new Concept to this Concept.

Parameters:
newConcept - the new Concept to be added to this Concept

addWord

public void addWord(Word newWord)
Adds a new Word to this Concept. All the words are listed before all the subconcepts in the vector children inherited from super.

Parameters:
newWord - the new Word to be added to this Concept

removeConcept

public void removeConcept(Concept oldConcept)
Removes a subconcept with its children from this Concept.

Parameters:
oldConcept - the subconcept to be removed from this Concept

removeWord

public void removeWord(Word oldWord)
Removes a word from this Concept.

Parameters:
oldWord - the word to be removed from this Concept

removeAllChildren

public void removeAllChildren()
Overrides the removeAllchildren() method of DefaultMutableTreeNode.


breadthFirstEnumerationOfConcepts

public java.util.Enumeration breadthFirstEnumerationOfConcepts()
Creates and returns an enumeration of the Concepts in the subtree rooted at this node in breadth-first order.

Returns:
enumeration of the Concepts in the subtree rooted at this node in breadth-first order

breadthFirstEnumerationOfWords

public java.util.Enumeration breadthFirstEnumerationOfWords()
Creates and returns an enumeration of the Words in the subtree rooted at this node in breadth-first order.

Returns:
enumeration of the Words in the subtree rooted at this node in breadth-first order

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