Class OtsSimulationPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
OtsAnimationPanel

public class OtsSimulationPanel extends JPanel
GUI with simulator, console, control panel, status bar, etc.

Copyright (c) 2013-2024 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
See Also:
  • Constructor Details

    • OtsSimulationPanel

      public OtsSimulationPanel(OtsSimulatorInterface simulator, OtsModelInterface otsModel) throws RemoteException
      Construct a panel that looks like the DSOLPanel for quick building of OTS applications.
      Parameters:
      simulator - the simulator or animator of the model.
      otsModel - the model with its properties.
      Throws:
      RemoteException - when communications to a remote machine fails
  • Method Details

    • addConsoleTab

      public final void addConsoleTab()
      Adds the console tab.
    • addPropertiesTab

      public final void addPropertiesTab() throws nl.tudelft.simulation.dsol.model.inputparameters.InputParameterException
      Adds the properties tab.
      Throws:
      nl.tudelft.simulation.dsol.model.inputparameters.InputParameterException - on exception with properties
    • getTabbedPane

      public final TabbedContentPane getTabbedPane()
      Return tabbed pane.
      Returns:
      tabbedPane
    • getSimulator

      public final OtsSimulatorInterface getSimulator()
      Return simulator.
      Returns:
      simulator.
    • getOtsControlPanel

      public final OtsControlPanel getOtsControlPanel()
      Return the OtsControlPanel of this OtsSimulationPanel.
      Returns:
      the OTS control panel
    • getConsole

      public final ConsoleOutput getConsole()
      Return console.
      Returns:
      console
    • getOtsModel

      public final OtsModelInterface getOtsModel()
      Return model.
      Returns:
      otsModel
    • enableSimulationControlButtons

      public void enableSimulationControlButtons()
      Enable the simulation or animation buttons in the GUI. This method HAS TO BE CALLED in order for the buttons to be enabled, because the initial state is DISABLED. Typically, this is done after all tabs, statistics, and other user interface and model components have been constructed and initialized.
    • disableSimulationControlButtons

      public void disableSimulationControlButtons()
      Disable the simulation or animation buttons in the GUI.
    • toString

      public final String toString()
      Overrides:
      toString in class Component