package org.enoir.graphvizapi;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by frank on 2014/11/20.
 */
public class Graph extends BaseGraphObject {

    private GraphType graphType;
    private List<Node> nodeList;
    private List<Edge> edgeList;
    private List<Graph> subgraphList;

    public Graph(String id,GraphType graphType){
        super(id);
        this.graphType = graphType;
        this.nodeList = new ArrayList<Node>();
        this.edgeList = new ArrayList<Edge>();
        this.subgraphList = new ArrayList<Graph>();
    }

    public void addNode(Node node){
        this.nodeList.add(node);
    }

    public void addEdge(Edge edge){
        this.edgeList.add(edge);
    }

    public void addSubgraph(Graph graph){
        this.subgraphList.add(graph);
    }


    @Override
    public String genDotString() {
        return null;
    }
}


@@ -800,17 +800,16 @@
 %0A    %7D%0A%0A
-%0A
     @Ove
@@ -861,19 +861,324 @@
     
-return null
+StringBuilder dotString = new StringBuilder();%0A        return dotString.toString();%0A    %7D%0A%0A    private String genNodesString()%7B%0A        StringBuilder nodeString = new StringBuilder();%0A        for(Node node: nodeList)%7B%0A            nodeString.append(node.genDotString());%0A        %7D%0A        return nodeString.toString()
 ;%0A  

Add GenNodesString method.