Class OtsControlPanel.ClockLabel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants, nl.tudelft.simulation.dsol.swing.gui.appearance.AppearanceControl, AppearanceControl
Enclosing class:
OtsControlPanel

public class OtsControlPanel.ClockLabel extends JLabel implements AppearanceControl
JLabel that displays the simulation time.
See Also:
  • Constructor Details

    • ClockLabel

      ClockLabel(JLabel speedLabel)
      Construct a clock panel.
      Parameters:
      speedLabel - JLabel; speed label
  • Method Details

    • cancelTimer

      public void cancelTimer()
      Cancel the timer task.
    • getSpeedLabel

      protected JLabel getSpeedLabel()
      Returns:
      speedLabel.
    • getSpeed

      protected double getSpeed(double t)
      Returns the simulation speed.
      Parameters:
      t - double; simulation time
      Returns:
      simulation speed
    • isForeground

      public boolean isForeground()
      Specified by:
      isForeground in interface nl.tudelft.simulation.dsol.swing.gui.appearance.AppearanceControl
    • getFontSize

      public Integer getFontSize()
      Returns the font size. May be null to ignore font size.
      Specified by:
      getFontSize in interface AppearanceControl
      Returns:
      Integer; font size, may be null to ignore font size from appearance.
    • toString

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