|
||||||||||
| 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
piston.Piston
public class Piston
A piston with a movable barrier is displayed. This applet displays a pair of bulbs separated by stopcock.
Applet Parameters
| NAME | Variable Type | Default | Description |
|---|---|---|---|
| BarrierColor | String | #808040 | String containing a representation of an integer describing the RGB color for the movable barrier. |
| BarrierHeight | int | 20 | Height in pixels of the barrier. |
| BGColor | String | null | String containing a representation of an integer describing the RGB color for the applet background. |
| GasColor | String | null | String containing a representation of an integer describing the RGB color for the gas in the piston. |
| IsReady | String | JavaScript variable that will be set to true when applet has initialized. Must use MAYSCRIPT in APPLET tag to use this feature. | |
| MaximumVolume | double | 10.0 | Maximum volume for the piston |
| MinimumVolume | double | 0.0 | Minimum volume for the piston |
| PistonHeight | int | 0 | Height in pixels of the piston. If zero, the applet sets the piston height to fill the applet area. |
| PistonWidth | int | 0 | Width in pixels of the piston. If zero, the applet sets the piston width to fill the applet area. |
| ScaleMaximum | double | 10.0 | Sets the maximum value for the scale. |
| ScalePosition | boolean | true | If true, the scale is shown at the left side of the piston; otherwise the scale is shown at the right side. |
| ScaleWidth | int | 40 | Width in pixels of the scale. |
| ShowScale | boolean | true | Indicates whether of not to show the scale. |
| WallColor | String | #804000 | String containing a representation of an integer describing the RGB color for the piston wall. |
| WallWidth | int | 20 | Width in pixels of the piston walls. |
| 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 | |
|---|---|
Piston()
|
|
| 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)
The data source and id are not used. |
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[][] |
getVariables()
SDataSource method returning the current variables. |
java.lang.String[] |
getVarStrings()
SDataSource method returning variable strings. |
double |
getVolume()
Returns the volume of the piston |
void |
init()
|
boolean |
mouseDown(java.awt.Event evt,
int _x,
int _y)
|
boolean |
mouseDrag(java.awt.Event evt,
int _x,
int _y)
|
boolean |
mouseUp(java.awt.Event evt,
int _x,
int _y)
|
void |
paint(java.awt.Graphics g)
|
void |
setDragable(boolean val)
Determines whether the user can drag the barrier. |
void |
setMaxVolume(double _volume)
Sets the maximum volume for the piston. |
void |
setMaxVolume(double _volume,
double _scaleReading)
Sets the maximum volume for the piston based upon the volume at a given scale reading. |
void |
setMinVolume(double _volume)
Sets the minimum volume for the piston. |
void |
setOwner(edu.davidson.tools.SApplet owner)
Sets the owner for SDataListener and SDataSource |
void |
setScaleMaximum(double _max)
Sets the maximum value of the scale. |
void |
setVolume(double _volume)
Sets the volume (in mL) of the piston. |
void |
start()
|
void |
stop()
|
void |
updateDisplay()
Updates the position of the barrier in the piston |
| 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 Piston()
| Method Detail |
|---|
public java.lang.String getParameter(java.lang.String key,
java.lang.String def)
public void init()
init in class java.applet.Appletpublic void start()
start in class java.applet.Appletpublic void stop()
stop in class java.applet.Appletpublic void destroy()
destroy in class edu.davidson.tools.SAppletpublic java.lang.String getAppletInfo()
getAppletInfo in class java.applet.Appletpublic java.lang.String[][] getParameterInfo()
getParameterInfo in class java.applet.Applet
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 - volumeyVal - not used
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 - volumeyVal - not usedpublic void clearSeries(int id)
clearSeries in interface edu.davidson.tools.SDataListenerpublic void deleteSeries(int id)
deleteSeries in interface edu.davidson.tools.SDataListenerpublic edu.davidson.tools.SApplet getOwner()
getOwner in interface edu.davidson.tools.SDataListenergetOwner in interface edu.davidson.tools.SDataSourcepublic double[][] getVariables()
[0][0] contains the system volume
getVariables in interface edu.davidson.tools.SDataSourcepublic java.lang.String[] getVarStrings()
getVarStrings in interface edu.davidson.tools.SDataSourcepublic double getVolume()
public boolean mouseDown(java.awt.Event evt,
int _x,
int _y)
mouseDown in class java.awt.Component
public boolean mouseDrag(java.awt.Event evt,
int _x,
int _y)
mouseDrag in class java.awt.Component
public boolean mouseUp(java.awt.Event evt,
int _x,
int _y)
mouseUp in class java.awt.Componentpublic void paint(java.awt.Graphics g)
paint in class java.awt.Containerpublic void setDragable(boolean val)
public void setMaxVolume(double _volume)
public void setMaxVolume(double _volume,
double _scaleReading)
public void setMinVolume(double _volume)
public 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 setScaleMaximum(double _max)
public void setVolume(double _volume)
public void updateDisplay()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||