SlideViewer Applet Documentation

# Welcome to the SlideViewer Applet Page

### Author: Mike Crider

#### Latest Version: 2.1

The SlideViewer applet allows the user to specify pleasant transitions between images. Below is an example of the SlideViewer applet performing all types of transitions. See the Full Example page to see the same transition set with descriptions of the transitions directly below the applet.

### Netscape 2.0 or another Java-Enabled Browser is required to view the SlideViewer Applet

(The coast, storm, and bridge images were taken by Chris Taylor.)

## SlideViewer V2.0 Notes

Several main things of interest/importance to SlideViewer 2.0:

- Lockup Problems -- Unfortunately, I have been unable to fix problems with SlideViewer sometimes locking up on going to a page more than once or reloading the page during editing. Java seems to simply stop during the reading of the script file (after a certain number of lines). Reloading the page once or a couple more times usually gets the applet going again. (This is listed under "Known Bugs" below, as well.)
- First image in script -- The first image specified in the script is now loaded as soon as the script has been read and before the remainder of the images have been loaded. No work is performed on the image to make sure it fits nicely in the applet space. It is recommended that that image be the correct size for the space so that it will look nice when it is loaded.
- Size of SlideViewer space -- Since applets can no longer resize their applet space on the page, SlideViewer now automatically uses the space it has and pads the images to that size. If images are larger than the applet space, very strange effects will result -- make sure enough space is allocated.

## SlideViewer V2.1 Changes

The following changes were made in SlideViewer 2.1:

- Frame Targeting -- It is now possible to target frames for a picture's "page" by adding a "target" parameter. For example,

      pic key=coast url=ca_coast7.gif page=http://java.sun.com/ target=myframe

  will bring up the java.sun.com page in the frame "myframe". If left unspecified, SlideViewer defaults the target to "_self" to bring up the page in its own frame.
- Improved FastForward -- The fast forward control ('F' key) works much better now, giving nearly double the speed. It is also possible now to hold down a number key, 2-9, to speed up the show, where 2 nearly doubles the speed, and 9 is about 9 times as fast.

## SlideViewer Scripts

SlideViewer is completely controlled via a script file. The specification of the images to use and the transitions to go through are specified in the script. This allows for large transition sequences to be easily written and edited. Read the SlideViewer Script Description page for more information.

As a brief example of the script format, the blinking above was implemented as a loop of Appearing a black image, pausing, Appearing the normal image, and pausing again. The following script section implements the blinking shown above:

       do
          appear pic=black
             delay 300
          appear pic=interesting
             delay 300
       repeat times=2

Look at the script to see the entire commented script which is being performed above. The Full Example page displays the applet with descriptions of the transitions below it.

The above example is a bit abnormal since it goes through every transition, doing every direction. You may be interested to look at a more practical example.

Any errors discovered in the script file will be logged in the java console. SlideViewer also prints all lines it reads to the java console, which allows the user to see if Java has locked up SlideViewer (if it has stopped reading the file before reaching the end).

## SlideViewer Controls

SlideViewer has the capabilities of having a page associated with each image. The URL for the image will be displayed as a "Go to" in the Status bar of the browser. Clicking on the image when the "Go to" message is displayed will take the user to the specified page. As an example, in the SlideViewer script being displayed above, clicking on the Netscape image that appears occasionally will take you to http://java.sun.com/.

There are also several keys that can be used to control the show:

- <Space> -- Start over at the beginning of the script.
- F -- FastForward through the transitions. Supplies a little extra speed to transitions, especially those with longer delay settings.
- '2'-'9' -- Pressing a number key, 2 through 9, will speed up the transitions that much, where '2' gives double speed, and '9' gives nearly 9 times the speed.
- P -- Toggle pause mode. Stops and resumes the current transition where it currently is. A blinking VCR style pause light is displayed in the upper right corner of the display when it is paused.
- S -- Stop. Turns on pause mode.
- C -- Continue. Turns off pause mode.
- V -- Version Info for SlideViewer

## SlideViewer Source

The complete documentation, source, and compiled class files from SlideViewer are available in one packaged tar.gz:

  SlideViewerV2.10.tar.gz

  SlideViewer consists of two source files (below). I wrote a modularized version in which each transition was a separate module in a different .java file, but scrapped it because it took too long to load the 20 .class files.

  - SlideViewer.java -- the main applet class which performs all of the transitions (~75K)
  - SlideScript.java -- the script class which loads and contains the script information (~25K)

  #### Java Alpha3 Version

  If there is any interest, the Java Alpha3 version is also available. The HotJava browser is necessary to see Alpha3 applets.

  ## Known bugs

  - For some reason, when a page with SlideViewer is reloaded (such as going to the page again or reloading it to check on the changes made to the page while updating it), the applet gets stuck and will not finish loading and running. As far as I can tell, either Netscape or Java itself simply tells the applet to stop during a read_script_line call. Sometimes reloading the page a couple more times will get the applet running again.

  Last updated: March 18, 1996