Package org.processmining.prediction
Class PrefuseTreeVisualization.DottyToTree
- java.lang.Object
-
- org.processmining.prediction.PrefuseTreeVisualization.DottyToTree
-
- Enclosing class:
- PrefuseTreeVisualization
public static class PrefuseTreeVisualization.DottyToTree extends java.lang.ObjectTurns the GraphViz dotty format into Prefuse's tree XML format (according to the tree.dtd).- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Constructor Summary
Constructors Constructor Description DottyToTree()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringconvert(java.lang.String dotty)Parses the incoming data and writes the generated output.protected java.lang.Stringsanitize(java.lang.String s)Replaces certain characters with their character entities.protected voidwriteEdge(java.io.BufferedWriter writer, weka.gui.treevisualizer.Edge edge)Writes the edge as GraphML.protected voidwriteFooter(java.io.BufferedWriter writer)Writes the footer of the GraphML file.protected voidwriteHeader(java.io.BufferedWriter writer)Writes the header of the GraphML file.protected voidwriteNode(java.io.BufferedWriter writer, weka.gui.treevisualizer.Node node)Writes the node as GraphML.
-
-
-
Method Detail
-
sanitize
protected java.lang.String sanitize(java.lang.String s)
Replaces certain characters with their character entities.- Parameters:
s- the string to process- Returns:
- the processed string
-
writeHeader
protected void writeHeader(java.io.BufferedWriter writer) throws java.lang.ExceptionWrites the header of the GraphML file.- Parameters:
writer- the writer to use- Throws:
java.lang.Exception- if an error occurs
-
writeNode
protected void writeNode(java.io.BufferedWriter writer, weka.gui.treevisualizer.Node node) throws java.lang.ExceptionWrites the node as GraphML.- Parameters:
writer- the writer to usenode- the node to write as GraphML- Throws:
java.lang.Exception- if an error occurs
-
writeEdge
protected void writeEdge(java.io.BufferedWriter writer, weka.gui.treevisualizer.Edge edge) throws java.lang.ExceptionWrites the edge as GraphML. Since prefuse doesn't seem to offer edge labels, the edges get inserted as nodes as well.- Parameters:
writer- the writer to useedge- the edge to write- Throws:
java.lang.Exception- if an error occurs
-
writeFooter
protected void writeFooter(java.io.BufferedWriter writer) throws java.lang.ExceptionWrites the footer of the GraphML file.- Parameters:
writer- the writer to use- Throws:
java.lang.Exception- if an error occurs
-
convert
public java.lang.String convert(java.lang.String dotty) throws java.lang.ExceptionParses the incoming data and writes the generated output.- Parameters:
dotty- the graph in dotty format- Returns:
- the TreeML data
- Throws:
java.lang.Exception- if parsing or writing fails
-
-