| 396 | } |
| 397 | |
| 398 | @Override |
| 399 | public void emit(DrawDot dot, PrintWriter writer, String indent) throws IOException { |
| 400 | for (String s : commentsBefore) { |
| 401 | writer.println(indent + "// " + s); |
| 402 | } |
| 403 | writer.println(indent + (clustered ? "cluster_" : "") + header()); |
| 404 | for (String s : commentsHeader) { |
| 405 | writer.println(indent + INDENTION + "// " + s); |
| 406 | } |
| 407 | if (rankDir != null) { |
| 408 | writer.println(indent + INDENTION + "rankdir=\"" + rankDir.name() + '"'); |
| 409 | } |
| 410 | for (Child child : children) { |
| 411 | child.emit(dot, writer, indent + INDENTION); |
| 412 | } |
| 413 | for (Connection connection : connections) { |
| 414 | connection.emit(this, writer, indent + INDENTION); |
| 415 | } |
| 416 | writer.println(indent + footer()); |
| 417 | for (String s : commentsFooter) { |
| 418 | writer.println(indent + INDENTION + "// " + s); |
| 419 | } |
| 420 | for (String s : commentsAfter) { |
| 421 | writer.println(indent + "// " + s); |
| 422 | } |
| 423 | } |
| 424 | |
| 425 | public Graph add(Child child) { |
| 426 | children.add(child); |