public abstract class AbstractWrappableAnimation extends Object implements WrappableAnimation, Serializable
Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2016-10-28 16:34:11 +0200 (Fri, 28 Oct 2016) $, @version $Revision: 2429 $, by $Author: pknoppers $,
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 List<org.opentrafficsim.base.modelproperties.Property<?>> |
properties
The properties exhibited by this simulation.
|
protected List<org.opentrafficsim.base.modelproperties.Property<?>> |
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 startTime,
org.djunits.value.vdouble.scalar.Duration warmupPeriod,
org.djunits.value.vdouble.scalar.Duration runLength,
List<org.opentrafficsim.base.modelproperties.Property<?>> userModifiedProperties,
Rectangle rect,
boolean eoc)
Build the animation.
|
protected SimpleAnimator |
buildSimpleAnimator(org.djunits.value.vdouble.scalar.Time startTime,
org.djunits.value.vdouble.scalar.Duration warmupPeriod,
org.djunits.value.vdouble.scalar.Duration runLength,
OTSModelInterface model)
Build the animator.
|
OTSAnimationPanel |
getPanel() |
ArrayList<org.opentrafficsim.base.modelproperties.Property<?>> |
getProperties()
Retrieve a list of visible properties of the simulation.
|
List<org.opentrafficsim.base.modelproperties.Property<?>> |
getUserModifiedProperties()
Retrieve a list of properties as the user has modified them.
|
protected abstract Rectangle2D.Double |
makeAnimationRectangle() |
protected abstract JPanel |
makeCharts(SimpleSimulatorInterface simulator)
Make the chart panel.
|
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 List<org.opentrafficsim.base.modelproperties.Property<?>> properties
protected List<org.opentrafficsim.base.modelproperties.Property<?>> savedUserModifiedProperties
protected boolean exitOnClose
protected OTSAnimationPanel panel
protected SimpleAnimator buildSimpleAnimator(org.djunits.value.vdouble.scalar.Time startTime, org.djunits.value.vdouble.scalar.Duration warmupPeriod, org.djunits.value.vdouble.scalar.Duration runLength, OTSModelInterface model) throws nl.tudelft.simulation.dsol.SimRuntimeException, NamingException, org.opentrafficsim.base.modelproperties.PropertyException
startTime
- Time; the start timewarmupPeriod
- Duration; the warm up periodrunLength
- Duration; the duration of the simulation / animationmodel
- OTSModelInterface; the simulation modelnl.tudelft.simulation.dsol.SimRuntimeException
- on ???NamingException
- when context for the animation cannot be createdorg.opentrafficsim.base.modelproperties.PropertyException
- when one of the user modified properties has the empty string as keypublic SimpleAnimator buildAnimator(org.djunits.value.vdouble.scalar.Time startTime, org.djunits.value.vdouble.scalar.Duration warmupPeriod, org.djunits.value.vdouble.scalar.Duration runLength, List<org.opentrafficsim.base.modelproperties.Property<?>> userModifiedProperties, Rectangle rect, boolean eoc) throws nl.tudelft.simulation.dsol.SimRuntimeException, NamingException, OTSSimulationException, org.opentrafficsim.base.modelproperties.PropertyException
buildAnimator
in interface WrappableAnimation
startTime
- Time; the start time of the simulationwarmupPeriod
- Duration; the warm up period of the simulation (use new Duration(0, SECOND) if you don't know what
this is)runLength
- Duration; the duration of the simulationuserModifiedProperties
- List<Property<?>>; 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
failsorg.opentrafficsim.base.modelproperties.PropertyException
- when one of the user modified properties has the empty string as keyprotected abstract JPanel makeCharts(SimpleSimulatorInterface simulator) throws OTSSimulationException, org.opentrafficsim.base.modelproperties.PropertyException
simulator
- SimpleSimulatorInterface; the simulatorOTSSimulationException
- in case the chart, axes or legend cannot be generatedorg.opentrafficsim.base.modelproperties.PropertyException
- when one of the user modified properties has the empty string as keyprotected 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<org.opentrafficsim.base.modelproperties.Property<?>> getProperties()
getProperties
in interface WrappableAnimation
public final SimpleSimulatorInterface rebuildSimulator(Rectangle rect) throws nl.tudelft.simulation.dsol.SimRuntimeException, NetworkException, NamingException, OTSSimulationException, org.opentrafficsim.base.modelproperties.PropertyException
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 failsorg.opentrafficsim.base.modelproperties.PropertyException
- when one of the user modified properties has the empty string as keypublic final List<org.opentrafficsim.base.modelproperties.Property<?>> getUserModifiedProperties()
getUserModifiedProperties
in interface WrappableAnimation
public void stopTimersThreads()
stopTimersThreads
in interface WrappableAnimation
public final OTSAnimationPanel getPanel()
Copyright © 2014–2016 Delft University of Technology. All rights reserved.