|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.tree.DefaultMutableTreeNode
edu.iastate.metnet.metaomgraph.ExtendedInfoTree
public class ExtendedInfoTree
Class for storing the extended information of a MetaOmProject. The
extended information is initialized from an XML file and stored as a tree of
DefaultMutableTreeNodes with the
ExtendedInfoTree node as the root. The user object of each
child node is an ExtendedInfoTree.InfoNode.
This class also contains two Hashtables that can be used to
track Plant Ontology information. The keys of the Hashtable
returned by getPONumberHash are full plant
ontology strings (such as "PO:0009046: flower"), while the keys of the
getPONameHash() table are only the name part of the string (the
"flower" part of "PO:0009046: flower"). When loading the extended info, if an
Element whose text is a plant ontology string is encountered,
the name of the parent Element is added to a Vector, which is
then added to the tables. The tables can then be used to determine which
branches of the ExtendedInfoTree correspond to certain plant
ontology values.
| Nested Class Summary | |
|---|---|
class |
ExtendedInfoTree.InfoNode
Class that stores information for nodes in an ExtendedInfoTree. |
| Field Summary |
|---|
| Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
|---|
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject |
| Constructor Summary | |
|---|---|
ExtendedInfoTree()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
addChildren(javax.swing.tree.DefaultMutableTreeNode parent,
org.jdom.Element thisElement)
Adds the given Element and its children to the given parent. |
javax.swing.tree.TreeNode[] |
findPath(java.lang.String findMe)
Finds the first node in this tree whose name starts with the given String. |
java.lang.String |
getData(java.lang.String nodeName)
Retrieves the metadata for a given node. |
java.lang.String[] |
getFields()
Retrieves a list of leaf node names in this tree. |
java.util.Hashtable<java.lang.String,java.util.Vector<java.lang.String>> |
getPONameHash()
Fetches a Hashtable whose keys are plant ontology names and whose values are Vectors of names of nodes that have the plant
ontology name as one of its children. |
java.util.Hashtable<java.lang.String,java.util.Vector<java.lang.String>> |
getPONumberHash()
Fetches a Hashtable whose keys are plant ontology strings and whose values are Vectors of names of nodes that have the
complete plant ontology string as one of its children. |
boolean |
initData()
Prompts the user to select an XML file, the initializes this tree from the selected file. |
boolean |
initData(org.jdom.Element rootNode)
|
boolean |
initData(java.io.File source)
Initializes this tree from a given XML file. |
boolean |
initData(java.io.InputStream source)
Initializes this tree from the given InputStream. |
void |
outputTree(java.io.OutputStream outstream)
Outputs this ExtendedInfoTree to the given OutputStream. |
| 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 |
| Constructor Detail |
|---|
public ExtendedInfoTree()
| Method Detail |
|---|
public boolean initData()
public boolean initData(java.io.InputStream source)
source - An InputStream with an XML source.
public boolean initData(java.io.File source)
source - An XML file
public boolean initData(org.jdom.Element rootNode)
public void addChildren(javax.swing.tree.DefaultMutableTreeNode parent,
org.jdom.Element thisElement)
ExtendedInfoTree.InfoNodes as their user
objects.
parent - The parent node.thisElement - The XML Element to add to the parent.public java.lang.String[] getFields()
public javax.swing.tree.TreeNode[] findPath(java.lang.String findMe)
findMe - the start of the desired node's name
public void outputTree(java.io.OutputStream outstream)
outstream - the OutputStream to receive this ExtendedInfoTree's XML
output.public java.util.Hashtable<java.lang.String,java.util.Vector<java.lang.String>> getPONameHash()
Vectors of names of nodes that have the plant
ontology name as one of its children. See the class description for
details
public java.util.Hashtable<java.lang.String,java.util.Vector<java.lang.String>> getPONumberHash()
Vectors of names of nodes that have the
complete plant ontology string as one of its children. See the class
description for details
public java.lang.String getData(java.lang.String nodeName)
nodeName - the name of the node
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||