Class OtsSimulationControlPanel

All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible, EventListener

public class OtsSimulationControlPanel extends JPanel implements ActionListener, PropertyChangeListener, EventListener
Peter's and Wouter's improved simulation control panel.

Copyright (c) 2013-2026 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
See Also:
  • Constructor Details

    • OtsSimulationControlPanel

      public OtsSimulationControlPanel(OtsSimulatorInterface simulator, OtsSimulationPanel otsAnimationPanel) throws RemoteException
      Decorate a SimpleSimulator with a different set of control buttons.
      Parameters:
      simulator - the simulator
      otsAnimationPanel - the OTS animation panel
      Throws:
      RemoteException - when simulator cannot be accessed for listener attachment
  • Method Details

    • setSpeedFactor

      public void setSpeedFactor(double factor)
      Set the time warp factor to the best possible approximation of a given value.
      Parameters:
      factor - the requested speed factor
    • setSimulationControlButtons

      public void setSimulationControlButtons(boolean newState)
      Change the enabled/disabled state of the various simulation control buttons.
      Parameters:
      newState - true if the buttons should become enabled; false if the buttons should become disabled
    • actionPerformed

      public void actionPerformed(ActionEvent actionEvent)
      Specified by:
      actionPerformed in interface ActionListener
    • autoPauseSimulator

      public void autoPauseSimulator()
      Pause the simulator.
    • propertyChange

      public void propertyChange(PropertyChangeEvent evt)
      Specified by:
      propertyChange in interface PropertyChangeListener
    • getSimulator

      public OtsSimulatorInterface getSimulator()
      Return simulator.
      Returns:
      simulator
    • getTimeFont

      public Font getTimeFont()
      Return time font.
      Returns:
      font for the time display
    • notify

      public void notify(Event event)
      Specified by:
      notify in interface EventListener
    • toString

      public String toString()
      Overrides:
      toString in class Component