PrintStream out = new PrintStream(new FileOutputStream(file, false));
out.printf("G,%s,%s,%s\n", isDirected(), animator.isEdgeWeightVisible(), animator.isEdgeFlowVisible());
for(Integer i : vertices.keySet()) {
v = vertices.get(i);
out.printf("V,%d,%s,%s,%s,%d,%d\n", v.getId(), animator.getData(v.getId()), animator.getEastText(v.getId()), animator.getSouthText(v.getId()), animator.getX(v.getId()), animator.getY(v.getId()));
}
for(Integer i : edges.keySet()) {
e = edges.get(i);
out.printf("E,%s,%d,%d,%d,%f,%f,%f\n", e.getClass().getName(),e.getId(), e.getStart().getId(), e.getEnd().getId(), e.getWeight(), e.getFlow(), e.getCapacity());