public abstract class AbstractWrappableSimulation extends Object implements WrappableSimulation
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-08-30 00:16:51 +0200 (Sun, 30 Aug 2015) $, @version $Revision: 1329 $, 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 |
---|
AbstractWrappableSimulation() |
Modifier and Type | Method and Description |
---|---|
SimpleAnimator |
buildSimulator(ArrayList<AbstractProperty<?>> userModifiedProperties,
Rectangle rect,
boolean eoc)
Build the simulation.
|
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) |
SimpleSimulation |
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 buildSimulator(ArrayList<AbstractProperty<?>> userModifiedProperties, Rectangle rect, boolean eoc) throws RemoteException, nl.tudelft.simulation.dsol.SimRuntimeException, NamingException
buildSimulator
in interface WrappableSimulation
userModifiedProperties
- 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.RemoteException
- on communications failurenl.tudelft.simulation.dsol.SimRuntimeException
- on ???NamingException
- when context for the animation cannot be createdprotected abstract JPanel makeCharts()
protected abstract OTSModelInterface makeModel(GTUColorer colorer)
colorer
- the GTU colorer to use.protected abstract Rectangle2D.Double makeAnimationRectangle()
public final ArrayList<AbstractProperty<?>> getProperties()
getProperties
in interface WrappableSimulation
public final SimpleSimulation rebuildSimulator(Rectangle rect) throws nl.tudelft.simulation.dsol.SimRuntimeException, RemoteException, NetworkException, NamingException
rebuildSimulator
in interface WrappableSimulation
rect
- the x, y, width and height for the window to rebuild. Use null for maximized screen.nl.tudelft.simulation.dsol.SimRuntimeException
- on ???RemoteException
- on communications failureNetworkException
- on Network inconsistencyNamingException
- when context for the animation cannot be createdpublic final ArrayList<AbstractProperty<?>> getUserModifiedProperties()
getUserModifiedProperties
in interface WrappableSimulation
public void stopTimersThreads()
stopTimersThreads
in interface WrappableSimulation
Copyright © 2014–2015 Delft University of Technology. All rights reserved.