molecular
Class MolecularApplet

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 bymolecular.MolecularApplet
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class MolecularApplet
extends SApplet

Class MolecularApplet

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
 
Method Summary
 void addCaption(java.lang.String cap)
          Adds a title to ensemble in top-center
 int addParticle(double xin, double yin, double xvel, double yvel, double r)
          Adds one particle to the ensemble
 int addParticleDataSource(int i)
          Adds a data source to a particle so that it can be used in a data connection.
 void createParticles(int n)
          Method createParticles
 void forward()
          Starts the animation
 double getBWPos()
          Returns the bottom wall position
 int getEnsembleID()
          Returns the id of the ensemble.
 int getHistogramID(int nbins, double vmin, double vmax)
          Returns the id of the velocity histogram.
 double getLWPos()
          Returns the left wall position
 int getParticleID(int i)
          Returns the object identifier of the particle.
 double getRWPos()
          Returns the right wall position
 double getTWPos()
          Returns the top wall position
 void pause()
          Stops the animation
 void removeParticle(int i)
          Removes ith particle from ensemble
 void removeWallTemp(java.lang.String wall)
          Method removeWallTemp
 void setAutoRefresh(boolean ar)
          Method setAutoRefresh
 void setBackgroundRGB(int r, int g, int b)
          Sets Background color inside ensemble
 void setBoltzmann(double kb)
          Method setBoltzmann
 void setBorderWidth(int w)
          Method setBorderWidth
 void setDefault()
          Reset to time t=0; public void resetClock(){ pause(); ensemble1.reset(); }
 void setDefaultColor(int r, int g, int b)
          Sets default color when adding new particles.
 void setDefaultMass(double m)
          Sets default mass when adding new particles.
 void setDefaultSize(double r)
          Sets default size when adding new particles.
 void setDefaultTemp(double t)
          Method setDefaultTemp
 void setDisplayOffset(int xoff, int yoff)
          Sets offsets for title
 void setMaxParticles(int p)
          Sets maximum number of particles that can be stored in arrays
 void setMessage(java.lang.String msg)
          Adds a message to small yellow box opposite coordinate display.
 void setParticleFixed(int i, boolean fixed)
          Sets a particle so that it cannot move.
 void setParticleMass(int i, double m)
          Sets mass of particle default value is 1 unit.
 void setParticlePos(int i, double xin, double yin)
          Sets Position of particle
 void setParticleRGB(int i, int rd, int gr, int bl)
          Sets color of particle
 void setParticles(int n)
          Method setParticles
 void setParticleSize(int i, double s)
          Sets size of particle default value is 1 in world units.
 void setParticleVel(int i, double xvel, double yvel)
          Sets Velocity of particle
 void setPeriodicH(boolean p)
          Sets Periodic periodic boundary conditions in horizontal direction
 void setPeriodicV(boolean p)
          Sets Periodic periodic boundary conditions ion vertical direction
 void setPpu(int p)
          Sets pixels per unit of ensemble
 void setRGB(int r, int g, int b)
          Sets color of title
 void setShowControls(boolean s)
          Shows or hides control panel
 void setTemp(double temp)
          Set the temperature of the ensemble in one step.
 void setTemperature(double temp, int steps)
          Set the temperature of the ensemble in n steps.
 void setWallTemp(java.lang.String wall, double t)
          Method setWallTemp
 void stepForward()
          Steps simulation forward one time step
 
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, setClockContinous, setClockCycle, setClockOneShot, setClockTime, setConnectionBlock, setConnectionListener, setConnectionSmoothing, setConnectionSource, setConnectionStride, setConnectionWindowX, setConnectionWindowY, setDebugLevel, setDt, setExternalClock, setFPS, setIndependentClock, setTimeContinuous, setTimeCycle, setTimeOneShot, startClock, stepClock, stepTime, stepTimeBack, stepTimeForward, 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
 

Method Detail

setShowControls

public void setShowControls(boolean s)
Shows or hides control panel

Parameters:
s - boolean

setMessage

public void setMessage(java.lang.String msg)
Adds a message to small yellow box opposite coordinate display.

Parameters:
msg - String

setRGB

public void setRGB(int r,
                   int g,
                   int b)
Sets color of title

Parameters:
r - int red
g - int green
b - int blue

setDisplayOffset

public void setDisplayOffset(int xoff,
                             int yoff)
Sets offsets for title

Parameters:
xoff -
yoff -

addCaption

public void addCaption(java.lang.String cap)
Adds a title to ensemble in top-center

Parameters:
cap - String

setDefault

public void setDefault()
Reset to time t=0; public void resetClock(){ pause(); ensemble1.reset(); }

Overrides:
setDefault in class SApplet

pause

public void pause()
Stops the animation

Overrides:
pause in class SApplet

forward

public void forward()
Starts the animation

Overrides:
forward in class SApplet

stepForward

public void stepForward()
Steps simulation forward one time step


addParticle

public int addParticle(double xin,
                       double yin,
                       double xvel,
                       double yvel,
                       double r)
Adds one particle to the ensemble

Parameters:
xin - double initial xposition
yin - double initial yposition
xvel - double initial x-velocity
yvel - double initial y-velocity
r - double particle radius
Returns:
int new particle number

createParticles

public void createParticles(int n)
Method createParticles

Parameters:
n -

setParticles

public void setParticles(int n)
Method setParticles

Parameters:
n -

setTemp

public void setTemp(double temp)
Set the temperature of the ensemble in one step.

Parameters:
temp - double The new temperature.

setTemperature

public void setTemperature(double temp,
                           int steps)
Set the temperature of the ensemble in n steps. Data will be sent to data listeners after each step.

Parameters:
temp - double The new temperature.
steps - int The number of steps.

removeParticle

public void removeParticle(int i)
Removes ith particle from ensemble

Parameters:
i - int particle number

setMaxParticles

public void setMaxParticles(int p)
Sets maximum number of particles that can be stored in arrays

Parameters:
p - max particles

setBackgroundRGB

public void setBackgroundRGB(int r,
                             int g,
                             int b)
Sets Background color inside ensemble

Parameters:
r - int red
g - int green
b - int blue

setDefaultMass

public void setDefaultMass(double m)
Sets default mass when adding new particles. All particles created after calling this method will have this mass

Parameters:
m - double mass

setDefaultSize

public void setDefaultSize(double r)
Sets default size when adding new particles. All particles created after calling this method will have this radius

Parameters:
r - double radius

setDefaultColor

public void setDefaultColor(int r,
                            int g,
                            int b)
Sets default color when adding new particles. All particles created after calling this method will have this color

Parameters:
r - int red
g - int green
b - int blue

setDefaultTemp

public void setDefaultTemp(double t)
Method setDefaultTemp

Parameters:
t -

setParticleRGB

public void setParticleRGB(int i,
                           int rd,
                           int gr,
                           int bl)
Sets color of particle

Parameters:
i - int particle number
rd - int red value (<256)
gr - int green value (<256)
bl - int blue value (<256)

setParticleMass

public void setParticleMass(int i,
                            double m)
Sets mass of particle default value is 1 unit.

Parameters:
i - int particle number
m - double mass.

setBorderWidth

public void setBorderWidth(int w)
Method setBorderWidth

Parameters:
w -

setParticlePos

public void setParticlePos(int i,
                           double xin,
                           double yin)
Sets Position of particle

Parameters:
i - int particle number
xin - double initial x-position
yin - double initial y-position

setParticleVel

public void setParticleVel(int i,
                           double xvel,
                           double yvel)
Sets Velocity of particle

Parameters:
i - int particle number
xvel - double initial x-velocity
yvel - double initial y-velocity

setParticleSize

public void setParticleSize(int i,
                            double s)
Sets size of particle default value is 1 in world units.

Parameters:
i - int particle number
s - double size.

setParticleFixed

public void setParticleFixed(int i,
                             boolean fixed)
Sets a particle so that it cannot move.

Parameters:
i - int particle number
fixed - true if fixed

addParticleDataSource

public int addParticleDataSource(int i)
Adds a data source to a particle so that it can be used in a data connection.

Parameters:
i -
Returns:
the id

setAutoRefresh

public void setAutoRefresh(boolean ar)
Method setAutoRefresh

Overrides:
setAutoRefresh in class SApplet
Parameters:
ar -

setBoltzmann

public void setBoltzmann(double kb)
Method setBoltzmann

Parameters:
kb -

setWallTemp

public void setWallTemp(java.lang.String wall,
                        double t)
Method setWallTemp

Parameters:
wall -
t -

removeWallTemp

public void removeWallTemp(java.lang.String wall)
Method removeWallTemp

Parameters:
wall -

setPpu

public void setPpu(int p)
Sets pixels per unit of ensemble

Parameters:
p - int

setPeriodicH

public void setPeriodicH(boolean p)
Sets Periodic periodic boundary conditions in horizontal direction

Parameters:
p - boolean

setPeriodicV

public void setPeriodicV(boolean p)
Sets Periodic periodic boundary conditions ion vertical direction

Parameters:
p - boolean

getRWPos

public double getRWPos()
Returns the right wall position

Returns:
double

getLWPos

public double getLWPos()
Returns the left wall position

Returns:
double

getTWPos

public double getTWPos()
Returns the top wall position

Returns:
double

getBWPos

public double getBWPos()
Returns the bottom wall position

Returns:
double

getEnsembleID

public int getEnsembleID()
Returns the id of the ensemble. This id can be used to make data connections.

Returns:
int the id

getHistogramID

public int getHistogramID(int nbins,
                          double vmin,
                          double vmax)
Returns the id of the velocity histogram. This id can be used to make data connections.

Parameters:
nbins - int The number of bins in the histogram.
vmin -
vmax -
Returns:
int The id.

getParticleID

public int getParticleID(int i)
Returns the object identifier of the particle. This id can be used to make data connections. Each particle has an index ranging from 0 to N-1 that specifies its postion in an array where N is the total number of particles. This index must be converted to an object identifier in order to make a data connection.

Parameters:
i - int the particle index.
Returns:
int the object identifier.


Visit the Davidson College Physlet Site for additional information.