Package nl.tudelft.simulation.dsol.web
Class DSOLWebModel
- java.lang.Object
-
- nl.tudelft.simulation.dsol.web.DSOLWebModel
-
- All Implemented Interfaces:
Serializable,Remote,EventListener,EventListener
public class DSOLWebModel extends Object implements EventListener
OTSWebModel.java.
Copyright (c) 2003-2023 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl. The source code and binary code of this software is proprietary information of Delft University of Technology.- Author:
- Alexander Verbraeck
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DSOLWebModel(String title, SimulatorInterface<?> simulator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HTMLAnimationPanelgetAnimationPanel()SimulatorInterface<?>getSimulator()StringgetTitle()voidhandle(String target, org.eclipse.jetty.server.Request baseRequest, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)Delegate handle method from the main web server for this particular model.voidnotify(Event 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
-
DSOLWebModel
public DSOLWebModel(String title, SimulatorInterface<?> simulator) throws Exception
- Parameters:
title- String; the title for the model windowsimulator- SimulatorInterface<?,?,?>; the simulator- Throws:
Exception- in case jetty crashes
-
-
Method Detail
-
getTitle
public String getTitle()
- Returns:
- title
-
getSimulator
public SimulatorInterface<?> getSimulator()
- Returns:
- simulator
-
getAnimationPanel
public 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(Event event) throws RemoteException
- Specified by:
notifyin interfaceEventListener- Throws:
RemoteException
-
handle
public void handle(String target, org.eclipse.jetty.server.Request baseRequest, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException, jakarta.servlet.ServletException
Delegate handle method from the main web server for this particular model.- Parameters:
target- tbaseRequest- brrequest- rresponse- re- Throws:
IOException- on errorjakarta.servlet.ServletException- on error
-
-