Package com.inductiveautomation.rm.base
Class RMKeyTimer
java.lang.Object
javax.swing.Timer
com.inductiveautomation.rm.base.RMKeyTimer
- All Implemented Interfaces:
ActionListener
,Serializable
,EventListener
This class provides methods to set values (using RMKey) over time using an interpolator.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A class representing an individual change to be animated by this timer. -
Field Summary
Fields inherited from class javax.swing.Timer
listenerList
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
RMKeyTimer
(Object anObj, String aKey, Object aValue, long aDuration, float aFrameRate, RMInterpolator anInterpolator) Creates a new timer. -
Method Summary
Modifier and TypeMethodDescriptionvoid
ActionListener method - called whenever timer fires.void
addRecord
(RMKeyTimer.Record aRecord) Adds a record.void
addRecord
(String aKey, Object endValue, RMInterpolator anInterpolator) Adds a new key change record.void
addRecord
(String aKey, Object startValue, Object endValue, RMInterpolator anInterpolator) Adds a new absolute key change record to the timer.getRecord
(int anIndex) Returns the individual record at given index.int
Returns the number of records in this timer.removeRecord
(int anIndex) Removes the record at given index.void
removeRecord
(String aKey) Deletes any record with given key.static RMKeyTimer
setValue
(Object anObj, String aKey, Object aValue, long aDuration, float aFrameRate, RMInterpolator anInterpolator) Convenience method to create and start a timer.void
start()
Overrides normal start to set start time.void
stop()
Overrides to remove from timers list.Methods inherited from class javax.swing.Timer
addActionListener, fireActionPerformed, getActionCommand, getActionListeners, getDelay, getInitialDelay, getListeners, getLogTimers, isCoalesce, isRepeats, isRunning, removeActionListener, restart, setActionCommand, setCoalesce, setDelay, setInitialDelay, setLogTimers, setRepeats
-
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
Returns the individual record at given index. -
addRecord
Adds a record. -
removeRecord
Removes the record at given index. -
addRecord
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
Deletes any record with given key. -
start
public void start()Overrides normal start to set start time. -
stop
public void stop()Overrides to remove from timers list. -
actionPerformed
ActionListener method - called whenever timer fires.- Specified by:
actionPerformed
in interfaceActionListener
-