|
DataGraph allows the addition of geometric shapes using the addObject method:
addObject(String name, String attributes).
Objects usually, but not always, have an on-screen
representation. The first argument is the name of the object to be added,
and the second is a comma-delimited list of parameters.
A lens can be added using the following JavaScript statement:
id=document.physletname.addObject("box", "x=1,y=2,w=50,h=20");.
The
addObject method is very forgiving since not all parameters need to be
specified. Default values are
overridden only if the parameter appears in the list. Incorrect and unsupported parameters do not affect the applet
and are ignored.
Name |
Attributes |
arrow |
x- double x position
of the center in world units |
box |
x- double x position
of the center in world units |
calculation |
x- double x position
of the center in world units |
cfunction |
re- string the
real part. Usually Re[f(x,t)] |
complexdata |
centered- boolean center the wave function |
caption |
x- double x position
of the center in world units |
circle |
x- double x position
of the center in world units |
cursor |
x- double x position
of the center in world units |
function |
f- string the
function. Usually f(x) or f(x,t). |
graph |
No attributes. Use this parameter to determine the drawing order for the data points relative to the geometric objects. |
image |
x- double x position
of the center in world units DataGraph will search for
images in the code-base directory. This is the directory containing the jar files. |
p |
x- double x position
of the center in world units |
protractor a protractor for measuring angles |
x- double x position of the vertex in world units |
rectangle |
x- double x position
of the center in world units |
shell |
x- double x position
of the center in world units |
tangent |
x- double x position
of the center in world units |
text |
x- double x position
of the center in world units |
vectorfield |
fx- string the
x component |