public class OTSWebModel extends Object implements nl.tudelft.simulation.event.EventListenerInterface
| Constructor and Description |
|---|
OTSWebModel(String title,
OTSSimulatorInterface simulator) |
| Modifier and Type | Method and Description |
|---|---|
HTMLAnimationPanel |
getAnimationPanel() |
OTSSimulatorInterface |
getSimulator() |
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.
|
boolean |
isKilled() |
void |
notify(nl.tudelft.simulation.event.EventInterface event) |
void |
setKilled(boolean killed) |
protected void |
setSpeedFactor(double speedFactor) |
protected boolean |
startSimulator()
Try to start the simulator, and return whether the simulator has been started.
|
protected boolean |
stopSimulator()
Try to stop the simulator, and return whether the simulator has been stopped.
|
public OTSWebModel(String title, OTSSimulatorInterface simulator) throws Exception
title - String; the title for the model windowsimulator - SimulatorInterface<?,?,?>; the simulatorException - in case jetty crashespublic final String getTitle()
public final OTSSimulatorInterface getSimulator()
public final HTMLAnimationPanel getAnimationPanel()
public final boolean isKilled()
public final void setKilled(boolean killed)
killed - set killedprotected boolean startSimulator()
protected boolean stopSimulator()
protected void setSpeedFactor(double speedFactor)
speedFactor - double; the new speed factorpublic void notify(nl.tudelft.simulation.event.EventInterface event)
throws RemoteException
notify in interface nl.tudelft.simulation.event.EventListenerInterfaceRemoteExceptionpublic 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
target - tbaseRequest - brrequest - rresponse - reIOException - on errorjavax.servlet.ServletException - on errorCopyright © 2014–2019 Delft University of Technology. All rights reserved.