|
The Physiologist's Friend Simulation API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.unizh.ini.friend.simulation.AbstractSimulation
ch.unizh.ini.friend.simulation.TimedSimulation
public class TimedSimulation
Implementation of the simulation loop with the javax.swing.Timer mechanism. The Timer calls are not coalesced into a single call if they queue up.
Field Summary | |
---|---|
protected Timer |
timer
The simulation timer. |
Fields inherited from class ch.unizh.ini.friend.simulation.AbstractSimulation |
---|
delay, on, step |
Constructor Summary | |
---|---|
TimedSimulation(SimulationStep step,
int delay)
Creates a new instance with the given simulation step. |
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent actionEvent)
Gets notified by the timer. |
void |
addUpdateable(Updateable u)
Adds an updateable to the simulation. |
void |
removeUpdateable(Updateable u)
Removes an updateable from the simulation. |
void |
start()
Starts the simulation (timer). |
void |
stop()
Stops the simulation (timer). |
Methods inherited from class ch.unizh.ini.friend.simulation.AbstractSimulation |
---|
getDelay, getNumberOfIterationsPerStep, getStep, isOn, setDelay, setNumberOfIterationsPerStep |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Timer timer
Constructor Detail |
---|
public TimedSimulation(SimulationStep step, int delay)
step
- The simulation step instance.Method Detail |
---|
public void actionPerformed(ActionEvent actionEvent)
actionPerformed
in interface ActionListener
public void start()
start
in interface SimulationTask
start
in class AbstractSimulation
public void stop()
stop
in interface SimulationTask
stop
in class AbstractSimulation
public void addUpdateable(Updateable u)
addUpdateable
in interface SimulationTask
addUpdateable
in class AbstractSimulation
u
- An updateable.public void removeUpdateable(Updateable u)
removeUpdateable
in interface SimulationTask
removeUpdateable
in class AbstractSimulation
u
- An updateable.
|
http://www.ini.unizh.ch/~tobi/friend | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |