Public Methods in EField Physlet
This documentation is machine generated from the Java source file. All methods in
the applet are listed as a reference for the JavaScript programmer. Caution is
advised. Not all methods are useful for JavaScript to Java communication. Please
refer to the sample scripts to see how various methods are used.
Index
Class eField.EField
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----java.applet.Applet
|
+----sTools.SApplet
|
+----eField.EField
- public class EField
- extends SApplet
- implements Runnable
EField()
-
addCharge(double, double, double)
- Add a fixed charge.
addTestCharge(double,
double, double, double)
- Add a test charge.
clearFixedCharges()
- Clears the fixed charges.
clearTestCharges()
- Clears the test charges.
destroy()
-
forward()
- Resume the simulation with a positive time step.
getAppletInfo()
-
getParameter(String,
String)
-
getParameterInfo()
-
init()
-
jbInit()
-
pause()
- Pause the simulation
reset()
-
reverse()
- Resume the simulation with a negative time step.
run()
-
setBz(double)
- Set the magnetic field.
setCaption(String)
- Set the caption.
setChargeLabel(String)
- Set the carge label.
setChargeRGB(int,
int, int)
- Set the charge color.
setChargeTrail(int)
- Set the charge color.
setDefault()
- Sets the default conditions.
setHideCharge(int)
- Hides the charges.
setMaxTime(double, String)
- Stop the simulation at a predetermined time and display a message for the user.
setNoDrag(int)
- Set no drag for all subsequent charges.
setPotential(String,
double, double, double, double)
- Set the potential function.
setShowCharge(int)
- Show the fixed charges.
setShowContours(int)
- Show the contour lines.
setShowCoordOnDrag(int)
- Show the coordinates on a mouse drag.
setShowEOnDrag(int)
- Show the E field at the mouse postion on a mouse drag.
setShowFieldLineOnClick(int)
- Draw a field line starting at the mouse click.
setShowFieldLineOnDoubleClick(int)
- Draw a field line starting at the mouse double click.
setShowFieldLines(int)
- Show the field lines.
setShowFieldVectors(int)
- Show the direction field vectors.
setShowForce(int)
- Show the force on subsequent charges.
setShowLabels(int)
- Show the contour labels.
setShowTime(int)
- Show the simulation time.
setShowVelocity(int)
- Show the velocity on moving test charges.
setShowVOnDrag(int)
- Show the voltage at the mouse postion on a mouse drag.
setTimeContinous()
- Let the simulation continue forever.
setTimeCycle(double)
- Cycle the simulation
setTolerance(double)
- Set the tolerance for the animation calculations.
setXRange(double,
double)
- Set the scale using the horizontal axis.
setYRange(double,
double)
-
start()
- Start the animation of the test charges.
stepBack()
- Step the simulation one negative time step.
stepForward()
- Step the simulation one positive time step.
stop()
- Stop the animation of the test charges.

EField
public EField()

getParameter
public String getParameter(String key,
String def)

init
public void init()
- Overrides:
- init in class Applet

jbInit
public void jbInit() throws Exception

start
public void start()
- Start the animation of the test charges.
- Overrides:
- start in class Applet

stop
public void stop()
- Stop the animation of the test charges.
- Overrides:
- stop in class Applet

destroy
public void destroy()
- Overrides:
- destroy in class Applet

getAppletInfo
public String getAppletInfo()
- Overrides:
- getAppletInfo in class Applet

getParameterInfo
public String[][] getParameterInfo()
- Overrides:
- getParameterInfo in class
Applet

addTestCharge
public void addTestCharge(double x,
double y,
double vx,
double vy)
- Add a test charge. A test charge moves with F=E but does not effect the potentials or
fields.
- Parameters:
- x - The x position.
- y - The xy position.
- vx - The x velocity.
- vy - The y velocity.

addCharge
public void addCharge(double x,
double y,
double m)
- Add a fixed charge. A fixed charge does not move but does effect the field and the
potential at the test charges.
- Parameters:
- x - The x position.
- y - The xy position.
- m - The magnitude of the charge.

clearTestCharges
public void clearTestCharges()
- Clears the test charges.

clearFixedCharges
public void clearFixedCharges()
- Clears the fixed charges.

setDefault
public void setDefault()
- Sets the default conditions.

setXRange
public void setXRange(double xmin,
double xmax)
- Set the scale using the horizontal axis. The leftmost pixel will be xmin. The rightmost
pixel will be xmax. The vertical axis will be rescaled to maintian an aspect ratio of one.
- Parameters:
- xmin - Minimuum value on x axis.
- xmax - Maximum value on x axis.

setYRange
public void setYRange(double ymin,
double ymax)

setNoDrag
public void setNoDrag(int nd)
- Set no drag for all subsequent charges.
- Parameters:
- nd - NoDrag parameter; nd=0 turns drag off, nd=1 turns drag on.

