ripple
Class Ripple

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended byjava.applet.Applet
                  extended byedu.davidson.tools.SApplet
                      extended byripple.Ripple
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.lang.Runnable, java.io.Serializable

public class Ripple
extends SApplet
implements java.lang.Runnable

Class Ripple

See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.davidson.tools.SApplet
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
 
Constructor Summary
Ripple()
           
 
Method Summary
 int addObject(java.lang.String name, java.lang.String parList)
          Create an object and add it to the Physlet.
 int addSource()
          Adds a source.
 int addSource(double x, double y, double amp, double phase)
          Add a sinusoidal source to the ripple tank.
 void cancel()
          Cancels the generation of the animation frames.
 void deleteAll()
          Removes all sources.
 void edit()
          Edit mode.
 void editSources()
          Edit source mode.
 void forward()
          Starts the animation.
 void pause()
          Pauses the animation.
 void recalculate()
          Recalculates the animation frames.
 boolean setAnimationSlave(int masterID, int slaveID)
          Forces an object to follow another object on the screen.
 boolean setConstraint(int id, int constraintID)
          Sets a motion constraint on an object.
 void setDefault()
          Sets the ripple tank default.
 boolean setDisplayOffset(int id, int xOff, int yOff)
          Offsets the object's position on the screen from its default drawing position.
 void setDrag(boolean drag)
          Sets the default drag option.
 boolean setDragable(int id, boolean drag)
          Changes the drag property.
 boolean setRGB(int id, int r, int g, int b)
          Sets the red, green, and blue color values for a wire or coil that has already been created.
 void setWavelength(double w)
          Sets the wavelength.
 void setZScale(double s)
          Sets the intensity scale.
 void showIntensity(boolean val)
          Shows the intensity or the amplitude.
 void startAnimate()
          Starts the animation.
 void stepBack()
          Steps back one frame.
 void stepForward()
          Steps forward one frame.
 void stepTimeBack()
          Steps the movie back by one frame.
 void stepTimeForward()
          Step the movie forward by one frame.
 void stopAnimate()
          Stops the animation.
 
Methods inherited from class edu.davidson.tools.SApplet
addDataListener, addDataSource, checkAppletNames, cleanupDataConnections, clearAllData, clearData, deleteDataConnection, deleteDataConnections, formatValue, getAppletName, getClockID, getClockTime, getDataFromDS, getDataListener, getDataSource, getDataSource, getDebugLevel, getID, getSourceData, getSourceVariables, isClockRunning, isValidFunction, makeDataConnection, removeDataListener, removeDataSource, reset, reverse, sendDataToListener, setAutoRefresh, setClockContinous, setClockCycle, setClockOneShot, setClockTime, setConnectionBlock, setConnectionListener, setConnectionSmoothing, setConnectionSource, setConnectionStride, setConnectionWindowX, setConnectionWindowY, setDebugLevel, setDt, setExternalClock, setFPS, setIndependentClock, setTimeContinuous, setTimeCycle, setTimeOneShot, startClock, stepClock, stepTime, stop, stopClock, updateDataConnection, updateDataConnections
 
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
 
Methods inherited from interface java.lang.Runnable
run
 

Constructor Detail

Ripple

public Ripple()
Method Detail

setDrag

public void setDrag(boolean drag)
Sets the default drag option. Affects subsequent objects.

Parameters:
drag - true to drag new objects

setZScale

public void setZScale(double s)
Sets the intensity scale.

Parameters:
s -

setWavelength

public void setWavelength(double w)
Sets the wavelength.

Parameters:
w -

setDisplayOffset

public boolean setDisplayOffset(int id,
                                int xOff,
                                int yOff)
Offsets the object's position on the screen from its default drawing position.

Parameters:
id - The id of the object.
xOff -
yOff -
Returns:
True if successful.

setRGB

public boolean setRGB(int id,
                      int r,
                      int g,
                      int b)
Sets the red, green, and blue color values for a wire or coil that has already been created. Color values must be in the range 0..255.

Parameters:
id - The id for the wire or loop.
r - red.
g - green.
b - blue.
Returns:
true if successful

setDragable

public boolean setDragable(int id,
                           boolean drag)
Changes the drag property.

Parameters:
id - the object identifier
drag - true if dragable
Returns:
true if successful

showIntensity

public void showIntensity(boolean val)
Shows the intensity or the amplitude.

Parameters:
val - true for intensity; false for amplitude

cancel

public void cancel()
Cancels the generation of the animation frames.


pause

public void pause()
Pauses the animation.

Overrides:
pause in class SApplet

stopAnimate

public void stopAnimate()
Stops the animation.


startAnimate

public void startAnimate()
Starts the animation.


stepTimeForward

public void stepTimeForward()
Step the movie forward by one frame.

Overrides:
stepTimeForward in class SApplet

stepForward

public void stepForward()
Steps forward one frame.


stepTimeBack

public void stepTimeBack()
Steps the movie back by one frame.

Overrides:
stepTimeBack in class SApplet

stepBack

public void stepBack()
Steps back one frame.


recalculate

public void recalculate()
Recalculates the animation frames.


forward

public void forward()
Starts the animation.

Overrides:
forward in class SApplet

edit

public void edit()
Edit mode.


editSources

public void editSources()
Edit source mode.


addSource

public int addSource()
Adds a source.

Returns:
the id

addSource

public int addSource(double x,
                     double y,
                     double amp,
                     double phase)
Add a sinusoidal source to the ripple tank.

Parameters:
x - the x position
y - the y position
amp - the amplitude
phase - the phase angle
Returns:
the id

addObject

public int addObject(java.lang.String name,
                     java.lang.String parList)
Create an object and add it to the Physlet. The first argument is the name of the object to be added and the second is a comma-delimited list of parameters. For example, a circle can be added a follows:

addObject ("circle", "x = 0, y = -1.0, r = 10");

See the supplemental documentation for a list of object names and parameters.

Parameters:
name - the type of object to be created.
parList - a list of parameters to be set
Returns:
id that identifies the object.

setAnimationSlave

public boolean setAnimationSlave(int masterID,
                                 int slaveID)
Forces an object to follow another object on the screen.

Parameters:
masterID - The id of the master object.
slaveID - The id of the slave object.
Returns:
true if successful.

setConstraint

public boolean setConstraint(int id,
                             int constraintID)
Sets a motion constraint on an object.

Parameters:
id - the ID of the object.
constraintID - the ID of the constraint.
Returns:
true if successful.

setDefault

public void setDefault()
Sets the ripple tank default. Delete sources. Delete drawable objects.

Overrides:
setDefault in class SApplet

deleteAll

public void deleteAll()
Removes all sources.



Visit the Davidson College Physlet Site for additional information.