X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FResult.java;h=cb351ebbebb0cb27fa34e2f021be4f59b7d59cae;hb=0620c2d97d6df986d74dbe13160afb1435096431;hp=8eccf96eb4d9cfbee7e8b374267cf840ac5818e0;hpb=e84029a8b861075d6d0ed5040f919b2e4da4c98f;p=sbp.git diff --git a/src/edu/berkeley/sbp/Result.java b/src/edu/berkeley/sbp/Result.java index 8eccf96..cb351eb 100644 --- a/src/edu/berkeley/sbp/Result.java +++ b/src/edu/berkeley/sbp/Result.java @@ -9,7 +9,7 @@ import java.io.*; import java.util.*; import java.lang.reflect.*; -class Result { +class Result implements GraphViz.ToGraphViz { private Forest f; private Node parent; @@ -28,4 +28,20 @@ class Result { if (parent != null) phase = parent.phase(); } + // GraphViz ////////////////////////////////////////////////////////////////////////////// + + public GraphViz.Node toGraphViz(GraphViz gv) { + if (gv.hasNode(this)) return gv.createNode(this); + GraphViz.Node n = gv.createNode(this); + n.label = ""+f; + n.shape = "rectangle"; + if (parent()!=null) n.edge(parent, ""); + n.color = "blue"; + if (phase() != null) + ((GraphViz.Group)phase().toGraphViz(gv)).add(n); + return n; + } + public boolean isTransparent() { return false; } + public boolean isHidden() { return false; } + } \ No newline at end of file