setHideCharge
public void setHideCharge(int hc)
- Hides the charges.
- Parameters:
- hc - HidCharge parameter; hc=0 turns off, hc=1 turns on.

setShowFieldLines
public void setShowFieldLines(int sfl)
- Show the field lines.
- Parameters:
- sfl - Show field line parameter; sfl=0 turns field lines off, sfl=1 turns field lines
on.

setShowFieldVectors
public void setShowFieldVectors(int sfv)
- Show the direction field vectors.
- Parameters:
- sfv - Show field line vectors; sfv=0 turns field vectors off, sfv=1 turns field vectors
on.

setShowContours
public void setShowContours(int sc)
- Show the contour lines.
- Parameters:
- sc - Show contour parameter; sc=0 turns contours lines off, sc=1 turns contour lines on.

setShowLabels
public void setShowLabels(int sl)
- Show the contour labels.
- Parameters:
- sl - Show labels parameter; sl=0 turns labels off, sl=1 turns labels on.

setBz
public void setBz(double bz)
- Set the magnetic field.
- Parameters:
- bz - The magnetic field in the z directon.

setCaption
public void setCaption(String c)
- Set the caption.
- Parameters:
- c - The caption string.

setChargeLabel
public void setChargeLabel(String l)
- Set the carge label.
- Parameters:
- l - All subsequent will show this label in the middle of the charge.

setChargeRGB
public void setChargeRGB(int r,
int g,
int b)
- Set the charge color.
- Parameters:
- r - red.
- g - green.
- b - blue.

setChargeTrail
public void setChargeTrail(int t)
- Set the charge color.
- Parameters:
- t - The number of points to draw in the animation behind a moving charge.

setShowTime
public void setShowTime(int st)
- Show the simulation time.
- Parameters:
- st - Show the time; st=0 turns time off, st=1 turns time on.

setShowCoordOnDrag
public void setShowCoordOnDrag(int sc)
- Show the coordinates on a mouse drag.
- Parameters:
- sc - Show the coordinates; sc=0 turns off, sc=1 turns on.

setShowVOnDrag
public void setShowVOnDrag(int sv)
- Show the voltage at the mouse postion on a mouse drag.
- Parameters:
- sv - Show the voltage; sv=0 turns off, sv=1 turns on.

setShowEOnDrag
public void setShowEOnDrag(int se)
- Show the E field at the mouse postion on a mouse drag.
- Parameters:
- se - Show the field; se=0 turns off, se=1 turns on.

setShowFieldLineOnClick
public void setShowFieldLineOnClick(int sfl)
- Draw a field line starting at the mouse click.
- Parameters:
- sfl - Enable field line on click; sfl=0 turns off, sfl=1 turns on.

setShowFieldLineOnDoubleClick
public void setShowFieldLineOnDoubleClick(int sfl)
- Draw a field line starting at the mouse double click.
- Parameters:
- sfl - Enable field line on double click; sfl=0 turns off, sfl=1 turns on.

setShowForce
public void setShowForce(int sf)
- Show the force on subsequent charges.
- Parameters:
- sf - Show the force: sf=0 turns off, sf=1 turns on.

setShowVelocity
public void setShowVelocity(int sv)
- Show the velocity on moving test charges.
- Parameters:
- sv - Show the velocity: sv=0 turns off, sv=1 turns on.

setShowCharge
public void setShowCharge(int sc)
- Show the fixed charges.
- Parameters:
- sc - Show the charges: sc=0 turns off, sc=1 turns on.

setTimeContinous
public void setTimeContinous()
- Let the simulation continue forever.

setTolerance
public void setTolerance(double t)
- Set the tolerance for the animation calculations. Default is 1 part in 1.0e-5.

setTimeCycle
public void setTimeCycle(double max)
- Cycle the simulation
- Parameters:
- max - Reset the simulation to t=0 when t=max and continue simulation.

setPotential
public void setPotential(String ps,
double xmin,
double xmax,
double ymin,
double ymax)
- Set the potential function. Y values are set so as to preserve an aspect ration of 1.
- Parameters:
- ps - The potential function, f(x,y).
- xmin - x minimum
- xmax - x maximum
- ymin - approximate y minimum
- ymax - approximate y maximum

setMaxTime
public void setMaxTime(double max,
String msg)
- Stop the simulation at a predetermined time and display a message for the user.
- Parameters:
- max - Stop the simulation when t=max and continue simulation.
- msg - Display a user message.

run
public void run()

pause
public void pause()
- Pause the simulation

forward
public void forward()
- Resume the simulation with a positive time step.

reverse
public void reverse()
- Resume the simulation with a negative time step.

stepForward
public void stepForward()
- Step the simulation one positive time step.

stepBack
public void stepBack()
- Step the simulation one negative time step.

reset
public void reset()
Index