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

Constructor Index

 o EField()
 

Method Index

 o addCharge(double, double, double)
Add a fixed charge.
 o addTestCharge(double, double, double, double)
Add a test charge.
 o clearFixedCharges()
Clears the fixed charges.
 o clearTestCharges()
Clears the test charges.
 o destroy()
 
 o forward()
Resume the simulation with a positive time step.
 o getAppletInfo()
 
 o getParameter(String, String)
 
 o getParameterInfo()
 
 o init()
 
 o jbInit()
 
 o pause()
Pause the simulation
 o reset()
 
 o reverse()
Resume the simulation with a negative time step.
 o run()
 
 o setBz(double)
Set the magnetic field.
 o setCaption(String)
Set the caption.
 o setChargeLabel(String)
Set the carge label.
 o setChargeRGB(int, int, int)
Set the charge color.
 o setChargeTrail(int)
Set the charge color.
 o setDefault()
Sets the default conditions.
 o setHideCharge(int)
Hides the charges.
 o setMaxTime(double, String)
Stop the simulation at a predetermined time and display a message for the user.
 o setNoDrag(int)
Set no drag for all subsequent charges.
 o setPotential(String, double, double, double, double)
Set the potential function.
 o setShowCharge(int)
Show the fixed charges.
 o setShowContours(int)
Show the contour lines.
 o setShowCoordOnDrag(int)
Show the coordinates on a mouse drag.
 o setShowEOnDrag(int)
Show the E field at the mouse postion on a mouse drag.
 o setShowFieldLineOnClick(int)
Draw a field line starting at the mouse click.
 o setShowFieldLineOnDoubleClick(int)
Draw a field line starting at the mouse double click.
 o setShowFieldLines(int)
Show the field lines.
 o setShowFieldVectors(int)
Show the direction field vectors.
 o setShowForce(int)
Show the force on subsequent charges.
 o setShowLabels(int)
Show the contour labels.
 o setShowTime(int)
Show the simulation time.
 o setShowVelocity(int)
Show the velocity on moving test charges.
 o setShowVOnDrag(int)
Show the voltage at the mouse postion on a mouse drag.
 o setTimeContinous()
Let the simulation continue forever.
 o setTimeCycle(double)
Cycle the simulation
 o setTolerance(double)
Set the tolerance for the animation calculations.
 o setXRange(double, double)
Set the scale using the horizontal axis.
 o setYRange(double, double)
 
 o start()
Start the animation of the test charges.
 o stepBack()
Step the simulation one negative time step.
 o stepForward()
Step the simulation one positive time step.
 o stop()
Stop the animation of the test charges.

Constructors

 o EField

 public EField()

Methods

 o getParameter

 public String getParameter(String key,
                            String def)

 o init

 public void init()
Overrides:
init in class Applet

 o jbInit

 public void jbInit() throws Exception

 o start

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

 o stop

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

 o destroy

 public void destroy()
Overrides:
destroy in class Applet

 o getAppletInfo

 public String getAppletInfo()
Overrides:
getAppletInfo in class Applet

 o getParameterInfo

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

 o 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.

 o 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.

 o clearTestCharges

 public void clearTestCharges()
Clears the test charges.

 o clearFixedCharges

 public void clearFixedCharges()
Clears the fixed charges.

 o setDefault

 public void setDefault()
Sets the default conditions.

 o 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.

 o setYRange

 public void setYRange(double ymin,
                       double ymax)

 o 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.

 o setHideCharge

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

 o 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.

 o 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.

 o 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.

 o 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.

 o setBz

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

 o setCaption

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

 o setChargeLabel

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

 o setChargeRGB

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

 o 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.

 o 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.

 o 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.

 o 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.

 o 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.

 o 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.

 o 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.

 o 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.

 o 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.

 o setShowCharge

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

 o setTimeContinous

 public void setTimeContinous()
Let the simulation continue forever.

 o setTolerance

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

 o setTimeCycle

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

 o 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

 o 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.

 o run

 public void run()

 o pause

 public void pause()
Pause the simulation

 o forward

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

 o reverse

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

 o stepForward

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

 o stepBack

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

 o reset

 public void reset()

Index