|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimulation_Lab06Version.SimulationRunnable
public class SimulationRunnable
This class encapsulates an animation and some basic services to change the frame rate. The frames that are shown in the animation are specified by a component encapsulated by an ActionListener (and which must be provided to the constructor of this class). This app is provided for teaching purposes.
Constructor Summary | |
---|---|
SimulationRunnable(ActionListener frameDrawer)
Creates a runnable. |
Method Summary | |
---|---|
int |
getFrameRate()
Accessor for this animation's frame rate. |
void |
run()
Causes this runnable to launch. |
void |
run(int frameRate)
Causes this runnable to launch. |
boolean |
setFrameRate(int targetFrameRate)
Update this animation's frame rate to the passed value. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimulationRunnable(ActionListener frameDrawer)
Method Detail |
---|
public int getFrameRate()
public boolean setFrameRate(int targetFrameRate)
targetFrameRate
- the target frame rate
public void run(int frameRate)
frameRate
- public void run()
run
in interface Runnable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |