public abstract class AbstractWrappableAnimation extends Object implements WrappableAnimation
Copyright (c) 2013-2015 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2015-12-29 03:56:14 +0100 (Tue, 29 Dec 2015) $, @version $Revision: 1668 $, by $Author: averbraeck $,
initial version Jun 18, 2015
Modifier and Type | Field and Description |
---|---|
protected boolean |
exitOnClose
Use EXIT_ON_CLOSE when true, DISPOSE_ON_CLOSE when false on closing of the window.
|
protected OTSAnimationPanel |
panel
the tabbed panel so other tabs can be added by the classes that extend this class.
|
protected ArrayList<AbstractProperty<?>> |
properties
The properties exhibited by this simulation.
|
protected ArrayList<AbstractProperty<?>> |
savedUserModifiedProperties
The properties after (possible) editing by the user.
|
Constructor and Description |
---|
AbstractWrappableAnimation() |
Modifier and Type | Method and Description |
---|---|
SimpleAnimator |
buildAnimator(org.djunits.value.vdouble.scalar.Time.Abs startTime,
org.djunits.value.vdouble.scalar.Time.Rel warmupPeriod,
org.djunits.value.vdouble.scalar.Time.Rel runLength,
ArrayList<AbstractProperty<?>> userModifiedProperties,
Rectangle rect,
boolean eoc)
Build the animation.
|
ArrayList<AbstractProperty<?>> |
getProperties()
Retrieve a list of visible properties of the simulation.
|
ArrayList<AbstractProperty<?>> |
getUserModifiedProperties()
Retrieve a list of properties as the user has modified them.
|
protected abstract Rectangle2D.Double |
makeAnimationRectangle() |
protected abstract JPanel |
makeCharts() |
protected abstract OTSModelInterface |
makeModel(GTUColorer colorer) |
SimpleSimulatorInterface |
rebuildSimulator(Rectangle rect)
Restart (rebuild) the simulation.
|
void |
stopTimersThreads()
Stop the timers and threads that are connected when disposing of this wrappable simulation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
description, shortName
protected ArrayList<AbstractProperty<?>> properties
protected ArrayList<AbstractProperty<?>> savedUserModifiedProperties
protected boolean exitOnClose
protected OTSAnimationPanel panel
public final SimpleAnimator buildAnimator(org.djunits.value.vdouble.scalar.Time.Abs startTime, org.djunits.value.vdouble.scalar.Time.Rel warmupPeriod, org.djunits.value.vdouble.scalar.Time.Rel runLength, ArrayList<AbstractProperty<?>> userModifiedProperties, Rectangle rect, boolean eoc) throws nl.tudelft.simulation.dsol.SimRuntimeException, NamingException, OTSSimulationException
buildAnimator
in interface WrappableAnimation
startTime
- Time.Abs; the start time of the simulationwarmupPeriod
- Time.Rel; the warm up period of the simulation (use new Time.Rel(0, SECOND) if you don't know what
this is)runLength
- Time.Rel; the duration of the simulationuserModifiedProperties
- ArrayList<AbstractProperty<?>>; the (possibly user-modified) properties. This list must
contain all the properties returned by getProperties(); any additional properties may be ignoredrect
- the x, y, width and height for the window to rebuild. Use null for maximized screen.eoc
- Use EXIT_ON_CLOSE when true, DISPOSE_ON_CLOSE when false on closing of the window.nl.tudelft.simulation.dsol.SimRuntimeException
- on ???NamingException
- when context for the animation cannot be createdOTSSimulationException
- when the construction of the simulation, the control panel, the animation, or the charts
failsprotected abstract JPanel makeCharts() throws OTSSimulationException
OTSSimulationException
- in case the chart, axes or legend cannot be generatedprotected abstract OTSModelInterface makeModel(GTUColorer colorer) throws OTSSimulationException
colorer
- the GTU colorer to use.OTSSimulationException
- in case the construction of the model failsprotected abstract Rectangle2D.Double makeAnimationRectangle()
public final ArrayList<AbstractProperty<?>> getProperties()
getProperties
in interface WrappableAnimation
public final SimpleSimulatorInterface rebuildSimulator(Rectangle rect) throws nl.tudelft.simulation.dsol.SimRuntimeException, NetworkException, NamingException, OTSSimulationException
rebuildSimulator
in interface WrappableAnimation
rect
- the x, y, width and height for the window to rebuild. Use null for maximized screen.nl.tudelft.simulation.dsol.SimRuntimeException
- on ???NetworkException
- on Network inconsistencyNamingException
- when context for the animation cannot be createdOTSSimulationException
- when the (re)construction of the simulation model failspublic final ArrayList<AbstractProperty<?>> getUserModifiedProperties()
getUserModifiedProperties
in interface WrappableAnimation
public void stopTimersThreads()
stopTimersThreads
in interface WrappableAnimation
Copyright © 2014–2016 Delft University of Technology. All rights reserved.