Physlet scriptors - interactive Physlet documentation.

Physlet scriptors are webpages that provide interactive documentation of popular Physlets. A mouse click on a specific command will generate a running Physlet page showing the feature to explore.

Currently available:

Download (zip)

Physlets

Online preview

Exercise

1. Optics (optical bench)

OpticsApplet

Optics

Optics

2. AnimatorDG (mass points)

Animator + DataGraph
+ Sliders

AnimatorDG

 

3. EFieldDG (el. charges)

EField + DataGraph
+ Sliders 

EFieldDG

EFieldDG

4. Ripple(2dim wave interference)

Ripple

Ripple

 

5. BField(from wires and coils)

BField

BField

 

6. QTime (quantum mechanics)

QTime

QTime

 

Requirements:

  • Internetexplorer 5.0
    (on newer systems activate Java virtual machine in menu Tool/Internet options/Advanced..!) 
  • also tested with Firefox 2, Netscape 7.1 and Mozilla 1.6a for Windows
    (First opening of preview takes long.)
  • no experience with other browsers yet (feedback via e-mail appreciated)

How it works:

Download the zip archive for the Physlet you have in mind. Extract and start the scriptor in the folder "start" in your web browser.

Select commands for physlet configuration from a table with a mouse click.
E.g., to insert a lens with a focal length of 2 units at position x=2.5, just click on such a hyperlink "Lens":

(i)

Lens

 x:  focal length:  

The Physlet scriptor automatically creates the appropriate JavaScript statement

id1 = document.OpticsApplet.addObject("lens","x=2.5,f=2");

and refreshes a preview window that contains e.g. the new lens.

The (i) provides a hint how to use this command.

The preview appears in a separate browser window. From there, you can save the source as a *.html page  (right click in the preview window). This new physlet page will work offline, provided the according physlets (*.jar files from Davidson) are available in a given local directory (see the path in the scriptor's codebase field). The final layout can be done in any web editor like the free KompoZer or MS Frontpage Express.

MetaBuilder

MetaBuilder (zip) allows to construct new Physlet scriptors and modify existing ones. This is an advanced technique. Very similar to Physlet scriptors, MetaBuilder is technically one single html page out of which Physlet scriptors pop up in new browser windows using internally JavaScript.

MetaBuilder contructs a Physlet scriptor's colored rows from syntax descriptions of a physlet's JavaScript methods. There are guidances for the particular form of such syntax descriptors, e.g. for the above table row:

addObject|id
#FF707D
>>> tt >>>
Insert lens at position x, with focal length f. The graphical representation
of the lens is independent from...
>>> tt >>>
Lens
s|name|lens|HIDDEN
$
.|d|x|2.5|x:
.|d|f|2|focal length:

This is explained in the built-in help of MetaBuilder. Templates for all methods of all available physlets can be found in these text files (June 2001). Copy and paste the lines that describe the method which you want to include in your own Physlet scriptor. If necessary, modify tool tip texts and labels of input fields.

In addition, the source code of an existing Physlet scriptor can be pasted in MetaBuilder in order to retrieve the syntax descriptors for its colored rows that can such be modified.

Features:

  • multiple applets on one web page
  • multiple scripts on one page, launched by push buttons on the physlet page
  • data connections between applets (e.g when a DataGraph applet traces the kinetic energy of a mass point in Animator)
  • input fields with range checking (error message for applet user)
  • sliders with associated onMove-scripts (if meaningful)

The Physlet scriptors that you might create on your own in the meantime can be upgraded with the new MetaBuilder, lateron... Please send us your results in an e-mail.

 

                        

 Davidson