org.opensourcephysics.sip.ch08.hd
Class HardDisksApp

java.lang.Object
  extended by org.opensourcephysics.controls.AbstractAnimation
      extended by org.opensourcephysics.controls.AbstractSimulation
          extended by org.opensourcephysics.sip.ch08.hd.HardDisksApp
All Implemented Interfaces:
java.lang.Runnable, Animation, Simulation

public class HardDisksApp
extends AbstractSimulation

HardDisksApp simulates a two-cimensional system of colliding hard disks.


Field Summary
 
Fields inherited from class org.opensourcephysics.controls.AbstractSimulation
control, showStepsPerDisplay, stepCounter, stepsPerDisplay
 
Fields inherited from class org.opensourcephysics.controls.AbstractAnimation
animationThread, decimalFormat, delayTime, mainFrame
 
Constructor Summary
HardDisksApp()
           
 
Method Summary
 void doStep()
          Does a simulation step and appends data to the views.
 void initialize()
          Initializes the model by reading the number of particles.
static void main(java.lang.String[] args)
          Starts the Java application.
 void reset()
          Resets the hard disks model to its default state.
 void resetData()
          Resets the hard disks model and the data graphs.
 
Methods inherited from class org.opensourcephysics.controls.AbstractSimulation
enableStepsPerDisplay, getControl, getLoader, getStepCounter, getStepsPerDisplay, initializeAnimation, resetAnimation, run, setControl, setStepsPerDisplay, start, startAnimation, startRunning, startSimulation, stepAnimation, stop, stopAnimation, stopRunning, stopSimulation
 
Methods inherited from class org.opensourcephysics.controls.AbstractAnimation
addChildFrame, clearChildFrames, getChildFrames, getDelayTime, getMainFrame, getOSPApp, isRunning, setDelayTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensourcephysics.controls.Simulation
isRunning
 

Constructor Detail

HardDisksApp

public HardDisksApp()
Method Detail

initialize

public void initialize()
Initializes the model by reading the number of particles.

Overrides:
initialize in class AbstractSimulation

doStep

public void doStep()
Does a simulation step and appends data to the views.

Specified by:
doStep in class AbstractAnimation

reset

public void reset()
Resets the hard disks model to its default state.

Overrides:
reset in class AbstractSimulation

resetData

public void resetData()
Resets the hard disks model and the data graphs. This method is invoked using a custom button.


main

public static void main(java.lang.String[] args)
Starts the Java application.

Parameters:
args - command line parameters