Class OTSSwingApplication<T extends org.opentrafficsim.core.dsol.OTSModelInterface>

    • Field Detail

      • DEFAULT_COLORER

        public static final org.opentrafficsim.core.animation.gtu.colorer.GTUColorer DEFAULT_COLORER
        Single instance of default colorer, reachable from various places.
      • closed

        protected boolean closed
        whether the application has been closed or not.
      • frameProperties

        protected Properties frameProperties
        Properties for the frame appearance (not simulation related).
    • Constructor Detail

      • OTSSwingApplication

        public OTSSwingApplication​(T model,
                                   JPanel panel)
        Wrap an OTSModel in a JFrame. Uses a default GTU colorer.
        Parameters:
        model - T; the model that will be shown in the JFrame
        panel - JPanel; this should be the JPanel of the simulation
    • Method Detail

      • setAppearance

        public void setAppearance​(Appearance appearance)
        Sets an appearance.
        Parameters:
        appearance - Appearance; appearance
      • getAppearance

        public Appearance getAppearance()
        Returns the appearance.
        Returns:
        Appearance; appearance
      • makeAnimationRectangle

        protected Rectangle2D makeAnimationRectangle()
        Return the initial 'home' extent for the animation. The 'Home' button returns to this extent. Override this method when a smaller or larger part of the infra should be shown. In the default setting, all currently visible objects are shown.
        Returns:
        the initial and 'home' rectangle for the animation.
      • setExitOnClose

        public final void setExitOnClose​(boolean exitOnClose)
        Parameters:
        exitOnClose - boolean; set exitOnClose
      • isClosed

        public final boolean isClosed()
        Returns:
        closed
      • getModel

        public final T getModel()
        Returns:
        model