|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgoodies.animation.AnimationFunctions
public final class AnimationFunctions
This class consists only of static methods that construct and operate on
AnimationFunction
s.
AnimationFunction
Nested Class Summary | |
---|---|
static class |
AnimationFunctions.FloatFunction
Helper class that wraps a Float-based animation function to answer floats. |
Field Summary | |
---|---|
static AnimationFunction |
ONE
A constant AnimationFunction that returns
1 all the time. |
static AnimationFunction |
ZERO
A constant AnimationFunction that returns
0.0f all the time. |
Method Summary | |
---|---|
static AnimationFunction |
alphaColor(AnimationFunction f,
Color baseColor)
Creates and returns an animation function that returns time-based sRGB colors that are built from a given base color and an animation function of alpha values. |
static AnimationFunctions.FloatFunction |
asFloat(AnimationFunction f)
Creates a time-based function that wraps the given Float-based animation function to return the corresponding float values. |
static AnimationFunction |
concat(AnimationFunction first,
AnimationFunction second)
Concatenates the fiven animation functions and returns a compound animation function that represents the concatenation. |
static AnimationFunction |
constant(long duration,
Object value)
Creates and returns an animation function that returns a constant value over the given duration. |
static AnimationFunction |
discrete(long duration,
Object[] values)
Creates and returns a discrete animation function for the given duration and values. |
static AnimationFunction |
discrete(long duration,
Object[] values,
float[] keyTimes)
Creates and returns a discrete animation function for the given duration, values and interpolation key times. |
static AnimationFunction |
fromBy(long duration,
float from,
float by)
Creates and returns a linear animation function for the given duration that returns Float in interval [from, from + by]. |
static AnimationFunction |
fromTo(long duration,
float from,
float to)
Ceates and returns a linear animation function with the given duration. |
static AnimationFunction |
linear(long duration,
Object[] values)
Creates and returns a linear animation function that is defined by an array of numeric values; these are distributed equally over the duration. |
static AnimationFunction |
linear(long duration,
Object[] values,
float[] keyTimes)
Creates and returns a linear animation function that is defined by an array of numeric values and an array of relative key times. |
static AnimationFunction |
linearColors(long duration,
Color[] colors,
float[] keyTimes)
Creates an AnimationFunction that maps times
to instances of Color . |
static AnimationFunction |
random(int min,
int max,
float changeProbability)
Creates and returns an animation function that returns random values from the interval [min, max] with a given change probability. |
static AnimationFunction |
repeat(AnimationFunction f,
long repeatTime)
Creates and returns an animation function that is defined by repeating the specified animation function. |
static AnimationFunction |
reverse(AnimationFunction f)
Creates and returns an animation function that is defined by reverting the given animation function in time. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final AnimationFunction ONE
AnimationFunction
that returns
1
all the time.
public static final AnimationFunction ZERO
AnimationFunction
that returns
0.0f
all the time.
Method Detail |
---|
public static AnimationFunction alphaColor(AnimationFunction f, Color baseColor)
Useful for fading effects.
f
- the animation function of alpha valuesbaseColor
- the base color
public static AnimationFunctions.FloatFunction asFloat(AnimationFunction f)
f
- the underlying animation function of floats
public static AnimationFunction concat(AnimationFunction first, AnimationFunction second)
first
- the concatenation's first AnimationFunctionsecond
- the concatenation's second AnimationFunction
public static AnimationFunction constant(long duration, Object value)
duration
- the function's durationvalue
- the Object that will be returned all the time
public static AnimationFunction discrete(long duration, Object[] values)
duration
- the function's durationvalues
- an array of discrete result values
public static AnimationFunction discrete(long duration, Object[] values, float[] keyTimes)
duration
- the function's durationvalues
- an array of discrete result valueskeyTimes
- an array of key times used to distribute the
result values over the time
public static AnimationFunction fromBy(long duration, float from, float by)
duration
- the animation durationfrom
- the initial result valueby
- the difference that is added to the initial value
public static AnimationFunction fromTo(long duration, float from, float to)
duration
- the animation durationfrom
- the initial result valueto
- the last result value
public static AnimationFunction linear(long duration, Object[] values)
duration
- the animation durationvalues
- an array of values
public static AnimationFunction linear(long duration, Object[] values, float[] keyTimes)
duration
- the animation durationvalues
- an array of valueskeyTimes
- an array of key times used to distribute the
result values over the time
public static AnimationFunction linearColors(long duration, Color[] colors, float[] keyTimes)
AnimationFunction
that maps times
to instances of Color
. The mapping is interpolated
from an array of Colors using an array of key times.
duration
- the duration of this animation functioncolors
- the colors to interpolate.keyTimes
- an array of key times used to distribute
the result values over the time.
AnimationFunction
that maps times to sRGB colors.
This mapping is defined by an arry of Color
values
and a corresponding array of key times that is used to interpolate
sub-AnimationFunction for the red, green, blue and alpha values.public static AnimationFunction random(int min, int max, float changeProbability)
min
- the minimum result valuemax
- the maximum result valuechangeProbability
- the probability that the value changes
public static AnimationFunction repeat(AnimationFunction f, long repeatTime)
f
- the animation function to repeatrepeatTime
- the time to repeat the function
public static AnimationFunction reverse(AnimationFunction f)
f
- the animation function to reverse
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |