Class OtsWebModel
java.lang.Object
nl.tudelft.simulation.dsol.jetty.sse.OtsWebModel
- All Implemented Interfaces:
Serializable
,Remote
,EventListener
,org.djutils.event.EventListener
OtsWebModel.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:
-
Constructor Summary
ConstructorDescriptionOtsWebModel
(String title, org.opentrafficsim.core.dsol.OtsSimulatorInterface simulator) -
Method Summary
Modifier and TypeMethodDescriptionfinal HtmlAnimationPanel
final org.opentrafficsim.core.dsol.OtsSimulatorInterface
final String
getTitle()
void
handle
(String target, org.eclipse.jetty.server.Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Delegate handle method from the main web server for this particular model.final boolean
isKilled()
void
notify
(org.djutils.event.Event event) final void
setKilled
(boolean killed) 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
-
Method Details
-
getTitle
- Returns:
- title
-
getSimulator
public final org.opentrafficsim.core.dsol.OtsSimulatorInterface getSimulator()- Returns:
- simulator
-
getAnimationPanel
- Returns:
- animationPanel
-
isKilled
public final boolean isKilled()- Returns:
- killed
-
setKilled
public final void setKilled(boolean killed) - Parameters:
killed
- boolean; set killed
-
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
-
handle
public void handle(String target, org.eclipse.jetty.server.Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException Delegate handle method from the main web server for this particular model.- Parameters:
target
- String; tbaseRequest
- Request; brrequest
- HttpServletRequest; rresponse
- HttpServletResponse; re- Throws:
IOException
- on errorjavax.servlet.ServletException
- on error
-