|
|||||||
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
SApplet is designed to provide inter-applet communication and common functionality for Physlets. Physlets usually subclass from SApplet in order to access the animation clock, to register data sources and data listeners, and to enable JavaScript for data-connections.
Field Summary | |
boolean |
destroyed
|
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 |
Method Summary | |
static void |
addDataListener(java.lang.Object dl)
Method addDataListener |
static void |
addDataSource(java.lang.Object ds)
Add a data source to the list. |
boolean |
checkAppletNames(java.lang.String names)
Checks a list of names to determine if the applets in this list have started. |
void |
cleanupDataConnections()
Removes dataConnections if either the source or the listener no longer exist. |
void |
clearAllData()
Delete all the data that has been sent to the DataConnections. |
void |
clearData(int id)
Delete all the data that has been sent to the DataConnections. |
void |
deleteDataConnection(int id)
Break the data connection identified by the id. |
void |
deleteDataConnections()
Break all data connections for this applet. |
java.lang.String |
formatValue(double val,
double chop,
java.lang.String str)
Convert a number to a string. |
void |
forward()
Start clock. |
java.lang.String |
getAppletName()
Gets the name that was used to embed this applet in the html page. |
int |
getClockID()
Get the clock id for use as a data source. |
double |
getClockTime()
Get the time from the animation clock. |
java.lang.String |
getDataFromDS(int id)
Return the data as a string. |
static edu.davidson.tools.SDataListener |
getDataListener(java.lang.String key)
Gets the data listener from the key. |
static edu.davidson.tools.SDataSource |
getDataSource(int id)
Find the data source with the given id. |
static edu.davidson.tools.SDataSource |
getDataSource(java.lang.String key)
Find the data source with the given key. |
int |
getDebugLevel()
Get the debug level. |
int |
getID()
Method object identifier. |
java.lang.String |
getSourceData(int id,
java.lang.String vStr)
Returns a comma delimited list of the datasource data. |
java.lang.String |
getSourceVariables(int id)
Return a comma delimited list of the data source variables. |
boolean |
isClockRunning()
Test to see if the clock is running. |
boolean |
isValidFunction(java.lang.String func,
java.lang.String vars)
Check to see if a function is syntactically correct. |
int |
makeDataConnection(int sourceID,
int listenerID,
int seriesID,
java.lang.String xStr,
java.lang.String yStr)
Have the applet make a new data connection. |
void |
pause()
Pause the clock. |
void |
removeDataListener(int id)
Method removeDataListener |
void |
removeDataSource(int id)
Remove the data source with the given id. |
void |
reset()
Reset the clock to time=0. |
void |
reverse()
Stop the clock. |
void |
sendDataToListener(int listenerID,
int sid,
double x,
double y)
Sends an (x,y) data point to the listener. |
void |
setAutoRefresh(boolean ar)
Repaint whenevers the system parameters are changed. |
void |
setClockContinous()
Set the clock to run continously. |
void |
setClockCycle(double minTime,
double maxTime)
Set the clock to cycle between the minTime and maxTime. |
void |
setClockOneShot(double minTime,
double maxTime)
Set the clock to run from minTime to maxTime and stop. |
void |
setClockTime(double t)
Set the clock time. |
boolean |
setConnectionBlock(int id,
boolean block)
Block data from passing through the data connection. |
boolean |
setConnectionListener(int id)
Set the data listener for the data connection. |
boolean |
setConnectionSmoothing(int id,
int num)
Have the data connection smooth the data before it is sent to the data listener. |
boolean |
setConnectionSource(int id)
Set the data source for the data connection. |
boolean |
setConnectionStride(int id,
int num)
Have the data connection skip every num-1 data points. |
boolean |
setConnectionWindowX(int id,
double xmin,
double xmax)
Have the data connection reject data unless xmin <= x <= xmax. |
boolean |
setConnectionWindowY(int id,
double ymin,
double ymax)
Have the data connection reject data unless ymin <= y <= ymax. |
void |
setDebugLevel(int level)
Set the debug leve. |
void |
setDefault()
Reset the clock to time=0. |
void |
setDt(double dt)
Set the time increment. |
boolean |
setExternalClock(int id)
Sets the animatation clock to the clock in another applet. |
void |
setFPS(double fps)
Set the frames per second. |
void |
setIndependentClock(boolean independent)
Sets the clock so that this applet does not stop running when another applet starts running. |
void |
setTimeContinuous()
Set the time increment. |
void |
setTimeCycle(double maxTime)
Set the clock to cycle between the 0 and maxTime. |
void |
setTimeOneShot(double maxTime,
java.lang.String msg)
Set the clock to run from minTime to maxTime and stop. |
void |
startClock()
Starts the clock |
void |
stepClock()
Step the clock by one tick, dt. |
void |
stepTime()
Step the clock by dt. |
void |
stepTimeBack()
Step the clock back by dt. |
void |
stepTimeForward()
Step the clock forward by dt. |
void |
stop()
Invoked by the browser when the html page is exited. |
void |
stopClock()
Stop the clock |
void |
updateDataConnection(int id)
Have a single data source update its data connections. |
void |
updateDataConnections()
Have all data sources update their data connections. |
Methods inherited from class java.applet.Applet |
destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, init, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start |
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, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, 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, 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, isOpaque, 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, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public boolean destroyed
Method Detail |
public void sendDataToListener(int listenerID, int sid, double x, double y)
public int makeDataConnection(int sourceID, int listenerID, int seriesID, java.lang.String xStr, java.lang.String yStr)
sourceID
- The id of the data source.listenerID
- The id of the data listener. This is usually an applet.seriesID
- The id of the series in the data listener.xStr
- The function of the data source variables to be plotted on the horizontal axis.yStr
-
public void clearAllData()
public void clearData(int id)
id
- int The hashCode id of the data source.public void updateDataConnection(int id)
id
- The integer id of the data source.public void updateDataConnections()
public void deleteDataConnections()
public void deleteDataConnection(int id)
id
- The data connection id.public java.lang.String getDataFromDS(int id)
id
-
public final boolean isValidFunction(java.lang.String func, java.lang.String vars)
func
- vars
-
public java.lang.String getAppletName()
public boolean checkAppletNames(java.lang.String names)
names
- a comma delimited list of applet names
public final void cleanupDataConnections()
public final int getDebugLevel()
public final void setDebugLevel(int level)
level
- public final int getID()
public final boolean setConnectionSmoothing(int id, int num)
id
- int The id of of the data connection.num
- int The number of data points to smooth.
public final boolean setConnectionWindowX(int id, double xmin, double xmax)
id
- the id of of the data connectionxmin
- the minimum value to passxmax
- the maximum value to pass
public final boolean setConnectionWindowY(int id, double ymin, double ymax)
id
- the id of of the data connectionymin
- the minimum value to passymax
- the maximum value to pass
public final boolean setConnectionStride(int id, int num)
id
- num
-
public final boolean setConnectionBlock(int id, boolean block)
id
- block
-
public final boolean setConnectionSource(int id)
id
-
public final boolean setConnectionListener(int id)
id
-
public void setAutoRefresh(boolean ar)
ar
- public java.lang.String formatValue(double val, double chop, java.lang.String str)
val
- the number to formatchop
- return zero if abs(val) < chop.str
- the new format string
public void forward()
public void reverse()
public void pause()
public void reset()
public void setDefault()
public void setDt(double dt)
dt
- public void setFPS(double fps)
fps
- public void setTimeContinuous()
public final int getClockID()
public void setIndependentClock(boolean independent)
independent
- true will make clock independent; false otherwisepublic final boolean setExternalClock(int id)
id
- the clock in another applet.
public void stepClock()
public void stepTimeForward()
public void stepTimeBack()
public void stepTime()
public double getClockTime()
public void setClockTime(double t)
t
- The clock time.public void setTimeOneShot(double maxTime, java.lang.String msg)
maxTime
- The maximum time.msg
- public void setClockOneShot(double minTime, double maxTime)
minTime
- The maximum time.maxTime
- The maximum time.public void setClockContinous()
SApplet.setClockOneShot(double, double)
,
SApplet.setClockCycle(double, double)
public void setTimeCycle(double maxTime)
maxTime
- The maximum time.public void setClockCycle(double minTime, double maxTime)
minTime
- The maximum time.maxTime
- The maximum time.public void stop()
public void startClock()
public boolean isClockRunning()
public void stopClock()
public static final void addDataSource(java.lang.Object ds)
ds
- The data source object.public final void removeDataSource(int id)
id
- The integer id that identifies the data source.public static final edu.davidson.tools.SDataSource getDataSource(java.lang.String key)
key
- The string id that identifies the data source.
public static final edu.davidson.tools.SDataSource getDataSource(int id)
id
- The integer id that identifies the data source.
public java.lang.String getSourceVariables(int id)
id
- the integer identifier of the data source.
public java.lang.String getSourceData(int id, java.lang.String vStr)
id
- the integer identifier of the data source.vStr
-
public final void removeDataListener(int id)
id
- the hash code of the data listenerpublic static final void addDataListener(java.lang.Object dl)
dl
- public static final edu.davidson.tools.SDataListener getDataListener(java.lang.String key)
key
-
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |