|
Chemistry AppletsDavid N. Blauch |
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--java.awt.Panel
|
+--java.applet.Applet
|
+--edu.davidson.tools.SApplet
|
+--calorimeter.Calorimeter
This applet draws a calorimeter (there are three styles available) and
simulates a calorimetry experiment.
Style 0 shows no calorimeter (blank applet box)
Style 1 shows a standard calorimeter.
Style 2 shows a thermos-type calorimeter.
Style 3 shows a bomb calorimeter.
Style 4 shows a thermos-type calorimeter with a reservoir that drains into the calorimeter.
Configurable Options include the sample, a heating filament, and a stirrer.
The applet serves as a DataSource
(DataConnections) that supplies time-temperature data during the experiment.
Temperature and energy are in arbitrary units, but typically one would use
oC and joules. Time is in units of seconds and is real time.
APPLET PARAMETERS
| Fields inherited from class edu.davidson.tools.SApplet |
autoRefresh,
clock,
dataConnections,
dataListeners,
dataSources,
lock,
oneShotMsg |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
| Constructor Summary | |
Calorimeter()
|
|
| Method Summary | |
void |
destroy()
|
java.lang.String |
getAppletInfo()
|
double |
getMaxTemperature()
Gets the maximum temperature likely to be returned during a simulation. |
double |
getMinTemperature()
Gets the minimum temperature likely to be returned during a simulation. |
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 |
getTemperature()
Gets the current temperature, which includes noise. |
double |
getTemperature(double tm)
Gets the temperature at a specific time in the simulation. |
double[][] |
getVariables()
Gets the values of the variables for the data source. |
java.lang.String[] |
getVarStrings()
Gets the variable strings that the data source supplied. |
void |
init()
|
boolean |
isRunning()
Returns true if a simulation is running and false if not. |
void |
paint(java.awt.Graphics g)
|
void |
resetSimulation()
Resets the simulation. |
void |
run()
|
void |
setBackgroundColor(java.lang.String rgb)
Sets the background color of the applet |
void |
setBombColor(java.lang.String rgb)
Sets the color of the bomb in the bomb calorimeter |
void |
setBombHeight(int val)
Sets the height of the bomb. |
void |
setBombThickness(int val)
Sets the thickness of the walls of the bomb. |
void |
setBombWidth(int val)
Sets the width of the bomb. |
void |
setCalorimeterBodyCurvature(int val)
Sets the curvature used in drawing the rounded edges of the calorimeter. |
void |
setCalorimeterColor(java.lang.String rgb)
Sets the color of the calorimeter body |
void |
setCalorimeterFraction(double val)
Sets the fraction of the applet region that is occupied by the calorimeter. |
void |
setCalorimeterTopHeight(int val)
Sets the thickness of the top of the calorimeter (Style 1 only). |
void |
setCalorimeterWallThickness(int val)
Sets the thickness of the walls of the calorimeter. |
void |
setDelay(long val)
Sets the delay time for the animation loop that starts the reaction or process. |
void |
setFilamentHeight(int val)
Sets the height of the filament above the bottom of the calorimeter. |
void |
setFilamentOffset(int val)
Sets the distance the left edge of the filament is positioned from the inside left wall of the calorimeter. |
void |
setFilamentSectionCount(int val)
Sets the number of sections in the filament, which has a zig-zag design. |
void |
setFilamentSectionWidth(int val)
Sets the width of each section in the filament, which has a zig-zag design. |
void |
setFilamentTime(double val)
Sets the time during which the filament is active. |
void |
setFinalSlope(double val)
Sets the slope of the time-temperature plot after the reaction or process has started. |
void |
setHeatCapacity(double val)
Sets the heat capacity of the calorimeter (includes the calorimeter body and the liquid in the calorimeter. |
void |
setHeatFlow(double val)
Sets the heat flow for the calorimeter attributable to the reaction or process. |
void |
setHeatingRate(double val)
Sets the heating rate for the filament, which must be a possible value. |
void |
setInitialSlope(double val)
Sets the slope of the time-temperature plot prior to the start of the reaction or process. |
void |
setInitialTemperature(double val)
Sets the initial temperature for the calorimeter (the temperature when the simulation begins). |
void |
setLiquidColor(java.lang.String rgb)
Sets the color of the liquid in the calorimeter (Style 1 and 2 only). |
void |
setLiquidFraction(double val)
Sets the fraction of the calorimeter body that is filled with the liquid. |
void |
setMaxCnt(int val)
Sets the number of increments in the animation loop. |
void |
setOwner(edu.davidson.tools.SApplet owner)
Sets the owner for the data source. |
void |
setRandom(long rnd)
Sets the seed value for the random number generator. |
void |
setReservoirHeight(int val)
Sets the height of the reservoir. |
void |
setReservoirLiquidFraction(double val)
Sets the fraction of the reservoir filled with liquid. |
void |
setReservoirOffset(int val)
Sets the offset of the reservoir from the left edge of the calorimeter. |
void |
setReservoirThickness(int val)
Sets the thickness of the reservoir walls. |
void |
setReservoirWidth(int val)
Sets the width of the reservoir. |
void |
setSampleColor(java.lang.String rgb)
Sets the color of the sample in the calorimeter (Style 1 and 2 only). |
void |
setSampleDiameter(int val)
Sets the diameter of the sample itself. |
void |
setSampleHeight(int val)
Sets the height of the sample region. |
void |
setSampleOffset(int val)
Sets the distance the sample is positioned from the inside wall. |
void |
setSampleWidth(int val)
Sets the width (thickness)of hammer. |
void |
setStandardDeviation(double val)
Sets the standard deviation for the Gaussian noise applied to the temperature. |
void |
setStartTime(double val)
Sets the time at which the reaction or process starts. |
void |
setStirrerColor(java.lang.String rgb)
Sets the color of the stirrer |
void |
setStirrerOffsetX(int val)
Sets the distance the stirrer is offset from the inside left wall of the calorimeter. |
void |
setStirrerOffsetY(int val)
Sets the distance the stirrer is offset from the bottom of the calorimeter. |
void |
setStirrerWidth(int val)
Sets the width and height of the vanes on the stirrer. |
void |
setStopTime(double val)
Sets the time at which the simulation stops. |
void |
setThermometerFraction(double val)
Sets the height of the liquid in the thermometer as a fraction of the length of the thermometer |
void |
setThermometerOffsetX(int val)
Sets the position of the right edge of the thermometer from the inside right wall of the calorimeter |
void |
setThermometerOffsetY(int val)
Sets the position of the bottom of the thermometer from the inside bottom of the calorimeter |
void |
setTimeConstant(double val)
Sets the time constant for the simulation. |
void |
setTimeIncrement(double val)
Sets the simulation time increment, the time between points in the simulation. |
void |
setUseFilament(boolean s)
Determines whether the filament is used during a simulation (Style 1 only). |
void |
showFilament(boolean s)
Determines whether the filament is shown in the calorimeter (Style 1 only). |
void |
showSample(boolean s)
Determines whether the sample is shown in the calorimeter (Styles 1 and 2 only). |
void |
showStirrer(boolean s)
Determines whether the stirrer is shown in the calorimeter (all Styles). |
void |
start()
|
void |
startSimulation()
Starts the simulation. |
void |
step(double dt,
double tm)
The step method required for the SStepable interface. |
void |
stop()
|
void |
stopSimulation()
Stops the simulation, but not change is made to the temperature or to the appearance of the calorimeter |
| Methods inherited from class edu.davidson.tools.SApplet |
addDataListener,
addDataSource,
cleanupDataConnections,
clearAllData,
clearData,
cyclingClock,
deleteDataConnection,
deleteDataConnections,
forward,
getClockID,
getClockTime,
getDataConnectionFromDL,
getDataConnectionFromDS,
getDataFromDS,
getDataListener,
getDataListener,
getDataSource,
getDataSource,
getID,
getRunningID,
getSourceData,
getSourceVariables,
isAutoRefresh,
isClockRunning,
makeDataConnection,
pause,
pausingClock,
removeDataListener,
removeDataSource,
reset,
reverse,
setAutoRefresh,
setClockContinous,
setClockCycle,
setClockOneShot,
setClockTime,
setConnectionBlock,
setConnectionListener,
setConnectionSmoothing,
setConnectionSource,
setConnectionStride,
setDefault,
setDt,
setFPS,
setRunningID,
setRunningID,
setTimeContinuous,
setTimeCycle,
setTimeOneShot,
startClock,
stepClock,
stepTime,
stepTimeBack,
stepTimeForward,
stopClock,
stoppingClock,
updateDataConnection,
updateDataConnections,
useMasterClock |
| Methods inherited from class java.applet.Applet |
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,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getAlignmentX,
getAlignmentY,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getInsets,
getLayout,
getMaximumSize,
getMinimumSize,
getPreferredSize,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
paramString,
preferredSize,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
removeNotify,
setCursor,
setFont,
setLayout,
update,
validate,
validateTree |
| Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
addPropertyChangeListener,
addPropertyChangeListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
firePropertyChange,
getBackground,
getBounds,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getGraphics,
getHeight,
getInputContext,
getInputMethodRequests,
getLocation,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getSize,
getToolkit,
getTreeLock,
getWidth,
getX,
getY,
gotFocus,
handleEvent,
hasFocus,
hide,
imageUpdate,
inside,
isDisplayable,
isDoubleBuffered,
isEnabled,
isFocusTraversable,
isLightweight,
isOpaque,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
printAll,
processComponentEvent,
processFocusEvent,
processInputMethodEvent,
processKeyEvent,
processMouseEvent,
processMouseMotionEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
removePropertyChangeListener,
removePropertyChangeListener,
repaint,
repaint,
repaint,
repaint,
requestFocus,
reshape,
setBackground,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setEnabled,
setForeground,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
setVisible,
show,
show,
size,
toString,
transferFocus |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
public Calorimeter()
| Method Detail |
public void destroy()
public java.lang.String getAppletInfo()
public double getMaxTemperature()
public double getMinTemperature()
public edu.davidson.tools.SApplet getOwner()
public java.lang.String getParameter(java.lang.String key,
java.lang.String def)
public java.lang.String[][] getParameterInfo()
public double getTemperature()
public double getTemperature(double tm)
tm - the time (in seconds)public double[][] getVariables()
public java.lang.String[] getVarStrings()
public void init()
public boolean isRunning()
public void paint(java.awt.Graphics g)
public void resetSimulation()
showFilament(boolean),
showSample(boolean),
stopSimulation()public void setBackgroundColor(java.lang.String rgb)
rgb - this string is converted into a 24-bit integer that defines the colorpublic void setBombColor(java.lang.String rgb)
rgb - this string is converted into a 24-bit integer that defines the colorpublic void setBombHeight(int val)
val - height in pixelspublic void setBombThickness(int val)
val - thickness in pixelspublic void setBombWidth(int val)
val - width in pixelspublic void setCalorimeterBodyCurvature(int val)
val - the width/height of an arc in pixelspublic void setCalorimeterColor(java.lang.String rgb)
rgb - this string is converted into a 24-bit integer that defines the colorpublic void setCalorimeterFraction(double val)
val - the vertical fraction of the applet box to be occupied by the calorimeterpublic void setCalorimeterTopHeight(int val)
val - the thickness (in pixels) of the top of the calorimeterpublic void setCalorimeterWallThickness(int val)
val - the thickness (in pixels) of the calorimeter wallspublic void setDelay(long val)
val - delay time in millisecondssetMaxCnt(int)public void setFilamentHeight(int val)
val - the height (in pixels) of the filamentpublic void setFilamentOffset(int val)
val - the distance (in pixel) the filament is positioned from the calorimeter wallpublic void setFilamentSectionCount(int val)
val - the number of sectionspublic void setFilamentSectionWidth(int val)
val - the width (in pixels) of a section of the filamentpublic void setFilamentTime(double val)
val - the time (in seconds) that the filament is activepublic void setFinalSlope(double val)
val - the initial slope (energy/second)public void setHeatCapacity(double val)
val - the heat capacitypublic void setHeatFlow(double val)
val - the heat flowsetHeatingRate(double)public void setHeatingRate(double val)
val - heating rate (energy/second)setHeatFlow(double)public void setInitialSlope(double val)
val - the initial slope (energy/second)public void setInitialTemperature(double val)
val - the initial temperaturepublic void setLiquidColor(java.lang.String rgb)
rgb - this string is converted into a 24-bit integer that defines the colorpublic void setLiquidFraction(double val)
val - the vertical fraction of the calorimeter body filled with the liquidpublic void setOwner(edu.davidson.tools.SApplet owner)
owner - the owner of the data sourcepublic void setMaxCnt(int val)
val - maximum number of stepssetDelay(long)public void setRandom(long rnd)
rnd - the seed value for the random number generatorpublic void setReservoirHeight(int val)
val - height in pixelspublic void setReservoirLiquidFraction(double val)
val - fractionpublic void setReservoirOffset(int val)
val - offset in pixelspublic void setReservoirThickness(int val)
val - thickness in pixelspublic void setReservoirWidth(int val)
val - width in pixelspublic void setSampleColor(java.lang.String rgb)
rgb - this string is converted into a 24-bit integer that defines the colorpublic void setSampleDiameter(int val)
val - diameter in pixelspublic void setSampleHeight(int val)
val - height in pixelspublic void setSampleOffset(int val)
val - the distance (in pixels) the sample is positioned from the calorimeter wallpublic void setSampleWidth(int val)
val - width in pixelssetSampleHeight(int)public void setStandardDeviation(double val)
val - the standard deviation of the Gaussian noisepublic void setStartTime(double val)
val - the starting time (in seconds) for the reactionpublic void setStirrerColor(java.lang.String rgb)
rgb - this string is converted into a 24-bit integer that defines the colorpublic void setStirrerOffsetX(int val)
val - x offset in pixelspublic void setStirrerOffsetY(int val)
val - offset in pixelspublic void setStirrerWidth(int val)
val - size in pixelspublic void setStopTime(double val)
val - the time (in seconds) when the simulation endspublic void setThermometerFraction(double val)
val - the fraction of the thermometer body filled with liquidpublic void setThermometerOffsetX(int val)
val - the distance (in pixels) from the right calorimeter wallpublic void setThermometerOffsetY(int val)
val - the distance (in pixels) from the bottom of the calorimeterpublic void setTimeConstant(double val)
val - the time constant (in seconds)public void setTimeIncrement(double val)
val - the time increment (in seconds) for the simulationpublic void setUseFilament(boolean s)
s - if true the filament is to be usedshowFilament(boolean)public void showFilament(boolean s)
s - if true the filament is shownsetUseFilament(boolean)public void showSample(boolean s)
s - of true the sample is shownpublic void showStirrer(boolean s)
s - if true the stirrer is shownpublic void start()
public void startSimulation()
resetSimulation(),
stopSimulation()
public void step(double dt,
double tm)
dt - the time increment (in seconds)tm - the current time (in seconds)SStepablepublic void stop()
public void stopSimulation()
resetSimulation(),
startSimulation()public void run()
|
Chemistry AppletsDavid N. Blauch |
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||