STools Version 4

Why are there two versions of some Physlets?

Physlets are based a common class library that we refer to as Science Tools for Java Programmers. We are now distributing this library as a Java Archive file, STools4.jar, so that others can write applets that use the technology that we have developed.  The new library has extended functionality and different organization from previous STools packages.  Physlets are now being recompiled to to use this new archive.

Only minor changes need to be made to scripts in order to incorporate the new package.

  1. You do not need to change a script in any way if the script accesses a Physlet packaged in a single jar file containing all the resources necessary to run.  For example, a script that uses just Animator.jar or EField.jar does not need to be changed.  These archives already contain the new tools.  You should, of course, update the necessary jar file on your local server.
  2. If a script uses multiple jar files for inter-applet communication, the archive attribute must be modified to use the new tools and the new applets.
  3. You cannot mix-and-match applets that use version 4 of STools and previous version of STools.

For example, Animator and DataGraph applets can be embedded on the same page and communicate using data connections if their archive attributes are written as follows:

archive="Animator4_.jar,DataGraph4_.jar,STools4.jar"

instead of the old

archive="Animator_.jar,DataGraph_.jar,SGraphics.jar,STools.jar"

Finally, we should explain our notation. We usually break up Physlet jar files to remove common class libraries. Almost all Physlets require numerical methods and graphics toolkits from STools4.jar. Rather than including this library with every Physlet, we prefer to provide Physlet jar files without this common library. These abbreviated jar files have an underscore appended archive name.

Animator4.jar -> Animator4_.jar, STools4.jar
DataGraph4.jar -> DataGraph4_.jar, STools4.jar
DataTable4.jar -> DataTable4_.jar, STools4.jar

Multiple applets can then be specified in comma delimited list as shown above.  Embedding a Physlet by specifying multiple jar files should not increase and may decrease download time, since jar files are only downloaded once no matter how many times they appear on a page.