Package com.inductiveautomation.rm.base
Class RMKeyTimer
- java.lang.Object
-
- javax.swing.Timer
-
- com.inductiveautomation.rm.base.RMKeyTimer
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.util.EventListener
public class RMKeyTimer extends javax.swing.Timer implements java.awt.event.ActionListener
This class provides methods to set values (using RMKey) over time using an interpolator.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RMKeyTimer.Record
A class representing an individual change to be animated by this timer.
-
Constructor Summary
Constructors Modifier Constructor Description protected
RMKeyTimer(java.lang.Object anObj, java.lang.String aKey, java.lang.Object aValue, long aDuration, float aFrameRate, RMInterpolator anInterpolator)
Creates a new timer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
ActionListener method - called whenever timer fires.void
addRecord(RMKeyTimer.Record aRecord)
Adds a record.void
addRecord(java.lang.String aKey, java.lang.Object endValue, RMInterpolator anInterpolator)
Adds a new key change record.void
addRecord(java.lang.String aKey, java.lang.Object startValue, java.lang.Object endValue, RMInterpolator anInterpolator)
Adds a new absolute key change record to the timer.RMKeyTimer.Record
getRecord(int anIndex)
Returns the individual record at given index.int
getRecordCount()
Returns the number of records in this timer.RMKeyTimer.Record
removeRecord(int anIndex)
Removes the record at given index.void
removeRecord(java.lang.String aKey)
Deletes any record with given key.static RMKeyTimer
setValue(java.lang.Object anObj, java.lang.String aKey, java.lang.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 Detail
-
RMKeyTimer
protected RMKeyTimer(java.lang.Object anObj, java.lang.String aKey, java.lang.Object aValue, long aDuration, float aFrameRate, RMInterpolator anInterpolator)
Creates a new timer.
-
-
Method Detail
-
setValue
public static RMKeyTimer setValue(java.lang.Object anObj, java.lang.String aKey, java.lang.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(java.lang.String aKey, java.lang.Object endValue, RMInterpolator anInterpolator)
Adds a new key change record. The change is relative to the current value.
-
addRecord
public void addRecord(java.lang.String aKey, java.lang.Object startValue, java.lang.Object endValue, RMInterpolator anInterpolator)
Adds a new absolute key change record to the timer.
-
removeRecord
public void removeRecord(java.lang.String aKey)
Deletes any record with given key.
-
start
public void start()
Overrides normal start to set start time.- Overrides:
start
in classjavax.swing.Timer
-
stop
public void stop()
Overrides to remove from timers list.- Overrides:
stop
in classjavax.swing.Timer
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
ActionListener method - called whenever timer fires.- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
-
-