|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.gui.treevisualizer.TreeBuild
This class will parse a dotty file and construct a tree structure from it with Edge's and Node's
Nested Class Summary | |
private class |
TreeBuild.InfoObject
This is an internal class used to keep track of the info for the objects before they are actually created. |
Field Summary | |
private java.util.Vector |
m_aEdges
An array with all the edges initially constructed into it. |
private java.util.Vector |
m_aNodes
An array with all the nodes initially constructed into it. |
private java.util.Hashtable |
m_colorTable
A table containing all the colors. |
private boolean |
m_digraph
true if it is a digraph. |
private java.util.Vector |
m_edges
An arry containing a structure that describes the edge without actually creating it. |
private TreeBuild.InfoObject |
m_edObj
An object setup to take edge data. |
private java.lang.String |
m_graphName
The name of the tree, Not in use. |
private TreeBuild.InfoObject |
m_grObj
An object setup to take graph data. |
private java.util.Vector |
m_nodes
An array containing a structure that describes the node without actually creating it. |
private TreeBuild.InfoObject |
m_noObj
An object setup to take node data. |
private java.io.StreamTokenizer |
m_st
The stream to parse. |
Constructor Summary | |
TreeBuild()
Upon construction this will only setup the color table for quick reference of a color. |
Method Summary | |
private void |
alterSyntax()
This is the alternative syntax for the tokenizer. |
private void |
attrList(TreeBuild.InfoObject a)
This will parse all the items in the attrib list for an object. |
private void |
attrStmt()
This will deal specifically with a new object such as graph , node , edge. |
Node |
create(java.io.Reader t)
This will build A node structure from the dotty format passed. |
private void |
edgeStmt(java.lang.String i)
This will get the target of the edge. |
private Node |
generateStructures()
This will go through all the found Nodes and Edges build instances of these and link them together. |
private java.lang.Integer |
getShape(java.lang.String sh)
This will convert the shape string to an int representing that shape. |
private java.lang.Integer |
getStyle(java.lang.String sty)
Converts the string representing the fill style int oa number representing it. |
private void |
graph()
Parses the top of the dotty stream that has the graph information. |
private void |
nextToken(java.lang.String r)
This will parse the next token out of the stream and check for certain conditions. |
private void |
nodeId(java.lang.String s,
int t)
Generates a new InfoObject with the specified name and either does further processing if applicable Otherwise it is an edge and will deal with that. |
private void |
setSyntax()
This will setup the syntax for the tokenizer so that it parses the string properly. |
private void |
stmtList()
This is one of the states, this one is where new items can be defined or the structure can end. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.lang.String m_graphName
private java.util.Vector m_aNodes
private java.util.Vector m_aEdges
private java.util.Vector m_nodes
private java.util.Vector m_edges
private TreeBuild.InfoObject m_grObj
private TreeBuild.InfoObject m_noObj
private TreeBuild.InfoObject m_edObj
private boolean m_digraph
private java.io.StreamTokenizer m_st
private java.util.Hashtable m_colorTable
Constructor Detail |
public TreeBuild()
Method Detail |
public Node create(java.io.Reader t)
t
- The reader with the dotty string to be read.
private Node generateStructures()
private java.lang.Integer getShape(java.lang.String sh)
sh
- The name of the shape.
private java.lang.Integer getStyle(java.lang.String sty)
sty
- The name of the style.
private void setSyntax()
private void alterSyntax()
private void nextToken(java.lang.String r)
r
- The error string to print out if something goes wrong.private void graph()
private void stmtList()
private void attrStmt()
private void nodeId(java.lang.String s, int t)
s
- The ID string.t
- Not sure!.private void edgeStmt(java.lang.String i)
i
- The source of the edge.private void attrList(TreeBuild.InfoObject a)
a
- The object that the attribs apply to.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |