Public Methods in OpticsApplet
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 optics.OpticsApplet
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----java.applet.Applet
|
+----optics.OpticsApplet
- public class OpticsApplet
- extends Applet
OpticsApplet()
-
addAperture(double,
double)
- Add a blocking aperture at x.
addApertureP(int, int)
- Add a blocking aperture at x.
addDielectric(double,
double, double)
- Add a dielectric interface that can have a radius of curvature or none at all.
addDielectricP(int,
double, int)
- Add a dielectric interface that can have a radius of curvature or none at all.
addIndexChange(double,
double)
- Add an index change that has no curvature.
addIndexChangeP(int,
double)
- Add an index change that has no curvature.
addISource(double,
double, int, double)
- Adds an infinite source with parallel rays
addISourceP(int,
int, int, double)
- Adds an infinite source with parallel rays
addLens(double, double)
- Adds a thin lens, no spherical aberration, based on matrix transformations
addLensP(int, double)
- Adds a thin lens, no spherical aberration, based on matrix transformations
addMirror(double,
double)
- Adds an ideal mirror, based on matrix transformations
addMirrorP(int, double)
- Adds an ideal mirror, based on matrix transformations
addPSource(double,
double)
- Adds an principal-ray source which draws the three principal rays
addPSourceP(int, int)
- Adds an principal-ray source which draws the three principal rays
addRefraction(double,
double, double)
- Adds a refraction interface that can represent a thick lens with spherical aberration
and internal reflection.
addRefractionP(int,
double, int)
- Adds a refraction interface that can represent a thick lens with spherical aberration
and internal reflection.
addScreen(double)
- Adds a screen
addScreenP(int)
- Adds a screen
addSource(double,
double, double, double)
- Adds a regular point source, with spreading rays from a single point
addSourceP(int,
int, double, double)
- Adds a regular point source, with spreading rays from a single point
addSphericalMirror(double,
double)
- Adds a spherical mirror.
addSphericalMirrorP(int,
double)
- Adds an spherical mirror.
clearAll()
- Clears all elements from bench and repaints
destroy()
-
getAppletInfo()
-
getParameter(String,
String)
-
getParameterInfo()
-
init()
-
jbInit()
-
setBtnOff()
- Changes all the colors of the buttons to black
setDefault()
- Calls the following methods: setPixPerUnit(100), setInfo(false), setSize(.8),
setDrag(false), setPropertyDrag(false), & setDirection(1)
setDirection(int)
- Set the direction that sources added after will start in
setDrag(boolean)
- Determines if elements added after value is set will be allowed to be dragged
setInfo(boolean)
- Determines if elements added after value will show information on screen including focal
lengths and positions
setNull()
- Calls setBtnOff() and makes it so nothing is added when the mouse clicks the bench
setPixPerUnit(int)
- Set the Pixels per Unit.
setPropertyDrag(boolean)
- Determines if elements added after value is set will be allowed to have their properties
changed by dragging
setRayRGB(int, int,
int)
- Set the color of the source light rays.
setSize(double)
- Set the direction that sources added after will start in
setUnDefault()
- Calls the following methods: setPixPerUnit(100), setInfo(true), setSize(.8),
setDrag(true), setPropertyDrag(true), & setDirection(1)
start()
-
stop()
-

OpticsApplet
public OpticsApplet()

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()
- Overrides:
- start in class Applet

stop
public void stop()
- 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

clearAll
public void clearAll()
- Clears all elements from bench and repaints

setDrag
public void setDrag(boolean d)
- Determines if elements added after value is set will be allowed to be dragged
- Parameters:
- d - True or False

setPropertyDrag
public void setPropertyDrag(boolean pd)
- Determines if elements added after value is set will be allowed to have their properties
changed by dragging
- Parameters:
- pd - True or False

setInfo
public void setInfo(boolean i)
- Determines if elements added after value will show information on screen including focal
lengths and positions
- Parameters:
- i - True or False

setRayRGB
public void setRayRGB(int r,
int g,
int b)
- Set the color of the source light rays
- Parameters:
- r - 0 g - 0 b - 0
setSize
public void setSize(double s)
- Set the direction that sources added after will start in
- Parameters:
- d - d=1 or d=-1. d=1 is to the right. d=-1 is to the left
setDirection
public void setDirection(int d)
- Set the direction that sources added after will start in
- Parameters:
- d - d=1 or d=-1. d=1 is to the right. d=-1 is to the left
setPixPerUnit
public void setPixPerUnit(int ppu)
- Set the Pixels per Unit.
- Parameters:
- ppu - 100 pixels per unit is as if on the screen 100 pixels represents 1 meter
setDefault
public void setDefault()
- Calls the following methods: setPixPerUnit(100), setInfo(false), setSize(.8),
setDrag(false), setPropertyDrag(false), & setDirection(1)
setUnDefault
public void setUnDefault()
- Calls the following methods: setPixPerUnit(100), setInfo(true), setSize(.8),
setDrag(true), setPropertyDrag(true), & setDirection(1)
addAperture
public void addAperture(double x,
double openingSize)
- Add a blocking aperture at x.
- Parameters:
- x - The position of the aperture, in relative units specified by
setPixPerUnit()
- openingSize - 0
addDielectric
public void addDielectric(double x,
double dn,
double r)
- Add a dielectric interface that can have a radius of curvature or none at all. Small
angle approximation that doesn't show aberration.
- Parameters:
- x - The position of the aperture, in relative units specified by setPixPerUnit
- dn - Change in index of refraction from left to right.
- r - The radius of curvature of the interface, in relative units.
addIndexChange
public void addIndexChange(double x,
double delN)
- Add an index change that has no curvature. Uses Snell's law and can show total internal
reflection.
- Parameters:
- x - The position of the aperture, in relative units specified by setPixPerUnit
- delN - The change (+/-) of index going from left to right across interface
addRefraction
public void addRefraction(double x,
double delN,
double r)
- Adds a refraction interface that can represent a thick lens with spherical aberration
and internal reflection. Uses Snell's law, with angular displacement.
- Parameters:
- x - The x position of the refraction, in relative units specified by setPixPerUnit()
- delN - The change in index of refraction when going from left to right across inferface
- r - The radius of curvature of the interface, specified in relative units.
addISource
public void addISource(double x,
double y,
int size,
double angle)
- Adds an infinite source with parallel rays
- Parameters:
- x - The x position of the ISource, in relative units specified by setPixPerUnit
- y - The x position of the ISource, in relative units specified by setPixPerUnit
- size - The height from the top to bottom of the source, in pixels
- angle - The slope of the rays, -1
addLens
public void addLens(double x,
double fl)
- Adds a thin lens, no spherical aberration, based on matrix transformations
- Parameters:
- x - The x position of the lens, in relative units specified by setPixPerUnit()
- fl - The focal length of the lens, in relative units specified by setPixPerUnit()
addMirror
public void addMirror(double x,
double fl)
- Adds an ideal mirror, based on matrix transformations
- Parameters:
- x - The x position of the mirror, in relative units specified by setPixPerUnit()
- fl - The focal length of the mirror, in relative units specified by setPixPerUnit()
addSphericalMirror
public void addSphericalMirror(double x,
double fl)
- Adds a spherical mirror. Some aberations are calculated.
- Parameters:
- x - The x position of the mirror, in relative units specified by setPixPerUnit()
- fl - The focal length of the mirror, in relative units specified by setPixPerUnit()
addPSource
public void addPSource(double x,
double y)
- Adds an principal-ray source which draws the three principal rays
- Parameters:
- x - The x position of the PSource, in relative units specified by setPixPerUnit()
- y - The y position of the PSource, in relative units specified by setPixPerUnit()
addScreen
public void addScreen(double x)
- Adds a screen
- Parameters:
- x - The x position of the Screen, in relative units specified by setPixPerUnit()
addSource
public void addSource(double x,
double y,
double rayIncrement,
double raySlope)
- Adds a regular point source, with spreading rays from a single point
- Parameters:
- x - The x position of the Source, in relative units specified by setPixPerUnit()
- y - The y position of the source, in relative units specified by setPixPerUnit()
- rayIncrement - The delta slope between intervals of rays coming from the Source
- raySlope - The starting slope of the outermost rays (top and bottom)
addApertureP
public void addApertureP(int x,
int openingSize)
- Add a blocking aperture at x.
- Parameters:
- x - The position of the aperture, in direct pixel units
- openingSize - 0
addDielectricP
public void addDielectricP(int x,
double dn,
int r)
- Add a dielectric interface that can have a radius of curvature or none at all. Small
angle approximation that doesn't show aberration.
- Parameters:
- x - The position of the aperture, in pixel units
- dn - Change in index of refraction from left to right.
- r - The radius of curvature of the interface, in pixel units.
addIndexChangeP
public void addIndexChangeP(int x,
double dn)
- Add an index change that has no curvature. Uses Snell's law and can show total internal
reflection.
- Parameters:
- x - The position of the aperture, in pixel units
- dn - The change (+/-) of index going from left to right across interface
addRefractionP
public void addRefractionP(int x,
double delN,
int rT)
- Adds a refraction interface that can represent a thick lens with spherical aberration
and internal reflection. Uses Snell's law, with angular displacement.
- Parameters:
- x - The x position of the refraction, in pixel units
- delN - The change in index of refraction when going from left to right across inferface
- r - The radius of curvature of the interface, specified in pixel units.
addISourceP
public void addISourceP(int x,
int y,
int size,
double angle)
- Adds an infinite source with parallel rays
- Parameters:
- x - The x position of the ISource, in pixel units
- y - The x position of the ISource, in pixel units
- size - The height from the top to bottom of the source, in pixels
- angle - The slope of the rays, -1
addLensP
public void addLensP(int x,
double fl)
- Adds a thin lens, no spherical aberration, based on matrix transformations
- Parameters:
- x - The x position of the lens, in pixel units
- fl - The focal length of the lens, in pixel units
addMirrorP
public void addMirrorP(int x,
double fl)
- Adds an ideal mirror, based on matrix transformations
- Parameters:
- x - The x position of the mirror, in pixel units
- fl - The focal length of the mirror, in pixel units
addSphericalMirrorP
public void addSphericalMirrorP(int x,
double fl)
- Adds an spherical mirror. Only some aberations are calculated.
- Parameters:
- x - The x position of the mirror, in pixel units
- fl - The focal length of the mirror, in pixel units
addPSourceP
public void addPSourceP(int x,
int y)
- Adds an principal-ray source which draws the three principal rays
- Parameters:
- x - The x position of the PSource, in pixel units
- y - The y position of the PSource, in pixel units
addScreenP
public void addScreenP(int x)
- Adds a screen
- Parameters:
- x - The x position of the Screen, in pixel units
addSourceP
public void addSourceP(int x,
int y,
double rayIncrement,
double raySlope)
- Adds a regular point source, with spreading rays from a single point
- Parameters:
- x - The x position of the Source, in pixel units
- y - The y position of the source, in pixel units
- rayIncrement - The delta slope between intervals of rays coming from the source, typical
value is .25
- raySlope - The starting slope of the outermost rays (top and bottom), typical value is
between 0 and 1
setNull
public void setNull()
- Calls setBtnOff() and makes it so nothing is added when the mouse clicks the bench
setBtnOff
public void setBtnOff()
- Changes all the colors of the buttons to black
Index