Class RMInterpolator
- java.lang.Object
- 
- com.inductiveautomation.rm.graphics.RMInterpolator
 
- 
- All Implemented Interfaces:
- java.lang.Cloneable
 - Direct Known Subclasses:
- RMInterpolator.Bounce,- RMInterpolator.Periodic
 
 public class RMInterpolator extends java.lang.Object implements java.lang.CloneableThis class provides functionality to interpolate between two numbers given a ratio between 0-1.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classRMInterpolator.BounceParameterizable bounce interpolator class.static classRMInterpolator.Directionstatic classRMInterpolator.PeriodicAn Interpolator subclass that can be used for periodic (ie looping) motion.
 - 
Field SummaryFields Modifier and Type Field Description static RMInterpolatorBOUNCEBounce interpolator.static RMInterpolatorEASE_BOTHEase Both interpolator.static RMInterpolatorEASE_BOTH_CUBICEase Both interpolator.static RMInterpolatorEASE_INEase In interpolator.static RMInterpolatorEASE_IN_CUBICEase In interpolator.static RMInterpolatorEASE_OUTEase Out interpolator.static RMInterpolatorEASE_OUT_CUBICEase Out interpolator.static RMInterpolatorLINEARLinear interpolator.static RMInterpolatorONE_SHOTOne Shot interpolator.static RMInterpolatorRANDOMRandom interpolator.
 - 
Constructor SummaryConstructors Constructor Description RMInterpolator()Creates a new interpolator.RMInterpolator(RMInterpolator.Direction aDirection)Creates a new interpolator with given direction.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RMInterpolatorclone()Standard clone implementation.RMInterpolator.DirectiongetDirection()Returns the interpolator direction.static RMInterpolatorgetInterpolator(int anIndex)Returns the individual common interpolator at given index.static RMInterpolatorgetInterpolator(java.lang.String aName)Returns a shared interpolator for given name.static intgetInterpolatorCount()Returns number of shared common interpolators.java.lang.StringgetName()Returns the name of this interpolator.static RMInterpolatorgetNewInterpolator(java.lang.String aName)Returns a new interpolator instance for a given name.doublegetRatio(double aRatio)Returns a new ratio given normal ratio.doublegetValue(double aRatio)Returns an interpolated value for 0 & 1 given a ratio.doublegetValue(double aRatio, double aStart, double anEnd)Returns a value given a ratio and start/end values.doubleinterpolate(double aRatio, double aStart, double aEnd)Direction In interpolation.doubleinterpolateBoth(double aRatio, double aStart, double anEnd)Direction Both interpolation.doubleinterpolateOut(double aRatio, double aStart, double aEnd)Direction Out interpolation.booleanisShared()Returns true if there's only a single shared instance of this interpolator.java.lang.StringtoString()Returns a string representation of this interpolator.
 
- 
- 
- 
Field Detail- 
LINEARpublic static RMInterpolator LINEAR Linear interpolator.
 - 
EASE_INpublic static RMInterpolator EASE_IN Ease In interpolator.
 - 
EASE_OUTpublic static RMInterpolator EASE_OUT Ease Out interpolator.
 - 
EASE_BOTHpublic static RMInterpolator EASE_BOTH Ease Both interpolator.
 - 
EASE_IN_CUBICpublic static RMInterpolator EASE_IN_CUBIC Ease In interpolator.
 - 
EASE_OUT_CUBICpublic static RMInterpolator EASE_OUT_CUBIC Ease Out interpolator.
 - 
EASE_BOTH_CUBICpublic static RMInterpolator EASE_BOTH_CUBIC Ease Both interpolator.
 - 
RANDOMpublic static RMInterpolator RANDOM Random interpolator. Object will get a random value at every frame, bounded by the start & end values.
 - 
BOUNCEpublic static RMInterpolator BOUNCE Bounce interpolator.
 - 
ONE_SHOTpublic static RMInterpolator ONE_SHOT One Shot interpolator.
 
- 
 - 
Constructor Detail- 
RMInterpolatorpublic RMInterpolator() Creates a new interpolator.
 - 
RMInterpolatorpublic RMInterpolator(RMInterpolator.Direction aDirection) Creates a new interpolator with given direction.
 
- 
 - 
Method Detail- 
getInterpolatorpublic static RMInterpolator getInterpolator(java.lang.String aName) Returns a shared interpolator for given name.
 - 
getNewInterpolatorpublic static RMInterpolator getNewInterpolator(java.lang.String aName) Returns a new interpolator instance for a given name.
 - 
getDirectionpublic RMInterpolator.Direction getDirection() Returns the interpolator direction.
 - 
getValuepublic double getValue(double aRatio) Returns an interpolated value for 0 & 1 given a ratio.
 - 
getValuepublic double getValue(double aRatio, double aStart, double anEnd)Returns a value given a ratio and start/end values.
 - 
getRatiopublic double getRatio(double aRatio) Returns a new ratio given normal ratio.
 - 
interpolatepublic double interpolate(double aRatio, double aStart, double aEnd)Direction In interpolation.
 - 
interpolateOutpublic double interpolateOut(double aRatio, double aStart, double aEnd)Direction Out interpolation.
 - 
interpolateBothpublic double interpolateBoth(double aRatio, double aStart, double anEnd)Direction Both interpolation.
 - 
getNamepublic java.lang.String getName() Returns the name of this interpolator.
 - 
toStringpublic java.lang.String toString() Returns a string representation of this interpolator.- Overrides:
- toStringin class- java.lang.Object
 
 - 
isSharedpublic boolean isShared() Returns true if there's only a single shared instance of this interpolator.
 - 
clonepublic RMInterpolator clone() Standard clone implementation.- Overrides:
- clonein class- java.lang.Object
 
 - 
getInterpolatorCountpublic static int getInterpolatorCount() Returns number of shared common interpolators.
 - 
getInterpolatorpublic static RMInterpolator getInterpolator(int anIndex) Returns the individual common interpolator at given index.
 
- 
 
-