The Diva Graph Tutorial

The directory graph/tutorial in the Diva distribution contains a set of programs that are designed to illustrate how to use key features of the graph package. Each class is self-contained, so that you can see all of the code in one place, and as short as possible given the constraints of making them somewhat realistic.

The following pages are an introduction to each of the programs, and designed to provide a starting point for reading the code. Small code snippets are used to illustrate, but the key reference is of course the code itself. As well as reading the source file, you can read the javadoc for the tutorial package.

The tutorial pages were written assuming that you will run each tutorial example as you read. Each page gives the name of the relevant Java class. To run that program, change to the diva/graph directory and type:

  make SimpleTutorial

(where SimpleTutorial is replaced by the class you want to run). A Java window will appear where you can see and manipulate the graph elements.