package example;

/**
 * Created by frank on 2014/11/20.
 */
public class apiExample {
}

@@ -15,75 +15,1223 @@
 e;%0A%0A
-/**%0A * Created by frank on 2014/11/20.%0A */%0Apublic class apiExample %7B
+import java.io.File;%0Aimport java.io.FileOutputStream;%0A%0Aimport org.enoir.graphvizapi.*;%0A%0A/**%0A * Created by frank on 2014/11/20.%0A */%0Apublic class apiExample %7B%0A    public static void main(String%5B%5D args)%0A    %7B%0A        apiExample ex = new apiExample ();%0A        ex.draw();%0A    %7D%0A    private void draw()%0A    %7B%0A        Graphviz gv = new Graphviz();%0A        Graph graph = new Graph(%22g1%22, GraphType.DIGRAPH);%0A        Node n1 = new Node(%22N1%22);%0A        n1.addAttributes(new Attributes(%22label%22,%22%5C%22 Node1 %5C%22%22));%0A        Node n2 = new Node(%22N2%22);%0A        Node n3 = new Node(%22N3%22);%0A%0A        graph.addNode(n1);%0A        graph.addNode(n2);%0A        graph.addNode(n3);%0A        graph.addEdge(new Edge(%22%22, n1, n2));%0A        graph.addEdge(new Edge(%22%22, n2, n3));%0A        graph.addEdge(new Edge(%22%22,n3,n1));%0A%0A%0A        String type = %22png%22;%0A%0A        File out = new File(%22/tmp/out.%22+ type);%0A        this.writeGraphToFile( gv.getGraphByteArray(graph, type, %22100%22), out );%0A    %7D%0A%0A    public int writeGraphToFile(byte%5B%5D img, File to)%0A    %7B%0A        try %7B%0A            FileOutputStream fos = new FileOutputStream(to);%0A            fos.write(img);%0A            fos.close();%0A        %7D catch (java.io.IOException ioe) %7B return -1; %7D%0A        return 1;%0A    %7D
 %0A%7D%0A

Add Example.