|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
java.applet.Applet
edu.davidson.tools.SApplet
spectrophotometer.Spectrophotometer
public class Spectrophotometer
Simulation of a spectrophotometer. The simulation employs a particulate model for light,
which is represented as photons (small balls) traveling from the light source to the detector.
While passing through the cell, there is a chance the photons will be absorbed.
Applet Parameters
BGColor : background color (uses #FFFFFF notation)
Concentration : analyte concentration in mole/L (default 0.00100)
ControlPosition : position of the controls, 0=North, 1=East, 2=South, 3=West (default 2)
Dt : simulation time increment (fps = 1/Dt) (default 0.010)
Intensity : light source intensity in photons/sec (default 10)
IsReady : JavaScript variable set to true when this applet has loaded and initialized
LiquidColor : color of liquid in cell (uses #FFFFFF notation)
MolarAbsorptivity : analyte molar absorptivity in L/(mole cm) (default 199)
PathLength : cell path length in cm (default 1.00)
PixelsPerCM : pixels per cm in the display (default 33)
ShowControls : true to show controls (default)
Speed : speed of photons (default 50 pixels/sec)
Wavelength : wavelength of light in nm, used to set photon color (default 400)
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.BaselineResizeBehavior |
| Field Summary |
|---|
| Fields inherited from class edu.davidson.tools.SApplet |
|---|
clock, dataConnections, dataListeners, dataSources, lock |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
Spectrophotometer()
|
|
| Method Summary | |
|---|---|
void |
destroy()
|
java.lang.String |
getAppletInfo()
|
java.awt.Color |
getColor(double val)
Returns the color associated with the specified wavelength. |
edu.davidson.tools.SApplet |
getOwner()
Gets the owner of the data source. |
java.lang.String |
getParameter(java.lang.String key,
java.lang.String def)
|
java.lang.String[][] |
getParameterInfo()
|
double |
getTime()
Gets the current timer time. |
double[][] |
getVariables()
Gets the values of the variables for SDataSource. element [0][0] is the time as provided by the timer, which might be disabled element [0][1] is the number of photons emitted by the light source element [0][2] is the number of photons detected by the detector element [0][3] is the intensity (photons/sec), which is zero if the timer is off element [0][4] is the transmittance, which is zero if the timer is off element [0][5] is the absorbance, which is zero if the timer is off The transmittance and absorbance are determined using the reference intensity, if it is defined; otherwise the source intensity is used. |
java.lang.String[] |
getVarStrings()
Returns an array of the variable names supplied by this SDataSource. t is the simulation time in seconds s is the number of photons emitted by the source d is the number of photons that have reached the detector I is the measured photon intensity T is the measured transmittance A is the measured absorbance |
void |
init()
|
void |
paint(java.awt.Graphics g)
|
void |
resetSimulation()
Resets the simulation. |
void |
setAutoTimer(boolean val)
If true, the timer is automatically started when the first photon reaches the detector. |
void |
setBackgroundColor(java.lang.String rgb)
Sets the background color of the applet. |
void |
setBackgroundScattering(double val)
Sets the probability of background scattering when a photon encounters the cell walls |
void |
setConcentration(double val)
Sets the concentration of the absorbing species |
void |
setIntensity(double val)
Sets the source intensity, the rate at which photons are emitted from the light source. |
void |
setLiquidColor(java.lang.String rgb)
Sets the color of the liquid in the cell. |
void |
setMolarAbsorptivity(double val)
Sets the molar absorptivity of the absorbing species |
void |
setOwner(edu.davidson.tools.SApplet owner)
Sets the owner for the SDataSource. |
void |
setPathLength(double val)
Sets the cell path length. |
void |
setPhotonRadius(int val)
Sets the radius of the photons. |
void |
setPixelsPerCM(int val)
Sets the number of pixels per centimeter. |
void |
setReferenceIntensity(double val)
Sets the reference intensity. |
void |
setScalingFactor(double val)
Sets the scaling factor. |
void |
setSpeed(double val)
Sets the speed with which a photon moves across the screen. |
void |
setTimeIncrement(double val)
Sets the simulation time increment, the time between points in the simulation. |
void |
setWavelength(double val)
Sets the wavelength of the photons. |
void |
start()
|
void |
startSimulation()
Starts the simulation by starting the clock. |
void |
startTimer()
Starts the timer. |
void |
step(double dt,
double tm)
Calculates state of system at each step in the simulation. |
void |
stop()
|
void |
stopSimulation()
Stops the simulation. |
void |
stopTimer()
Stops the timer. |
void |
useCell(boolean val)
Determines whether the cell is used in the simulation |
| Methods inherited from class edu.davidson.tools.SApplet |
|---|
addDataListener, addDataSource, cleanupDataConnections, clearAllData, clearData, deleteDataConnection, deleteDataConnections, forward, getClockID, getClockTime, getDataConnectionFromDL, getDataConnectionFromDS, getDataFromDS, getDataListener, getDataListener, getDataSource, getDataSource, getID, getRunningID, getSourceData, getSourceVariables, isAutoRefresh, isClockRunning, makeDataConnection, pause, removeDataListener, removeDataSource, reset, reverse, setAutoRefresh, setClockContinous, setClockCycle, setClockOneShot, setClockTime, setConnectionBlock, setConnectionListener, setConnectionSmoothing, setConnectionSource, setConnectionStride, setDefault, setDt, setExternalClock, setFPS, setRunningID, setRunningID, setTimeContinuous, setTimeCycle, setTimeOneShot, startClock, stepClock, stepTime, stepTimeBack, stepTimeForward, stopClock, updateDataConnection, updateDataConnections |
| Methods inherited from class java.applet.Applet |
|---|
getAccessibleContext, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus |
| Methods inherited from class java.awt.Panel |
|---|
addNotify |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface edu.davidson.tools.SDataSource |
|---|
getID |
| Constructor Detail |
|---|
public Spectrophotometer()
| Method Detail |
|---|
public void destroy()
destroy in class edu.davidson.tools.SAppletpublic java.lang.String getAppletInfo()
getAppletInfo in class java.applet.Appletpublic java.awt.Color getColor(double val)
val - wavelength in nanometerspublic edu.davidson.tools.SApplet getOwner()
getOwner in interface edu.davidson.tools.SDataSource
public java.lang.String getParameter(java.lang.String key,
java.lang.String def)
public java.lang.String[][] getParameterInfo()
getParameterInfo in class java.applet.Appletpublic double getTime()
public double[][] getVariables()
getVariables in interface edu.davidson.tools.SDataSourcepublic java.lang.String[] getVarStrings()
getVarStrings in interface edu.davidson.tools.SDataSourcepublic void paint(java.awt.Graphics g)
paint in class java.awt.Containerpublic void resetSimulation()
public void setAutoTimer(boolean val)
resetSimulation()public void setBackgroundColor(java.lang.String rgb)
rgb - this string is converted into a 24-bit integer that defines the colorpublic void setBackgroundScattering(double val)
val - probability (default 0.00)public void setConcentration(double val)
val - concentration in mole/Lpublic void setIntensity(double val)
val - intensity in photons per secondpublic void setLiquidColor(java.lang.String rgb)
rgb - this string is converted into a 24-bit integer that defines the colorpublic void setMolarAbsorptivity(double val)
val - molar absorptivity in L/(mole cm)public void setOwner(edu.davidson.tools.SApplet owner)
setOwner in interface edu.davidson.tools.SDataSourceowner - owner of the data sourcepublic void setPathLength(double val)
val - cell path length in centimeterspublic void setPhotonRadius(int val)
val - photon radius in pixelspublic void setPixelsPerCM(int val)
val - number of pixels per centimeterpublic void setReferenceIntensity(double val)
val - reference intensity in photons per secondpublic void setScalingFactor(double val)
public void setSpeed(double val)
val - speed in pixels per secondpublic void setTimeIncrement(double val)
val - time increment in secondspublic void setWavelength(double val)
val - wavelength in nanometerspublic void start()
start in class java.applet.Appletpublic void startSimulation()
SApplet.stopClock()public void startTimer()
public void step(double dt,
double tm)
step in interface edu.davidson.tools.SStepablepublic void stop()
stop in class java.applet.Appletpublic void stopSimulation()
public void stopTimer()
public void useCell(boolean val)
public void init()
init in class java.applet.Applet
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||