JHotDraw Samples

As part of the JHotDraw framework we include a number of sample applications and applets that demonstrate various aspects of JHotDraw.
  1. JavaDrawApp
  2. JavaDrawApplet
  3. JavaDrawViewer
  4. PertApp/PertApplet
  5. Nothing
  6. Net
Note:To run the sample applets inside a browser requires a browser with JDK1.1 support.
  1. JavaDrawApp

  2. This sample illustrates various standard tools and figures provided with JHotDraw. For a description of its features refer to the help document.

    It uses a custom drawing subclass BouncingDrawing to implement a bouncing figures feature. The animation support is attached to a figure with a AnimationDecorator.

    Support for attaching URLs to figures is implemented by URLTool.

    You can start the application with:

    java CH.ifa.draw.samples.javadraw.JavaDrawApp
    The drawings directory includes some sample drawings. They can be loaded with the open command from the file menu. Note your CLASSPATH has to include the absolute path to the JHotDraw directory otherwise you will run into class loading problems.

  3. JavaDrawApplet

  4. The JavaDrawApplet is the applet version of JavaDrawApp. Since it is an applet the drawing can't be saved. A sample drawing can be loaded from the load choices item.

  5. JavaDrawViewer

  6. The JavaDrawViewer enables to view a JavaDraw drawing. If a figure has an attached URL you can follow it by selecting it with the mouse.

    The sample illustrates how to create a minimal presentation without a tool palette and other user interface adornments.

  7. PertApp/PertApplet

  8. PertApp is simple drawing editor to support the PERT project management technique. With PertApp you can create tasks and define their dependencies. PertApp takes care of tracking the end time of each task.

    For a description of its features refer to the help document.

    This sample illustrates how to create more complex figures and how to use connections. Connections can be created either with a ConnectionTool or ConnectionHandles.

    You can start the application with:

    java CH.ifa.draw.samples.pert.PertApplication
  9. PertApplet

  10. The drawings directory includes some sample drawings. They can be loaded with the open command from the file menu. Note your CLASSPATH has to include the absolute path to the JHotDraw directory otherwise you will run into class loading problems.

    PertApplet is the applet version of PertApp.

  11. Nothing

  12. This is the hello world sample of JHotDraw. It can be used as the starting point for developing your own applications. The samples uses some standard tools to create a simple drawing editor. It is only about one page of code.

  13. NetApp

  14. A simple network editor. It enables the creation of nodes. When selected a node display a set of handles that can be used to connect it with other nodes. Nodes are connected at specific semantic locations. The potential locations are highlighted once the mouse moves inside a node. This sample illustrates the use of LocatorConnectors.

    You can start the application with:

    java CH.ifa.draw.samples.net.NetApp
    A sample net can be found in the drawings directory.