Class OTSControlPanel

    • Field Detail

      • closeHandlerRegistered

        protected boolean closeHandlerRegistered
        Has the window close handler been registered?
    • Constructor Detail

      • OTSControlPanel

        public OTSControlPanel​(org.opentrafficsim.core.dsol.OTSSimulatorInterface simulator,
                               org.opentrafficsim.core.dsol.OTSModelInterface model,
                               OTSAnimationPanel otsAnimationPanel)
                        throws RemoteException
        Decorate a SimpleSimulator with a different set of control buttons.
        Parameters:
        simulator - OTSSimulatorInterface; the simulator
        model - OTSModelInterface; if non-null, the restart button should work
        otsAnimationPanel - OTSAnimationPanel; the OTS animation panel
        Throws:
        RemoteException - when simulator cannot be accessed for listener attachment
    • Method Detail

      • setSimulationControlButtons

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

        public OTSSearchPanel getOtsSearchPanel()
        Provide access to the search panel.
        Returns:
        OTSSearchPanel; the OTS search panel
      • loadIcon

        public static final Icon loadIcon​(String iconPath)
        Attempt to load and return an icon.
        Parameters:
        iconPath - String; the path that is used to load the icon
        Returns:
        Icon; or null if loading failed
      • loadGrayscaleIcon

        public static final Icon loadGrayscaleIcon​(String iconPath)
        Attempt to load and return an icon, which will be made gray-scale.
        Parameters:
        iconPath - String; the path that is used to load the icon
        Returns:
        Icon; or null if loading failed
      • installWindowCloseHandler

        public final void installWindowCloseHandler()
        Install a handler for the window closed event that stops the simulator (if it is running).
      • fixButtons

        protected final void fixButtons()
        Update the enabled state of all the buttons.
      • autoPauseSimulator

        public final void autoPauseSimulator()
        Pause the simulator.
      • getSimulator

        public final org.opentrafficsim.core.dsol.OTSSimulatorInterface getSimulator()
        Returns:
        simulator.
      • getTimeFont

        public final Font getTimeFont()
        Returns:
        timeFont.