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

Constructor Index

 o OpticsApplet()
 

Method Index

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

Constructors

 o OpticsApplet

 public OpticsApplet()

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

 o stop

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

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

 o 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

 o 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

 o 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

 o 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

 o 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

 o 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

 o 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

 o setDefault

 public void setDefault()
Calls the following methods: setPixPerUnit(100), setInfo(false), setSize(.8), setDrag(false), setPropertyDrag(false), & setDirection(1)

 o setUnDefault

 public void setUnDefault()
Calls the following methods: setPixPerUnit(100), setInfo(true), setSize(.8), setDrag(true), setPropertyDrag(true), & setDirection(1)

 o 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

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

 o 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

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

 o 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

 o 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()

 o 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()

 o 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()

 o 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()

 o addScreen

 public void addScreen(double x)
Adds a screen
Parameters:
x - The x position of the Screen, in relative units specified by setPixPerUnit()

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

 o 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

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

 o 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

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

 o 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

 o 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

 o 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

 o 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

 o 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

 o addScreenP

 public void addScreenP(int x)
Adds a screen
Parameters:
x - The x position of the Screen, in pixel units

 o 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

 o setNull

 public void setNull()
Calls setBtnOff() and makes it so nothing is added when the mouse clicks the bench

 o setBtnOff

 public void setBtnOff()
Changes all the colors of the buttons to black

Index