sp-05/src/ch/usi/inf/sp/callgraph/CallGraphRenderer.java

33 lines
728 B
Java

package ch.usi.inf.sp.callgraph;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
/**
* Dump out information about the given ClassHierarchy.
*
* @author ?
* @author Matthias.Hauswirth@usi.ch
*/
public final class CallGraphRenderer {
public void dumpDot(final ClassHierarchy hierarchy, final String fileName) throws IOException {
final PrintWriter pw = new PrintWriter(new FileWriter(fileName));
pw.println("digraph CallGraph {");
pw.println(" rankdir=\"BT\"");
for (final Type type : hierarchy.getTypes()) {
if (type instanceof ClassType) {
final ClassType classType = (ClassType)type;
// TODO implement this
}
}
pw.println("}");
pw.close();
}
}