@SuppressWarnings("unused") private static <V,E> void printGraph(Graph<V,E> graph) { DOTExporter<V,E> exp = new DOTExporter<V,E>(new StringNameProvider<V>(), null, null); exp.export(new BufferedWriter(new PrintWriter(System.out)), graph); }
@SuppressWarnings("unused") private static <V,E> void printGraph(Graph<V,E> graph) { DOTExporter<V,E> exp = new DOTExporter<V,E>(new StringNameProvider<V>(), null, null); exp.export(new BufferedWriter(new PrintWriter(System.out)), graph); }
public void toDot(File dotFile) { try (FileOutputStream fileStream = new FileOutputStream(dotFile); OutputStreamWriter writer = new OutputStreamWriter(fileStream, "UTF-8");) { DOTExporter<CfgBlock, CfgEdge> dot = new DOTExporter<CfgBlock, CfgEdge>(new StringNameProvider<CfgBlock>(), null, null); dot.export(writer, this); } catch (IOException e) { e.printStackTrace(); } }
public void toSimpleDot(File dotFile) { try (FileOutputStream fileStream = new FileOutputStream(dotFile); OutputStreamWriter writer = new OutputStreamWriter(fileStream, "UTF-8");) { DOTExporter<CfgBlock, CfgEdge> dot = new DOTExporter<CfgBlock, CfgEdge>(new StringNameProvider<CfgBlock>() { @Override public String getVertexName(CfgBlock vertex) { StringBuilder sb = new StringBuilder(); sb.append("\""); sb.append(vertex.getLabel()); sb.append("\""); return sb.toString(); } }, null, null); dot.export(writer, this); } catch (IOException e) { e.printStackTrace(); } }
static public <V> void export(DiGraph<V> g, CharSink dest) throws IOException { final DOTExporterTemp<V, Edge<V>> exporter = new DOTExporterTemp<V, Edge<V>>(new IntegerNameProvider<V>(), new StringNameProvider<V>(), null); try (Writer writer = dest.openBufferedStream()) { exporter.export(writer, g.getGraph()); } }
new StringNameProvider<V>(), new StringEdgeNameProvider<E>(), vertexAttributeProvider, edgeAttributeProvider);