The Tree Project logo

UML diagrams

Click on the links to see the full size diagrams.

You can also use the diagrams below. They are scaled down a bit but you can right click on a diagram and save it to your hard drive. Then use your favorite picture viewer.

Class diagram

The Tree Project class diagram

The diagram shows:

Every “use” or “use all” relationship corresponds with a Java import statement.
Also, inheritance is used a few times, this is the Java extends keyword.
And finally, two interfaces are implemented, this is the Java implements keyword.

Sequence diagram for initialization

The Tree Project sequence diagram for initialization

The diagram shows:

The lifeline of the Tree class is the main() method.
The diagram shows the creation of two Node objects and one Branch object but of course the mechanism is the same all the time.
The paint() method is called by the update() method in the TreeCanvas object. The latter is not called by our code but invoked by the AWT when the Frame object is made visible.
Although the main() method in the Tree class finishes, the GUI components live on because the AWT has its own thread.

Sequence diagram for user control

The Tree Project sequence diagram for user control

The diagram shows:

The ScreenControlRunner class implements the Runnable interface. This thread is distinguished from the main thread by using blue instead of yellow color (or a darker shade, for the color blind).
Note that this use of color is not an official UML visualization but it works for me. The UML par control operator seems awkward to use here.
The Thread object will exist even after the ScreenControlRunner thread has terminated but it will be garbage collected when the object reference variable is assigned a new Thread object after the user presses another control button.

State diagram for parsing a tree file

The Tree Project state diagram for use case Parse tree file

The diagram shows a state machine which models the use case ‘Parse tree file’. The implementation of that use case forms a major part of the code that reads a tree from a file. See the Technical description of tree package, which is part of the documentation accessible from the documentation link on the home page.

The Tree Project is an ongoing project so the design may change in the future!