|
||||||||||
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.InterpolationMode
|
Field Summary | |
---|---|
static AnimationFunction<Float> |
ONE
A constant AnimationFunction that returns
1f all the time. |
static AnimationFunction<Float> |
ZERO
A constant AnimationFunction that returns
0f all the time. |
Method Summary | ||
---|---|---|
static AnimationFunction<Color> |
alphaColor(AnimationFunction<Integer> 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
|
concat(AnimationFunction<T>... functions)
Concatenates the given animation functions and returns a compound animation function that represents the concatenation. |
|
static
|
constant(long duration,
T value)
Creates and returns an animation function that returns a constant value over the given duration. |
|
static
|
discrete(long duration,
T... values)
Creates and returns a discrete animation function for the given duration and values. |
|
static
|
discrete(long duration,
T[] values,
float[] keyTimes)
Creates and returns a discrete animation function for the given duration, values and interpolation key times. |
|
static AnimationFunction<Float> |
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<Float> |
fromTo(long duration,
float from,
float to)
Creates and returns a linear animation function with the given duration. |
|
static
|
linear(long duration,
T[] 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
|
linear(long duration,
T[] 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<Color> |
linearColors(long duration,
Color[] colors,
float[] keyTimes)
Creates an AnimationFunction that maps times
to instances of Color . |
|
static AnimationFunction<Integer> |
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
|
repeat(AnimationFunction<T> f,
long repeatTime)
Creates and returns an animation function that is defined by repeating the specified animation function. |
|
static
|
reverse(AnimationFunction<T> 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<Float> ONE
AnimationFunction
that returns
1f
all the time.
public static final AnimationFunction<Float> ZERO
AnimationFunction
that returns
0f
all the time.
Method Detail |
---|
public static AnimationFunction<Color> alphaColor(AnimationFunction<Integer> f, Color baseColor)
Useful for fading effects.
f
- the animation function of alpha valuesbaseColor
- the base color
public static <T> AnimationFunction<T> concat(AnimationFunction<T>... functions)
functions
- the animation functions to concatenate
public static <T> AnimationFunction<T> constant(long duration, T value)
duration
- the function's durationvalue
- the Object that will be returned all the time
public static <T> AnimationFunction<T> discrete(long duration, T... values)
duration
- the function's durationvalues
- an array of discrete result values
public static <T> AnimationFunction<T> discrete(long duration, T[] 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<Float> 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<Float> fromTo(long duration, float from, float to)
duration
- the animation durationfrom
- the initial result valueto
- the last result value
public static <T extends Number> AnimationFunction<T> linear(long duration, T[] values)
duration
- the animation durationvalues
- an array of values
public static <T extends Number> AnimationFunction<T> linear(long duration, T[] 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<Color> 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 array 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<Integer> random(int min, int max, float changeProbability)
min
- the minimum result valuemax
- the maximum result valuechangeProbability
- the probability that the value changes
public static <T> AnimationFunction<T> repeat(AnimationFunction<T> f, long repeatTime)
f
- the animation function to repeatrepeatTime
- the time to repeat the function
public static <T> AnimationFunction<T> reverse(AnimationFunction<T> f)
f
- the animation function to reverse
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |