public static void main(String[] args) {
    // Create the shell
    Display d = new Display();
    Shell shell = new Shell(d);
    shell.setText("GraphSnippet1");
    shell.setLayout(new FillLayout());
    shell.setSize(500, 500);

    final Graph g = new Graph(shell, SWT.NONE);
    g.setSize(500, 500);
    GraphNode root = new GraphNode(g, SWT.NONE, "Root");
    for (int i = 0; i < 3; i++) {
      GraphNode n = new GraphNode(g, SWT.NONE, "1 - " + i);
      for (int j = 0; j < 3; j++) {
        GraphNode n2 = new GraphNode(g, SWT.NONE, "2 - " + j);
        new GraphConnection(g, SWT.NONE, n, n2).setWeight(-1);
      }
      new GraphConnection(g, SWT.NONE, root, n);
    }

    final LayoutAlgorithm layoutAlgorithm = new RadialLayoutAlgorithm();

    g.setLayoutAlgorithm(layoutAlgorithm, true);
    shell.open();
    while (!shell.isDisposed()) {
      while (!d.readAndDispatch()) {
        d.sleep();
      }
    }
  }