Class OTSWebModel

    • Constructor Detail

      • OTSWebModel

        public OTSWebModel​(String title,
                           OTSSimulatorInterface simulator)
                    throws Exception
        Parameters:
        title - String; the title for the model window
        simulator - SimulatorInterface<?,?,?>; the simulator
        Throws:
        Exception - in case jetty crashes
    • Method Detail

      • getTitle

        public final String getTitle()
        Returns:
        title
      • getAnimationPanel

        public final HTMLAnimationPanel getAnimationPanel()
        Returns:
        animationPanel
      • isKilled

        public final boolean isKilled()
        Returns:
        killed
      • setKilled

        public final void setKilled​(boolean killed)
        Parameters:
        killed - 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
      • 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 - t
        baseRequest - br
        request - r
        response - re
        Throws:
        IOException - on error
        javax.servlet.ServletException - on error