-
- private Graph toGraph() {
- Graph graph = new Graph();
- new Node(graph, "Foo");
- return graph;
- }
-
- @SuppressWarnings("unused")
- private void visualize() {
- final Graph graph = toGraph();
-
- // Show it
- new Thread() {
- public void run() {
- final Display display = new Display();
- final Shell shell = new Shell(display);
-
- GraphvizComponent comp = new GraphvizComponent(shell, 0);
- comp.setGraph(graph);
-
- comp.setBounds(0, 0, 800, 600);
- shell.pack();
- shell.open ();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) display.sleep();
- }
- display.dispose();
- }
- }.start();
- }