JAWAA Help


JAWAA has been designed to be easy to use without requiring much experience with the Web or Java. After the initial setup, the user should find it fairly easy to learn the script format and to begin creating their own animations.

As the applet is contained within a Web page, we must first create that Web page. If you have don't have experience with Java applets you can simply copy the following template into a file ending with a .html extension in your public_html directory.

<HTML> <BODY> <APPLET CODEBASE="http://www.cs.duke.edu/~wcp/classes/stable/" CODE="AnimClass.class" WIDTH=450 HEIGHT=350 ALIGN=CENTER> <PARAM NAME=animLoc VALUE="http://www.cs.duke.edu/~wcp/classes/anims/DFS.anim"> <PARAM NAME=animName VALUE="DFS"> </BODY> </HTML>

This will create a page containing the applet to display aniamtions. The first two lines of the Applet tag indicate the location of the code needed to run the animation. This will point to the Java objects in my directory. This means that you don't have to copy the program to your machine and that you will immediately recieve updates to the program. The user will want to change the values of the two parameters. The first parameter "animLoc" specifies a URL for the animation script. The second parameter, "animName", indicates the name of the animation. These paramters will be passed to the program at run-time. The applet will then grab the script from the specified location and proceed to display the animation.

This brings us to the topic of how to write an animation. Animation scripts are simple text files with one instruction per line. For example, here is the script for the depth first search animation.

The first line of the animation is the keyword begin. Every command between begin and the line end will be drawn on the screen immediately. After the initial state of the animation is drawn, the user will have to press "play" to begin the animation. Each line consists of a command and then a parameter list. For example the following line comes from the DFS animation:

	node n1 120 30 20 black lightGray

The first word in the line, node, is a command to create a node in the animation. The rest of the line contains parameters to this command. The string n1 is the name of the node. The next two numbers, 120 and 30, are the x and y coordinates. And the last two strings are colors which indicate the outline and background colors respectively. Any line beginning with a "#" is considered a comment.

Therefore, in order to write an animation all one needs to do is look up the command desired along with the required parameters. The commands and valid color names have been listed on the Help with Commands page.

The "Java Console " window can also be used with deugging. The window can be opened from the "Options" menu in Netscape.