EDU.ksu.cis.viewer

EDU.ksu.cis.viewer is a Java package of tools for viewing and manipulating trees. The package includes an applet that may be run in your browser. If your browser won't run this applet, you might want to try an earlier version of the package.

The remainder of this page describes how to install and use the package on your own platform. The Java 2 platform is required.

Installation

  1. Download the file viewer.jar (27K). This file is an executable JAR archive. Normally there is no need to unpack it.

  2. (Optional) Add the path to this file to your CLASSPATH variable.

Usage

The complete package documentation can be browsed here.

There are two main uses of this package.

  1. Search Tree Viewer. This is the applet included in the package, but it also runs as a stand-alone application. To run the program:
         java -jar viewer.jar
         
    Please note the case of the letters in the above command. On Windows, the application can also be run by double-clicking the icon for viewer.jar.

    To create and manipulate a tree, enter any string in the text field in the upper left-hand corner, and press either the Put button to add that string as a key to the tree, or the Remove button to remove that key from the tree. The keys will be maintained in lexicographic order. The Back and Forward buttons allow you to move through the history of your tree construction. The Clone button opens a new window with an exact copy of the tree and history in your current window; the tree in this window can then be manipulated independently.

    Important Note: This applet treats all keys as strings. You may enter numbers, but be aware that they will be treated as strings (e.g., "10" < "5"). Virtually all of the questions I've received regarding this program have reflected a misunderstanding of this fact.

  2. Tools for viewing trees built from user code. In order to be able to implement a tree that can be displayed using this package, you must write your tree class to implement TreeInterface. If you wish to have colored nodes, you will also need to provide a class that implements Colorizer. You may then use the TreeDrawing, TreeComponent, and/or TreeFrame classes to display your tree. If you didn't add this package to your CLASSPATH, you will need to specify it when you compile and run your program; e.g.:
         javac -classpath viewer.jar *.java
         java -cp .;viewer.jar MyClass.java
         
    (On unix, the ";" is replaced by a ":".)

Other downloads

Both of the above files are JAR archives, which may be unpacked with either jar (a tool that comes with Java) or WinZip.

See also: A demo that uses this package for drawing AVL trees of a given height using a minimum number of nodes.


Last updated April 5, 2000.

Rod Howell (howell@cis.ksu.edu)