|
||||||||||
| 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
thermometer.Thermometer
public class Thermometer
This applet displays a thermometer. The user may specify the temperature or may use DataConnections to supply the temperature. Thermometer can act as a DataListener (provides dynamic temperature updates) or a DataSource (provides dynamic temperature output if the user manually drags the liquid level). The only information accepted or supplied is the temperature.
Applet Parameters
| Name | Variable Type | Default | Description |
|---|---|---|---|
| AutoScaleMax | boolean | false | If true, the maximum scale reading is automatically increased if the temperature exceeds the maximum scale value. |
| AutoScaleMin | boolean | false | If true, the minimum scale reading is automatically decreased if the temperature drops below the minimum scale value. |
| BGColor | String | null | String representing an integer describing the RGB color for the applet background |
| IsReady | String | JavaScript variable that will be set to true when applet has initialized. Must use MAYSCRIPT in APPLET tag to use this feature. | |
| MaxTemperature | double | 100.0 | Maximum temperature |
| MinTemperature | double | 0.0 | Minimum temperature |
| Vertical | boolean | true | If true the thermometer is oriented vertically; if false the thermometer is oriented horizontally. |
| 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 | |
|---|---|
Thermometer()
|
|
| Method Summary | |
|---|---|
void |
addData(edu.davidson.tools.SDataSource ds,
int id,
double[] xVal,
double[] yVal)
Adds an array of data points via DataConnections. |
void |
addDatum(edu.davidson.tools.SDataSource ds,
int id,
double xVal,
double yVal)
Adds a data point via DataConnections. |
void |
autoScaleMax(boolean val)
Sets autoscale feature for the maximum temperature. |
void |
autoScaleMin(boolean val)
Sets autoscale feature for the minimum temperature. |
void |
clearSeries(int id)
This method is required by SDataListener but is not used in this class. |
void |
deleteSeries(int id)
This method is required by SDataListener but is not used in this class. |
void |
destroy()
|
java.lang.String |
getAppletInfo()
|
edu.davidson.tools.SApplet |
getOwner()
Gets the owner of this DataListener and DataSource |
java.lang.String |
getParameter(java.lang.String key,
java.lang.String def)
|
java.lang.String[][] |
getParameterInfo()
|
double |
getTemperature()
Gets the current temperature. |
double[][] |
getVariables()
SDataSource method. |
java.lang.String[] |
getVarStrings()
SDataSource method. |
void |
init()
|
boolean |
mouseDown(java.awt.Event evt,
int xpos,
int ypos)
|
boolean |
mouseDrag(java.awt.Event evt,
int xpos,
int ypos)
|
boolean |
mouseUp(java.awt.Event evt,
int xpos,
int ypos)
|
void |
paint(java.awt.Graphics g)
|
void |
setBackgroundColor(java.lang.String rgb)
Sets the background color for the applet. |
void |
setDragable(boolean val)
Determines whether the user can drag the liquid level in the thermometer. |
void |
setLabel(int val)
Sets the label for the thermometer 0 = no label 1 = K 2 = Kelvin 3 = oC 4 = Celcius 5 = oF 6 = Fahrenheit |
void |
setLiquidColor(java.lang.String rgb)
Sets the color of the liquid in the thermometer (default is red). |
void |
setMaxTemperature(double val)
Sets the maximum temperature on the thermometer. |
void |
setMinMaxTemperature(double valMin,
double valMax)
Sets the minimum and maximum temperatures on the thermometer. |
void |
setMinTemperature(double val)
Sets the minimum temperature on the thermometer. |
void |
setOwner(edu.davidson.tools.SApplet owner)
Sets the owner for SDataListener and SDataSource |
void |
setTemperature(double val)
Sets the temperature and updates the thermometer graphics. |
void |
start()
|
void |
stop()
|
| 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, mouseEnter, mouseExit, mouseMove, 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.SDataListener |
|---|
getID |
| Methods inherited from interface edu.davidson.tools.SDataSource |
|---|
getID |
| Constructor Detail |
|---|
public Thermometer()
| Method Detail |
|---|
public void addData(edu.davidson.tools.SDataSource ds,
int id,
double[] xVal,
double[] yVal)
addData in interface edu.davidson.tools.SDataListenerds - the data source supplying the information (not used).id - the data identification (not used).xVal - the array of x values for the data point (not used).yVal - the array of y values for the data point, corresponds to the temperature.
public void addDatum(edu.davidson.tools.SDataSource ds,
int id,
double xVal,
double yVal)
addDatum in interface edu.davidson.tools.SDataListenerds - the data source supplying the information (not used).id - the data identification (not used).xVal - the x value for the data point (not used).yVal - the y value for the data point, corresponds to the temperature.public void autoScaleMax(boolean val)
val - true enables autoscaling of the maximum temperatureautoScaleMinpublic void autoScaleMin(boolean val)
val - true enables autoscaling of the minimum temperatureautoScaleMaxpublic void clearSeries(int id)
clearSeries in interface edu.davidson.tools.SDataListenerpublic void deleteSeries(int id)
deleteSeries in interface edu.davidson.tools.SDataListenerpublic void destroy()
destroy in class edu.davidson.tools.SAppletpublic java.lang.String getAppletInfo()
getAppletInfo in class java.applet.Appletpublic edu.davidson.tools.SApplet getOwner()
getOwner in interface edu.davidson.tools.SDataListenergetOwner in interface edu.davidson.tools.SDataSourcepublic java.lang.String[][] getParameterInfo()
getParameterInfo in class java.applet.Applet
public java.lang.String getParameter(java.lang.String key,
java.lang.String def)
public double getTemperature()
public double[][] getVariables()
getVariables in interface edu.davidson.tools.SDataSourcepublic java.lang.String[] getVarStrings()
getVarStrings in interface edu.davidson.tools.SDataSourcepublic void init()
init in class java.applet.Appletpublic void paint(java.awt.Graphics g)
paint in class java.awt.Containerpublic void setBackgroundColor(java.lang.String rgb)
rgb - this string is decoded to yield a 24-bit RGB number for the colorpublic void setDragable(boolean val)
public void setLabel(int val)
val - label stylepublic void setLiquidColor(java.lang.String rgb)
rgb - this string is decoded to yield a 24-bit RGB number for the colorpublic void setMaxTemperature(double val)
val - this value is the new high temperature on the thermometer.public void setMinTemperature(double val)
val - this value is the new low temperature on the thermometer.
public void setMinMaxTemperature(double valMin,
double valMax)
valMin - new low temperature on the thermometervalMax - new high temperature on the thermometerpublic void setOwner(edu.davidson.tools.SApplet owner)
setOwner in interface edu.davidson.tools.SDataListenersetOwner in interface edu.davidson.tools.SDataSourceowner - the owner of this DataListenerpublic void setTemperature(double val)
val - new temperaturepublic void start()
start in class java.applet.Appletpublic void stop()
stop in class java.applet.Applet
public boolean mouseDown(java.awt.Event evt,
int xpos,
int ypos)
mouseDown in class java.awt.Component
public boolean mouseUp(java.awt.Event evt,
int xpos,
int ypos)
mouseUp in class java.awt.Component
public boolean mouseDrag(java.awt.Event evt,
int xpos,
int ypos)
mouseDrag in class java.awt.Component
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||