[ Back to install ]

TeamStats

The program

The program consists of a number of Java class-files. These files must be placed in a directory named ts (except the files HyperLink.class, ModeButton.class and ModePanel.class who go into the ui directory). The ts and ui directories must be placed in a directory named embe. The embe directory can be placed anywhere. The embe, ts and ui directories should be created automatically when you unzip the zip-file. If they aren't you can create the directories manually.

Example of directories:  c:/program/TeamStats/embe/ts
                         c:/embe/ts
                         /home/bob/embe/ts

The HTML-document

To insert TeamStats in a HTML-document you use the APPLET-tag. It has the following syntax:

<APPLET CODEBASE="URL to code" CODE="appletfile" WIDTH="pixels" HEIGHT="pixels">
<PARAM NAME="parametername1" VALUE="parametervalue">
<PARAM NAME="parametername2" VALUE="parametervalue">
...
</APPLET>

There are more attributes available to the APPLET-tag. Anyone interested can find them here.

CODEBASE

Optional attribute that states where the program is placed. In the TeamStats case it is the URL to the directory that contains the embe directory. The URL can be given relatively to the HTML-documents URL, for example CODEBASE="../program". If this attribute is missing the URL to the HTML-document is used to locate the code. That means that the embe directory is assumed to be in the same directory as the HTML-document.

CODE

Required attribute that gives the name of the file to execute. The value of this attribute must be CODE="embe.ts.TeamStats.class".

WIDTH

Gives the width of the Applet. The value should be WIDTH=560.

HEIGHT

Gives the height of the Applet. The value should be HEIGHT=480.

PARAM

This attribute is used to give parameters to TeamStats. The word PARAM is followed by NAME and then the name of the parameter you want to set. Then you write VALUE and the value of the parameter. In TeamStats some parameters can be set several times, for example LineX. Just replace the 'X' with a number that is increased every time you use the parameter. The first parameter will be Line1, the next one Line2 and so on.

Here are all the parameters that can be set.

Use archive-files to speed up applet loading

One reason for slow loading speed is that most applets consists of several files. TeamStats, for instance, consists of 15 different files that are transferred across the net one at a time. The solution to this problem is to place all the applet-files in an archive and then transfer the archive. Unfortunately the two major browsers (Navigator and Internet Explorer) support different archive types. Navigator uses Zip-files while IE uses Microsoft's own Cabinet fileformat (CAB). However it is possible to combine the two methods and thereby ensure that the applet is transferred as quickly as possible.

Both Zip- and Cab-versions of the program are included in TeamStats. They are named ts.zip and ts.cab and are placed in the embe directory. Don't unpack these files. It's okay to move the files to another location.

Netscape Navigator and Zip-files

You use the ARCHIVE-attribute in the APPLET-tag to give the location of the Zip-file. If ts.zip is in the embe directory it will look like this:

<APPLET CODE="embe.ts.TeamStats.class" ARCHIVE="embe/ts.zip" WIDTH=560 HEIGHT=480>

Navigator will now load the entire program in one transfer instead of in several. It's important to leave the 'standard' class-files where they are. They will be used by browsers who don't understand the ARCHIVE-attribute or if something is wrong with the Zip-file.

MS Internet Explorer and Cab-files

In the APPLET-tag you use <PARAM NAME=cabbase> to give the location of the Cab-file. If ts.cab is placed in the embe directory it will look like this:

<APPLET CODE="embe.ts.TeamStats.class" WIDTH=560 HEIGHT=480>
<PARAM NAME=cabbase VALUE="embe/ts.cab">

Combining the two methods

The best solution is to combine the two methods and thereby ensuring optimal download performance. It can look like this:

<APPLET CODE="embe.ts.TeamStats.class" ARCHIVE="embe/ts.zip" WIDTH=560 HEIGHT=480>
<PARAM NAME=cabbase VALUE="embe/ts.cab">

The two browsers can now use their own method to load the program. Once again note that the 'standard' class-files not should be removed.

Note that this not is a TeamStats feature, it can be used with any Java-applet.

[ Back to install ]
Copyright © 1998 Mats Bovin.
Comments can be sent to mats-bov@dsv.su.se