|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensourcephysics.controls.AbstractAnimation org.opensourcephysics.controls.AbstractSimulation
public abstract class 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, mainFrame |
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. |
static XML.ObjectLoader |
getLoader()
Returns an XML.ObjectLoader to save and load data for this object. |
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 |
---|
addChildFrame, clearChildFrames, doStep, 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 |
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 Animation
setControl
in class AbstractAnimation
control
- public Control getControl()
getControl
in class AbstractAnimation
public void startRunning()
public void stopRunning()
public void startAnimation()
startAnimation
in interface Animation
startAnimation
in class AbstractAnimation
public final void startSimulation()
startSimulation
in interface Simulation
public void start()
public void stopAnimation()
stopAnimation
in interface Animation
stopAnimation
in class AbstractAnimation
public final void stopSimulation()
stopSimulation
in interface Simulation
public void stop()
public final void stepAnimation()
stepAnimation
in interface Animation
stepAnimation
in class AbstractAnimation
public void initializeAnimation()
initializeAnimation
in interface Animation
initializeAnimation
in class AbstractAnimation
public int getStepCounter()
public void initialize()
public void resetAnimation()
resetAnimation
in interface Animation
resetAnimation
in class AbstractAnimation
public void enableStepsPerDisplay(boolean enable)
enable
- booleanpublic void setStepsPerDisplay(int num)
num
- intpublic int getStepsPerDisplay()
num
- intpublic void reset()
public void run()
run
in interface java.lang.Runnable
run
in class AbstractAnimation
public static XML.ObjectLoader getLoader()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |