Java code to lay out out an arbitrary graph (nodes and links) on the screen