Animator Embedding

Animator is designed to model particle dynamics in two dimensions using JavaScript.

Animator is embedded using the following html tag:

<applet
  code="animator4.Animator.class"
  codebase="../classes"
  archive="Animator4_.jar,STools4.jar"
  name="animator" 
  width="250"
  height="250">

<param name="FPS" value="10" />
<param name="ShowControls" value="false" />
<param name="Dt" value="0.02" />
<param name="PixPerUnit" value="10" />
<param name="GridUnit" value="1.0" />
</applet> 

Edit the codebase parameter to reference the archive directory.

Animator Parameters

ShowConttrols  boolean   True to show user interface.
FPS  int  Animation frames per second.
Dt  double  Pixels per unit scaling parameter.
PixPerUnit  double  The initial temperature.
GridUnit  double  Grid size in world units;  GridUnit=0 disables grid.

STools Parameters

AppletNames  string  A comma delimited list of applet names occurring within this html page. (See OnLoad.)
Debug  int  Enables debugging messages in Java console; 0 = no messages, 255 = verbose messages.
OnLoad  string  A JavaScript function that will be invoked using LiveConnect after all applets have been loaded.  (See AppletNames.)
Resources  string  A file containing translations of internal text such as buttons and labels.

Animator Script

A typical Animator script is written as follows:

<script LANGUAGE="JavaScript">
function demo(){       
   document.animator.setDefault();
   document.animator.shiftPixOrigin(-100,0)
   document.animator.setPixPerUnit(10);
   document.animator.setGridUnit(1);
   id=document.animator.addObject("rectangle","w=50, h=15");
   document.animator.setTrajectory(id,"5*t*t","0");
   document.animator.setRGB(id,255,0,0);
   id=document.animator.addObject("arrow","h=5,v=0");
   document.animator.setTrajectory(id,"5*t*t","0");
   document.animator.setRGB(id,0,0,255);
   document.animator.setCaption("Demo 2");
   document.animator.setTimeInterval(0,2);
   document.animator.forward();
}
</script>