|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opensourcephysics.controls.AbstractAnimation
org.opensourcephysics.controls.AbstractSimulation
AbstractSimulation is a template for SIP simulations. AbstractSimulation creates and manages an animation thread that invokes the abstract "doStep()" method every 1/10 second. The doStep method is also called when the stepAnimation button is pressed. Implement the doStep method to create a concrete simulation.
| Field Summary | |
protected SimControl |
control
|
protected boolean |
showStepsPerDisplay
|
protected int |
stepCounter
|
protected int |
stepsPerDisplay
|
| Fields inherited from class org.opensourcephysics.controls.AbstractAnimation |
animationThread, decimalFormat, delayTime |
| Constructor Summary | |
AbstractSimulation()
|
|
| Method Summary | |
void |
enableStepsPerDisplay(boolean enable)
Enables the steps per display variable in the control; |
Control |
getControl()
Gets this simulation's control. |
int |
getStepCounter()
Gets number of animation steps that have been performed since the last initializeAnimation. |
int |
getStepsPerDisplay()
Gets the number of animation steps before animated drawing panels are rendered. |
void |
initialize()
Initializes the simulation. |
void |
initializeAnimation()
Deprecated. |
void |
reset()
Resets the simulation to its default state. |
void |
resetAnimation()
Deprecated. |
void |
run()
Implementation of Runnable interface. |
void |
setControl(Control control)
Sets the Control for this model and initializes the control's values. |
void |
setStepsPerDisplay(int num)
Sets the number of animation steps before animated drawing panels are rendered. |
void |
start()
Starts the simulation. |
void |
startAnimation()
Deprecated. |
void |
startRunning()
Performs an action before executing one or more animation steps. |
void |
startSimulation()
Starts the simulation thread. |
void |
stepAnimation()
Steps the simulation. |
void |
stop()
Stops the simulation. |
void |
stopAnimation()
Deprecated. |
void |
stopRunning()
Performs an action after executing one or more animation steps. |
void |
stopSimulation()
Stops the simulation thread. |
| Methods inherited from class org.opensourcephysics.controls.AbstractAnimation |
doStep, isRunning |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected SimControl control
protected boolean showStepsPerDisplay
protected int stepsPerDisplay
protected int stepCounter
| Constructor Detail |
public AbstractSimulation()
| Method Detail |
public void setControl(Control control)
setControl in interface AnimationsetControl in class AbstractAnimationcontrol - public Control getControl()
getControl in class AbstractAnimationpublic void startRunning()
public void stopRunning()
public void startAnimation()
startAnimation in interface AnimationstartAnimation in class AbstractAnimationpublic final void startSimulation()
public void start()
public void stopAnimation()
stopAnimation in interface AnimationstopAnimation in class AbstractAnimationpublic final void stopSimulation()
public void stop()
public final void stepAnimation()
stepAnimation in interface AnimationstepAnimation in class AbstractAnimationpublic void initializeAnimation()
initializeAnimation in interface AnimationinitializeAnimation in class AbstractAnimationpublic int getStepCounter()
public void initialize()
public void resetAnimation()
resetAnimation in interface AnimationresetAnimation in class AbstractAnimationpublic void enableStepsPerDisplay(boolean enable)
enable - booleanpublic void setStepsPerDisplay(int num)
num - intpublic int getStepsPerDisplay()
public void reset()
public void run()
run in interface java.lang.Runnablerun in class AbstractAnimation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||