Layers, a Java (TM) applet for displaying layered images

This is a help file for the configuration and implementation specifics of the applet. If you need help with the user interface or content of the applet, see the Applet Help document.

Contents:

The Layers applet allows a configurable method for presenting a set of related images. Each layer can be optionally displayed by selecting labeled checkboxes. Layers can be classified into arbitrary groups where only one layer of any given group is displayed at any given time.

The images for the layers are presumed to be identical in dimension and spatial characteristics, e.g., the pixel at any given x/y or row/column location in each layer describes the same position in 2-D space, e.g., latitude/longitude in map-projected geo-spatial data, or specimen body location in a set of biological cross-section images.

It is intended that image transparency be used in order to best present all the data in the image layers. Although you can use the TRANSPARENCY keyword in label descriptors (described below) to have the applet make the images transparent, it is more efficient to generate the images with transparency preset, rather than have the applet do the computation each time it is executed.


Using the Applet

In order to use the applet, you must have three components:

It is assumed that you have basic knowledge of HTML and access to a World Wide Web server from which to serve the applet (or at least a WWW browser from which to load the applet locally). You must set up an HTML document to reference the Java applet. The <APPLET> and applet <PARAM> tags are used to configure the applet parameters and indicate where to find the images and the applet itself. The parameters used by this applet are described below. In the following parameter descriptions, case is significant, with all fixed parameter names in upper case, and all parameter values and descriptor parameters case sensitive.

Required parameters

Optional parameters

Image Descriptors

Descriptors provide information about a specific layer/image listed in the LABEL parameter. There are five basic types of descriptors:

The difference between a Parent Checkbox and a Parent Label is largely semantic. A Parent Checkbox can be thought of as a set of options of which zero or one can be selected, with the Parent Checkbox as the "no choice" selection. The Parent Label is used when one of the set of choices must always be selected. Note that the startup condition for a group that isn't specified by one and only one PRELOAD directive per group is undefined, as it depends on the underlying platform-dependent implementation of the Checkbox class in the Java API.

Descriptor Keywords

Example applet specification

In the example below, a set of nine layers of meteorological data is used. The main class is named "Layers.class" and allows a 640-pixel wide by 440-pixel high area for the applet (enough room to display the images with labeled checkbox buttons to the right). The HTML document containing the below tags and the Java class files are in the same directory, with the images in a subdirectory named "images" (the directory delimiter, a slash, is necessary in the value specification). The initial three image layers, different types of satellite images, are specified as a group so only one of the images can be displayed at any given time.

Limitations

  1. Image navigation (identifying image location in real-world terms) and calibration (identifying image layer values in real-world terms) are not yet implemented. Relaxed security restrictions or a more secure method of loading arbitrary classes over the network would be helpful.

  2. Dynamic resizing is not done (and is difficult given the current state of applet/browser communication). Care must be taken to specify an appropriate WIDTH and HEIGHT in the <APPLET> tag.

  3. Layers are overlayed in the order they are specified in the LABELS parameter. Care should be taken that information-dense layers do not obscure information-sparse layers. (This limitation can be accounted for in a future release if deemed necessary by allowing a layer priority parameter in the layer descriptor.)

  4. Layer controls are presented in the order they are specified in the LABELS parameter. Care should be taken that group checkboxes, group parents, and labels are specified in a logical order so group checkboxes aren't confusingly interleaved with solo checkboxes or labels.

  5. All image layers are assumed to be spatially correlated and have the same dimensions. (This limitation can be relaxed in a future release if deemed necessary, by allowing X/Y or row/column offsets in the layer descriptor.)

  6. The "Applet Help" functionality depends upon using a browser that can do a showDocument(), so it is not guaranteed to work properly.

  7. When using the full-image transparency feature, I've found that for many levels of transparency distracting artifacts appear in the image.

  8. The applet was originally developed as a proof-of-concept prototype and as a way to introduce the author to object oriented programming in general and to Java in particular. The source code should not be used as a good example of either.

Improper or Unexpected Display

Java and Java-capable browsers are still experiencing growing pains and may exhibit undesirable or unstable behavior. Problems I've noticed include relatively frequent application crashes, occasional failure to render or resize GUI items (making them invisible or truncated), etc. The Windows versions of Netscape Navigator seem especially notable for anomalous user interface and display problems.

In addition, there can be platform-dependent problems with the images. For example, the Windows platforms always dither the colors in the images to a small, fixed set of colors. This may make them seem to be low resolution. The satellite images can appear dark, most notably on platforms that don't do gamma correction.

There are also known limitations with Netscape Navigator; check your Netscape "Release Notes/Known Problems" documentation for more details. For more information about the Netscape Navigator from Netscape Communications Corporation, see http://home.netscape.com/.

With the latest version(s) of Internet Explorer, images fail to load if you have the Just-in-time JIT) compiler enabled.

Please also note that due to continuing changes in the Java API, some newer applets will not function properly with older versions of the browsers, so you may want to use the latest version of your browser.

Finally, you may have encountered a programming error or limitation. Feel free to report bugs or suggest improvements to me at plutchak@uiuc.edu (Joel Plutchak).

How to View Java Beta Applets

In order to view Java Beta API applets within a web browser, you need to have a browser that is Java Beta capable. If the documentation for the browser you are using does not discuss Java capability, chances are good that you do not have a Java-capable browser. Consult your browser supplier for details.

As of March 28, 1996, the following browsers or applications could run Java Beta applets:

(Athe time of this writing, no released version of Sun's HotJava browser supported Beta applets.)

Learning More About Java

For more information about Sun Microsystem's Java Programming Language and HotJava(tm) Browser, see
http://java.sun.com/.

Author contact information


(Last Modified: 29-Mar-1996)
Java ® is trademark of Sun Microsystems, Inc. For more information, see
http://www.javasoft.com/.