|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.tree.DefaultMutableTreeNode
Jet.Concepts.Concept
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.
Field Summary | |
static java.awt.datatransfer.DataFlavor |
DEFAULT_MUTABLE_TREENODE_FLAVOR
The flavor for DefaultMutableTreeNode |
protected java.util.Vector |
subconcepts
The Concept s that isa this Concept |
protected java.util.Vector |
words
The Word s 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 |
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 Concept s
in the subtree rooted at this node in breadth-first order. |
java.util.Enumeration |
breadthFirstEnumerationOfWords()
Creates and returns an enumeration of the Word s
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 Word s 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 Word s are treated as leaves and Concept s
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 |
protected java.util.Vector subconcepts
Concept
s that isa this Concept
protected java.util.Vector words
Word
s of this Concept
public static final java.awt.datatransfer.DataFlavor DEFAULT_MUTABLE_TREENODE_FLAVOR
DefaultMutableTreeNode
Constructor Detail |
public Concept(java.lang.Object conceptName)
conceptName and that allows children.
Method Detail |
public java.lang.String getName()
Concept
.
Concept
public boolean isLeaf()
isLeaf()
method in DefaultMutableTreeNode
so that only Word
s are treated as leaves and Concept
s
are always treated as internal nodes. This is for the graphical representation
of tree nodes.
isLeaf
in interface javax.swing.tree.TreeNode
false
public java.util.Vector getSubconcepts()
Concept
.
Concept
public java.util.Vector getWords()
Concept
.
Concept
public int getSubconceptCount()
Concept
.
Concept
public int getWordCount()
Word
s of this Concept
.
Word
s of this Concept
public Concept getSubconceptAt(int index)
Concept
's subconcept array.
Concept
's subconcept arraypublic Word getWordAt(int index)
Word
at the specified index in this
Concept
's Word
array.
Word
at the specified index in this
Concept
's Word
arraypublic void addConcept(Concept newConcept)
Concept
to this Concept
.
newConcept
- the new Concept
to be added to this
Concept
public void addWord(Word newWord)
Word
to this Concept
.
All the words are listed before all the subconcepts in the vector
children
inherited from super
.
newWord
- the new Word
to be added to this
Concept
public void removeConcept(Concept oldConcept)
Concept
.
oldConcept
- the subconcept to be removed from this
Concept
public void removeWord(Word oldWord)
Concept
.
oldWord
- the word to be removed from this Concept
public void removeAllChildren()
removeAllchildren()
method
of DefaultMutableTreeNode
.
public java.util.Enumeration breadthFirstEnumerationOfConcepts()
Concept
s
in the subtree rooted at this node in breadth-first order.
Concept
s in the subtree
rooted at this node in breadth-first orderpublic java.util.Enumeration breadthFirstEnumerationOfWords()
Word
s
in the subtree rooted at this node in breadth-first order.
Word
s in the subtree
rooted at this node in breadth-first orderpublic java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor) throws java.io.IOException, java.awt.datatransfer.UnsupportedFlavorException
Transferable
method.
getTransferData
in interface java.awt.datatransfer.Transferable
java.io.IOException
java.awt.datatransfer.UnsupportedFlavorException
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
Transferable
method.
getTransferDataFlavors
in interface java.awt.datatransfer.Transferable
public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
Transferable
method.
isDataFlavorSupported
in interface java.awt.datatransfer.Transferable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |