Class OtsControlPanel.TimeWarpPanel

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.opentrafficsim.swing.gui.OtsControlPanel.TimeWarpPanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Enclosing class:
OtsControlPanel

class OtsControlPanel.TimeWarpPanel extends JPanel
JPanel that contains a JSider that uses a logarithmic scale.
  • Constructor Details

    • TimeWarpPanel

      TimeWarpPanel(double minimum, double maximum, double initialValue, int ticksPerDecade, org.opentrafficsim.core.dsol.OtsSimulatorInterface simulator)
      Construct a new TimeWarpPanel.
      Parameters:
      minimum - double; the minimum value on the scale (the displayed scale may extend a little further than this value)
      maximum - double; the maximum value on the scale (the displayed scale may extend a little further than this value)
      initialValue - double; the initially selected value on the scale
      ticksPerDecade - int; the number of steps per decade
      simulator - DevsSimulatorInterface<?, ?, ?>; the simulator to change the speed of
  • Method Details

    • getTickValues

      protected Map<Integer,Double> getTickValues()
      Access to tickValues map from within the event handler.
      Returns:
      Map<Integer, Double> the tickValues map of this TimeWarpPanel
    • getFactor

      public final double getFactor()
      Retrieve the current TimeWarp factor.
      Returns:
      double; the current TimeWarp factor
    • toString

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

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