Class Viewer

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class Viewer extends Panel
This is the driver class for the Search Tree Viewer. It now will only run as an application. It recognizes a single command-line argument, "mono", which indicates that the program should run in monochrome mode, displaying red nodes as gray (for AA Trees and Red-Black Trees). Any other command-line arguments are ignored. The program displays the following GUI:

The tree viewer main GUI.

On the left are seven choices:

  • AA Tree
  • AVL Tree
  • Binary Search Tree
  • Red-Black Tree
  • Patricia Trie
  • Splay Tree
  • Trie
When the Start button is pressed, a frame for creating and manipulating an instance of the current choice is displayed. When this window is closed, the program terminates.
Author:
Rod Howell (rhowell@ksu.edu)
See Also:
  • Constructor Details

    • Viewer

      public Viewer()
      Constructs an instance of the Viewer GUI with default size.
  • Method Details

    • main

      public static void main(String[] args)
      Starts the viewer as an application. Opens a Frame containing the Viewer GUI. If the Frame is closed, the application terminates.
      Parameters:
      args - command-line arguments
    • openWindow

      public void openWindow()
      Event handler for the Start button in the Viewer GUI. Opens a Frame for creating and manipulating an instance of the current choice.
    • isMonochrome

      public static boolean isMonochrome()
      Gets whether the program is running in monochrome mode.
      Returns:
      whether the program is running in monochrome mode.