Previous ION Java User's Guide: Using ION's Pre-Built Applets Next

Parameters Specified via <PARAM> Tags

The HTML <PARAM> tag is more like an attribute of the <APPLET> tag than a separate HTML tag. Although it is a tag, it is valid only inside an <APPLET> tag (or an <OBJECT> tag). It functions to pass parameters to the applet. This section discusses parameters common to all ION Applets. Parameters specific to individual applets included in the ION package are discussed in the applet-specific sections below.

The syntax of the <PARAM> tag is as follows:

<PARAM NAME="name" VALUE="value">

The NAME attribute can be set to one of the following parameters:

Connecting to the ION Server

Before IDL commands can be executed and graphics created, the ION applet must connect to the ION Server. Establish a connection by including the following connection parameters in the HTML code that creates the applet.

SERVER_NAME

Set this value of this parameter equal to the name of the computer on which the ION Server is running. The server name can be either a simple host name (i.e. myhost) or a fully-qualified domain name (i.e. myhost.mycompany.com). Java security mechanisms require that the applet be located on the same machine as the ION Server. If the server name is not provided, the host name of the machine from which the applet was loaded is used.

PORT_NUMBER

The port number of the port on the server where the ION Daemon is listening. By default, the ION Server listens to port 7085.

SERVER_DISCONNECT

Set the value of this parameter equal to "YES" if you want the applet to disconnect from the server when all commands have been processed. (Note that if more than one applet is using the connection, the connection will not be closed until all commands from all of the connected applets have been completed.) The default value is "NO".

CONNECTION_TYPE

Set the value of this parameter to specify what type of connection ION should use. The three possible values are:

CONNECTION_TIMEOUT

Set the value of this parameter to an integer number of seconds to wait before assuming that a socket connection has failed.

Example

The following connects the "MyApplet" applet to a server named "Server1", using the default port number, the default connection type, and specifies that the applet should not disconnect from the server when all commands have been processed:

<APPLET NAME="MyApplet" WIDTH=100 HEIGHT=100  
    CODE=com.itt.ion.IONGraphicApplet.class>  
    ARCHIVE="ion_64.zip"  
    CODEBASE=../classes>  
    <PARAM NAME="SERVER_NAME" VALUE="Server1">  
    <PARAM NAME="SERVER_DISCONNECT" VALUE="NO">  
<!-- Other applet code -->  
</APPLET>  

Using the Same Connection for Multiple Applets

Multiple ION applets can share a single connection to the ION Server. Since each open connection consumes network bandwidth, it is often efficient to let several applets share the same connection.

To specify an existing connection for a new applet, use the ION_CONNECTION_NAME parameter rather than the SERVER_NAME, PORT_NUMBER, and SERVER_DISCONNECT parameters.


Note
All applets using the same connection must be loaded into the browser at the same time. In general, this means that applets that share a connection should be included in the same HTML page.

ION_CONNECTION_NAME

Set the value of this parameter equal to the name of the applet whose connection you wish to share. The applet's name is specified by the NAME attribute in the APPLET tag.

Example

The following creates a second applet named "AnotherApplet" and specifies that it share the server connection created for "MyApplet":

<APPLET NAME="AnotherApplet" WIDTH=100 HEIGHT=100  
    CODE=com.itt.ion.IONGraphicApplet.class  
    ARCHIVE="ion_64.zip"  
    CODEBASE=../classes>  
    <PARAM NAME="ION_CONNECTION_NAME" VALUE="MyApplet">  
<!-- Other applet code -->  
</APPLET>  

Behavior Parameters

Two behavior parameters determine how an applet responds to certain user actions. The two behaviors currently supported by all ION applets allow the applets to display debug information and link to other HTML pages. Use the following parameters to alter the behavior of pre-built applets:

DEBUG_MODE

If the value of this parameter is set to "YES," holding down the shift key and clicking the mouse in the applet drawing area displays a window containing the IDL commands and server responses associated with the applet's connection. If more than one applet is connected to the connection, the information for all applets is displayed. If the main connection has DEBUG_MODE set to "NO" (or not specified), but an applet connected to it has DEBUG_MODE turned on, debug will be turned on for the entire connection. The default value is "NO."

LINK_URL

Set the value of this parameter to a URL that will be loaded if the user clicks in the applet area. The switch to the linked URL happens before any mouse events are passed to the server. This option should not be used with ION applets running IDL routines that accept mouse input.

Example

The following specifies that the "MyApplet" applet will display debug information and will link to the ITT Visual Information Solutions web page if the user clicks in the applet drawing area:

<APPLET NAME="MyApplet" WIDTH=100 HEIGHT=100  
    CODE=com.itt.ion.IONGraphicApplet.class  
    ARCHIVE="ion_64.zip"  
    CODEBASE=../classes>  
    <PARAM NAME="SERVER_NAME" VALUE="Server1">  
    <PARAM NAME="SERVER_DISCONNECT" VALUE="NO">  
    <PARAM NAME="DEBUG_MODE" VALUE="YES">  
    <PARAM NAME="LINK_URL" VALUE="http://www.ittvis.com">  
<!-- Other applet code -->  
</APPLET>  

  IDL Online Help (March 06, 2007)