Class RMKeyTimer

java.lang.Object
javax.swing.Timer
com.inductiveautomation.rm.base.RMKeyTimer
All Implemented Interfaces:
ActionListener, Serializable, EventListener

public class RMKeyTimer extends Timer implements ActionListener
This class provides methods to set values (using RMKey) over time using an interpolator.
See Also:
  • Constructor Details

    • RMKeyTimer

      protected RMKeyTimer(Object anObj, String aKey, Object aValue, long aDuration, float aFrameRate, RMInterpolator anInterpolator)
      Creates a new timer.
  • Method Details

    • setValue

      public static RMKeyTimer setValue(Object anObj, String aKey, Object aValue, long aDuration, float aFrameRate, RMInterpolator anInterpolator)
      Convenience method to create and start a timer.
    • getRecordCount

      public int getRecordCount()
      Returns the number of records in this timer.
    • getRecord

      public RMKeyTimer.Record getRecord(int anIndex)
      Returns the individual record at given index.
    • addRecord

      public void addRecord(RMKeyTimer.Record aRecord)
      Adds a record.
    • removeRecord

      public RMKeyTimer.Record removeRecord(int anIndex)
      Removes the record at given index.
    • addRecord

      public void addRecord(String aKey, Object endValue, RMInterpolator anInterpolator)
      Adds a new key change record. The change is relative to the current value.
    • addRecord

      public void addRecord(String aKey, Object startValue, Object endValue, RMInterpolator anInterpolator)
      Adds a new absolute key change record to the timer.
    • removeRecord

      public void removeRecord(String aKey)
      Deletes any record with given key.
    • start

      public void start()
      Overrides normal start to set start time.
      Overrides:
      start in class Timer
    • stop

      public void stop()
      Overrides to remove from timers list.
      Overrides:
      stop in class Timer
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      ActionListener method - called whenever timer fires.
      Specified by:
      actionPerformed in interface ActionListener