java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--java.awt.Panel
|
+--java.applet.Applet
|
+--edu.davidson.tools.SApplet
|
+--wave3d.Wave3d
Wave3d animates a 3D wave traveling along the z direction. This program is based on a student project by ASB. It was modified by W. Christian.
| Constructor Summary | |
Wave3d() |
|
| Method Summary | |
int |
addAxes(double x,
double y, double z, double s) Add axes to the animation. |
int |
addBox(double l, double w,
double h) Add a box centered on the origin to the animation. |
int |
addCircularLeft(double z1,
double z2, double a, double ph) Add a left circular wave between two points. |
int |
addCircularRight(double z1,
double z2, double a, double ph) Add a right circular wave between two points. |
int |
addFilledRectangle(double z,
double w, double h) Adds a filled rectangle. |
int |
addFilledSquare(double z,
double s) Add a filled square. |
int |
addGrid(double z1,
double length, double width, double p) Add a rectangular grid. |
int |
addLinear(double z1,
double z2, double a, double ph, double p) Add a sinusoidal wave between two points. |
int |
addRectangle(double z,
double w, double h) Add a rectangle centered on the z axis to the animation. |
int |
addSquare(double z, double s)
Add a square centered on the z axis to the animation. |
int |
addText(java.lang.String text,
int xpix, int ypix) Add text to the animation at the given pixel location. |
int |
addWavefunction(java.lang.String function, double z1, double z2, double p) Add a wavefunction f(z,t). |
void |
deleteAll() Delete all objects from drawing. |
boolean |
deleteObject(int id) Delete an object from the applet. |
void |
destroy() Destroys the applet when the html page is closed. |
void |
forward() Method forward |
java.lang.String |
getAppletInfo() Method getAppletInfo |
java.lang.String |
getParameter(java.lang.String key,
java.lang.String def) Gets the applet parameters |
java.lang.String[][] |
getParameterInfo() Method getParameterInfo |
void |
init() Initializes the applet |
void |
pause() Method pause |
boolean |
setAngles(double t, double a,
double p) Sets the viewing angles. |
void |
setDefault() Set default values and deletes all data connections. |
void |
setFixedAlpha(boolean fixed) Fix alpha so that it cannot be changed using the mouse. |
void |
setFixedPhi(boolean fixed) Fix Phi so that it cannot be changed using the mouse. |
void |
setFixedTheta(boolean fixed) Fix theta so that it cannot be changed using the mouse. |
boolean |
setFont(int id,
java.lang.String family, int style, int size) change the object's font for any text4 that is displayed. |
void |
setLineDensity(int density) Sets the line density for all subsequent drawing. |
void |
setPixPerUnit(int ppu) Sets the pixels per unit. |
boolean |
setPolarization(int id,
double angle) Sets the polarization of waves or grid. |
boolean |
setRGB(int id, int r, int g, int b)
Sets the color of an object. |
void |
setShapeRGB(int r, int g, int b)
Set the red, green, and blue color values for all subsequent drawing. |
boolean |
setVisibility(int id, boolean show)
Show the visibility of the object. |
boolean |
setWavelength(int id,
double wavelength) Set the wavelength. |
boolean |
setXYFactor(int id, double factor)
Sets a scale factor for the x-y coordinates of an object. |
boolean |
setZ(int id, double z) Sets the z position of a square or a grid. |
void |
start() Starts the applet when the html page is loaded. |
void |
step(double dt, double time) Steps the animation by dt. |
void |
stop() Stops the applet when the html page is no longer active. |
| Methods inherited from class edu.davidson.tools.SApplet |
addDataListener, addDataSource, cleanupDataConnections, clearAllData, clearData,
cyclingClock, deleteDataConnection, deleteDataConnections, formatValue, getClockID, getClockTime,
getDataConnectionFromDL, getDataConnectionFromDS, getDataFromDS, getDataListener,
getDataListener, getDataSource, getDataSource, getDebugLevel, getID, getRunningID, getSourceData,
getSourceVariables, isAutoRefresh, isClockRunning, isValidFunction, makeDataConnection,
pausingClock, removeDataListener, removeDataSource, reset, reverse, setAutoRefresh,
setClockContinous, setClockCycle, setClockOneShot, setClockTime, setConnectionBlock,
setConnectionListener, setConnectionSmoothing, setConnectionSource, setConnectionStride,
setConnectionWindowX, setConnectionWindowY, setDebugLevel, setDt, setExternalClock, setFPS,
setRunningID, setRunningID, setTimeContinuous, setTimeCycle, setTimeOneShot, startClock,
stepClock, stepTime, stepTimeBack, stepTimeForward, stopClock, stoppingClock,
updateDataConnection, updateDataConnections |
| Constructor Detail |
public Wave3d()
| Method Detail |
public java.lang.String getParameter(java.lang.String key,
java.lang.String def)
key - def - public void init()
init in class java.applet.Appletpublic java.lang.String getAppletInfo()
getAppletInfo in class java.applet.Appletpublic java.lang.String[][] getParameterInfo()
getParameterInfo in class java.applet.Appletpublic void start()
start in class java.applet.Appletpublic void forward()
forward in class edu.davidson.tools.SAppletpublic void stop()
stop in class java.applet.Appletpublic void pause()
pause in class edu.davidson.tools.SAppletpublic void destroy()
destroy in class edu.davidson.tools.SAppletpublic void step(double dt,
double time)
step in interface edu.davidson.tools.SStepabledt - the time steptime - the current time.public void setFixedTheta(boolean fixed)
fixed - true will disablepublic void setFixedAlpha(boolean fixed)
fixed - true will disablepublic void setFixedPhi(boolean fixed)
fixed - true will disablepublic boolean setAngles(double t,
double a,
double p)
t - the z axis anglea - the x axis anglep - the y axis anglepublic void setPixPerUnit(int ppu)
ppu - public boolean setWavelength(int id,
double wavelength)
id - wavelength - public boolean setFont(int id,
java.lang.String family,
int style,
int size)
id - The id of the object.family - The font family: Helvetica, Times.style - The style, 0=plain, 1=bold.size - The size of the font;public void setLineDensity(int density)
density - line densitypublic boolean setRGB(int id,
int r,
int g,
int b)
id - The id of the object.r - redg - greenb - bluetrue if successful; false otherwisepublic void setShapeRGB(int r,
int g,
int b)
r - red.g - green.b - blue.public boolean setVisibility(int id,
boolean show)
id - show - true will show object on screentrue if successful; false otherwisepublic boolean setZ(int id,
double z)
id - the objectz - the new position along ztrue if successful; false otherwisepublic boolean setPolarization(int id,
double angle)
id - the objectangle - true if successful; false otherwisepublic boolean setXYFactor(int id,
double factor)
id - the objectangle - true if successful; false otherwisepublic boolean deleteObject(int id)
id - the object identifierpublic int addText(java.lang.String text,
int xpix,
int ypix)
text - xpix - ypix - public int addAxes(double x,
double y,
double z,
double s)
x - y - z - s - public int addSquare(double z,
double s)
z - the positions - the sidepublic int addRectangle(double z,
double w,
double h)
z - the positionw - the width along xh - the height along ypublic int addBox(double l,
double w,
double h)
l - the lengthw - the widthh - the heightpublic int addFilledSquare(double z,
double s)
z - the positions - the sizepublic int addFilledRectangle(double z,
double w,
double h)
z - the positions - the sizepublic int addLinear(double z1,
double z2,
double a,
double ph,
double p)
z1 - the starting pointz2 - the ending pointa - the amplitudeph - the phasep - the polzarization anglepublic int addCircularRight(double z1,
double z2,
double a,
double ph)
z1 - the starting pointz2 - the ending pointa - the amplitudeph - the phasepublic int addCircularLeft(double z1,
double z2,
double a,
double ph)
z1 - the starting pointz2 - the ending pointa - the amplitudeph - the phasepublic int addGrid(double z1,
double length,
double width,
double p)
z1 - the positionlength - width - p - the orientation anglepublic int addWavefunction(java.lang.String function,
double z1,
double z2,
double p)
function - the functionz1 - the starting pointz2 - the ending pointp - the polarization anglepublic void deleteAll()
public void setDefault()
setDefault in class edu.davidson.tools.SApplet