java.lang.Runnable, AnimationAbstractSimulationpublic abstract class AbstractAnimation extends java.lang.Object implements Animation, java.lang.Runnable
| Modifier and Type | Field | Description |
|---|---|---|
protected java.lang.Thread |
animationThread |
|
protected Control |
control |
|
protected java.text.DecimalFormat |
decimalFormat |
Field decimalFormat can be used to display time and other numeric values.
|
protected int |
delayTime |
|
protected OSPFrame |
mainFrame |
| Constructor | Description |
|---|---|
AbstractAnimation() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addChildFrame(javax.swing.JFrame frame) |
Adds a child frame that depends on the main frame.
|
void |
clearChildFrames() |
Clears the child frames from the main frame.
|
protected abstract void |
doStep() |
Does an animation step.
|
java.util.Collection<javax.swing.JFrame> |
getChildFrames() |
Gets a copy of the ChildFrames collection.
|
Control |
getControl() |
Gets the Control.
|
int |
getDelayTime() |
Gets the preferred delay time in ms between animation steps.
|
static XML.ObjectLoader |
getLoader() |
Returns an XML.ObjectLoader to save and load data for this object.
|
OSPFrame |
getMainFrame() |
Gets the main OSPFrame.
|
OSPApplication |
getOSPApp() |
Gets the main OSPFrame.
|
void |
initializeAnimation() |
Initializes the animation by reading parameters from the control.
|
boolean |
isRunning() |
Determines if the animation is running.
|
void |
resetAnimation() |
Resets the animation to a predefined state.
|
void |
run() |
Implementation of Runnable interface.
|
void |
setControl(Control control) |
Sets the Control for this model and initializes the control's values.
|
void |
setDelayTime(int delay) |
Sets the preferred delay time in ms between animation steps.
|
void |
startAnimation() |
Starts the animation.
|
void |
stepAnimation() |
Steps the animation.
|
void |
stopAnimation() |
Stops the animation.
|
protected OSPFrame mainFrame
protected Control control
protected volatile java.lang.Thread animationThread
protected int delayTime
protected java.text.DecimalFormat decimalFormat
public void setControl(Control control)
setControl in interface Animationcontrol - public void setDelayTime(int delay)
delay - public int getDelayTime()
public OSPFrame getMainFrame()
public OSPApplication getOSPApp()
public void addChildFrame(javax.swing.JFrame frame)
frame - JFramepublic void clearChildFrames()
public java.util.Collection<javax.swing.JFrame> getChildFrames()
public Control getControl()
public void initializeAnimation()
initializeAnimation in interface Animationprotected abstract void doStep()
public void stopAnimation()
stopAnimation in interface Animationpublic final boolean isRunning()
public void stepAnimation()
stepAnimation in interface Animationpublic void startAnimation()
startAnimation in interface Animationpublic void resetAnimation()
resetAnimation in interface Animationpublic void run()
run in interface java.lang.Runnablepublic static XML.ObjectLoader getLoader()