Class molecular.MolecularApplet

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----java.applet.Applet
                                   |
                                   +----sTools.SApplet
                                           |
                                           +----molecular.MolecularApplet

public class MolecularApplet
extends SApplet

Constructor Index

 o MolecularApplet()
 

Method Index

 o addParticle(double, double, double, double, double)
Adds one particle to the ensemble
 o addParticleDataSource(int)
 
 o createParticles(int)
 
 o forward()
Start the animation
 o getAppletInfo()
 
 o getBWPos()
Returns the bottom wall position
 o getEnsembleID()
Returns the id of the ensemble.
 o getHistogramID(int, double, double)
Returns the id of the velocity histogram.
 o getLWPos()
Returns the left wall position
 o getParameter(String, String)
 
 o getParameterInfo()
 
 o getRWPos()
Returns the right wall position
 o getTWPos()
Returns the top wall position
 o init()
 
 o pause()
Stop the animation
 o removeParticle(int)
Removes ith particle from ensemble
 o removeWallTemp(String)
 
 o setAutoRefresh(boolean)
 
 o setBackgroundRGB(int, int, int)
Sets Background color inside ensemble
 o setBoltzmann(double)
 
 o setBorderWidth(int)
 
 o setDefault()
Reset to time t=0; public void resetClock(){ pause(); ensemble1.reset(); }
 o setDefaultColor(int, int, int)
Sets default color when adding new particles.
 o setDefaultMass(double)
Sets default mass when adding new particles.
 o setDefaultSize(double)
Sets default size when adding new particles.
 o setDefaultTemp(double)
 
 o setDt(double)
Sets calculation time step
 o setFPS(int)
Sets frames per second of animation
 o setMaxParticles(int)
Sets maximum number of particles that can be stored in arrays
 o setParticleMass(int, double)
Sets mass of particle default value is 1 unit.
 o setParticlePos(int, double, double)
Sets Position of particle
 o setParticleRGB(int, int, int, int)
Sets color of particle
 o setParticles(int)
 
 o setParticleSize(int, double)
Sets size of particle default value is 1 in world units.
 o setParticleVel(int, double, double)
Sets Velocity of particle
 o setPeriodicH(boolean)
Sets Periodic periodic boundary conditions in horizontal direction
 o setPeriodicV(boolean)
Sets Periodic periodic boundary conditions ion vertical direction
 o setPpu(int)
Sets pixels per unit of ensemble
 o setShowControls(boolean)
Shows or hides control panel
 o setTemp(double)
Set the temperature of the ensemble in one step.
 o setTemperature(double, int)
Set the temperature of the ensemble in n steps.
 o setWallTemp(String, double)
 
 o start()
 
 o stepForward()
Steps simulation forward one time step

Constructors

 o MolecularApplet

 public MolecularApplet()

Methods

 o getParameter

 public String getParameter(String key,
                            String def)

 o init

 public void init()
Overrides:
init in class Applet

 o getAppletInfo

 public String getAppletInfo()
Overrides:
getAppletInfo in class Applet

 o getParameterInfo

 public String[][] getParameterInfo()
Overrides:
getParameterInfo in class Applet

 o start

 public void start()
Overrides:
start in class Applet

 o setShowControls

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

 o setDefault

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

 o pause

 public void pause()
Stop the animation

 o forward

 public void forward()
Start the animation

 o stepForward

 public void stepForward()
Steps simulation forward one time step

 o 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:
s int new particle number

 o createParticles

 public void createParticles(int n)

 o setParticles

 public void setParticles(int n)

 o setTemp

 public void setTemp(double temp)
Set the temperature of the ensemble in one step.
Parameters:
temp - double The new temperature.

 o 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.

 o removeParticle

 public void removeParticle(int i)
Removes ith particle from ensemble
Parameters:
i - int particle number

 o setMaxParticles

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

 o 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

 o 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

 o 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

 o 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

 o setDefaultTemp

 public void setDefaultTemp(double t)

 o 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 ( gr - int green value ( bl - int blue value (

 o 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.

 o setBorderWidth

 public void setBorderWidth(int w)

 o 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

 o 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

 o 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.

 o addParticleDataSource

 public int addParticleDataSource(int i)

 o setFPS

 public void setFPS(int f)
Sets frames per second of animation
Parameters:
f - int

 o setAutoRefresh

 public void setAutoRefresh(boolean ar)

 o setDt

 public void setDt(double d)
Sets calculation time step
Parameters:
d - double timestep dt

 o setBoltzmann

 public void setBoltzmann(double kb)

 o setWallTemp

 public void setWallTemp(String wall,
                         double t)

 o removeWallTemp

 public void removeWallTemp(String wall)

 o setPpu

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

 o setPeriodicH

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

 o setPeriodicV

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

 o getRWPos

 public double getRWPos()
Returns the right wall position
Returns:
double

 o getLWPos

 public double getLWPos()
Returns the left wall position
Returns:
double

 o getTWPos

 public double getTWPos()
Returns the top wall position
Returns:
double

 o getBWPos

 public double getBWPos()
Returns the bottom wall position
Returns:
double

 o getEnsembleID

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

 o 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.
min - double The minimum velocity
max - double The maximum velocity
Returns:
int The id.

All Packages  Class Hierarchy  This Package  Previous  Next  Index