Class OTSWebServer
- java.lang.Object
-
- nl.tudelft.simulation.dsol.jetty.sse.OTSWebServer
-
- All Implemented Interfaces:
Serializable,EventListener,EventListenerInterface
- Direct Known Subclasses:
CircularModelWeb,TJunctionDemo
public abstract class OTSWebServer extends Object implements EventListenerInterface
DSOLWebServer.java.Copyright (c) 2003-2022 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOTSWebServer.XHRHandlerAnswer handles the events from the web-based user interface.
-
Constructor Summary
Constructors Constructor Description OTSWebServer(String title, OTSSimulatorInterface simulator, org.djutils.draw.bounds.Bounds2d extent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HTMLAnimationPanelgetAnimationPanel()OTSSimulatorInterfacegetSimulator()StringgetTitle()voidnotify(EventInterface event)protected voidsetSpeedFactor(double speedFactor)protected booleanstartSimulator()Try to start the simulator, and return whether the simulator has been started.protected booleanstopSimulator()Try to stop the simulator, and return whether the simulator has been stopped.
-
-
-
Constructor Detail
-
OTSWebServer
public OTSWebServer(String title, OTSSimulatorInterface simulator, org.djutils.draw.bounds.Bounds2d extent) throws Exception
- Parameters:
title- String; the title for the model windowsimulator- OTSSimulatorInterface; the simulatorextent- Bounds2d; the extent to use for the graphics (min/max coordinates)- Throws:
Exception- in case jetty crashes
-
-
Method Detail
-
getTitle
public final String getTitle()
- Returns:
- title
-
getSimulator
public final OTSSimulatorInterface getSimulator()
- Returns:
- simulator
-
getAnimationPanel
public final HTMLAnimationPanel getAnimationPanel()
- Returns:
- animationPanel
-
startSimulator
protected boolean startSimulator()
Try to start the simulator, and return whether the simulator has been started.- Returns:
- whether the simulator has been started or not
-
stopSimulator
protected boolean stopSimulator()
Try to stop the simulator, and return whether the simulator has been stopped.- Returns:
- whether the simulator has been stopped or not
-
setSpeedFactor
protected void setSpeedFactor(double speedFactor)
- Parameters:
speedFactor- double; the new speed factor
-
notify
public void notify(EventInterface event) throws RemoteException
- Specified by:
notifyin interfaceEventListenerInterface- Throws:
RemoteException
-
-