View Javadoc
1   package nl.tudelft.simulation.dsol.swing.gui.animation;
2   
3   import nl.tudelft.simulation.dsol.animation.Locatable;
4   
5   /**
6    * 
7    * Helper class to set the animation toggles for the animation panel. Code based on OpenTrafficSim project component with the same
8    * purpose.
9    * <p>
10   * Copyright (c) 2020-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See
11   * for project information <a href="https://simulation.tudelft.nl/dsol/manual/" target="_blank">DSOL Manual</a>. The DSOL
12   * project is distributed under a three-clause BSD-style license, which can be found at
13   * <a href="https://https://simulation.tudelft.nl/dsol/docs/latest/license.html" target="_blank">DSOL License</a>.
14   * </p>
15   * @author <a href="https://www.tudelft.nl/averbraeck">Alexander Verbraeck</a>
16   * @author <a href="http://www.transport.citg.tudelft.nl">Wouter Schakel</a>
17   */
18  public final class AnimationToggles
19  {
20      /**
21       * Do not instantiate this class.
22       */
23      private AnimationToggles()
24      {
25          // static class.
26      }
27  
28      /**
29       * Set a class to be shown in the animation to true.
30       * @param panel DsolAnimationPanel; the DsolAnimationPanel where the animation of a class has to be switched off
31       * @param locatableClass Class&lt;? extends Locatable&gt;; the class for which the animation has to be shown.
32       */
33      public static void showAnimationClass(final DsolAnimationTab panel, final Class<? extends Locatable> locatableClass)
34      {
35          panel.getAnimationPanel().showClass(locatableClass);
36          panel.updateAnimationClassCheckBox(locatableClass);
37      }
38  
39      /**
40       * Set a class to be shown in the animation to false.
41       * @param panel DsolAnimationPanel; the DsolAnimationPanel where the animation of a class has to be switched off
42       * @param locatableClass Class&lt;? extends Locatable&gt;; the class for which the animation has to be shown.
43       */
44      public static void hideAnimationClass(final DsolAnimationTab panel, final Class<? extends Locatable> locatableClass)
45      {
46          panel.getAnimationPanel().hideClass(locatableClass);
47          panel.updateAnimationClassCheckBox(locatableClass);
48      }
49  
50  }