Class OtsWebServer
java.lang.Object
nl.tudelft.simulation.dsol.jetty.sse.OtsWebServer
- All Implemented Interfaces:
Serializable
,Remote
,EventListener
,org.djutils.event.EventListener
- Direct Known Subclasses:
CircularModelWeb
,TJunctionDemo
DSOLWebServer.java.
Copyright (c) 2003-2024 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:
-
Nested Class Summary
Modifier and TypeClassDescription(package private) class
Handle in separate thread to avoid 'lock' of the main application.static class
Answer handles the events from the web-based user interface. -
Constructor Summary
ConstructorDescriptionOtsWebServer
(String title, org.opentrafficsim.core.dsol.OtsSimulatorInterface simulator, org.djutils.draw.bounds.Bounds2d extent) -
Method Summary
Modifier and TypeMethodDescriptionfinal HtmlAnimationPanel
final org.opentrafficsim.core.dsol.OtsSimulatorInterface
final String
getTitle()
void
notify
(org.djutils.event.Event event) protected void
setSpeedFactor
(double speedFactor) protected boolean
Try to start the simulator, and return whether the simulator has been started.protected boolean
Try to stop the simulator, and return whether the simulator has been stopped.
-
Constructor Details
-
OtsWebServer
public OtsWebServer(String title, org.opentrafficsim.core.dsol.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 Details
-
getTitle
- Returns:
- title
-
getSimulator
public final org.opentrafficsim.core.dsol.OtsSimulatorInterface getSimulator()- Returns:
- simulator
-
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
- Specified by:
notify
in interfaceorg.djutils.event.EventListener
- Throws:
RemoteException
-