Easing interpolates a tick across multiple rendered frames over a fixed duration,
producing a smooth animation rather than an instant jump. Whether easing is applied
to a given tick is determined by shouldEase(int), which compares the tick
amount against the configured threshold. The default values are:
Default values:
EasingFunction#EASE_OUT_QUAD500205The per-frame delay is derived from durationMs / frames and is available
via getFrameDelayMs().
This class is immutable and thread-safe. EasingConfigurationBuilder is
not thread-safe.
Example:
EasingConfiguration easing = EasingConfiguration.builder()
.function(EasingFunction.EASE_IN_OUT_CUBIC)
.duration(300)
.frames(15)
.threshold(10)
.build();
| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| public static final EasingConfiguration | DEFAULT
A default |
| public static final EasingConfiguration | DISABLED
A disabled |
| private static final int | |
| private final int | |
| private final int | |
| private final EasingFunction | |
| private final int |
| Access | Constructor and Description |
|---|---|
| private | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static EasingConfiguration. | Returns: a newEasingConfigurationBuilderReturns a new builder for constructing an |
| private static EasingConfiguration | |
| public boolean | equals(Object object)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public int | Returns: the animation duration in milliseconds;>= 0Returns the total duration of the easing animation in milliseconds. |
| public long | Returns: the per-frame delay in millisecondsReturns the delay between each animation frame, derived as |
| public int | Returns: the frame count; always>= 1Returns the number of intermediate frames rendered during the animation. |
| public EasingFunction | Returns: the easing function; nevernullReturns the easing function applied to interpolate progress across frames. |
| public int | Returns: the threshold;>= 0Returns the minimum tick amount required to trigger easing. |
| public int | |
| public boolean | Returns: true if easing should be applied; false otherwisethe number of ticks being advanced tickBy)Returns whether easing should be applied for the given tick amount. |
| public String |
| DEFAULT | back to summary |
|---|---|
| public static final EasingConfiguration DEFAULT A default | |
| DISABLED | back to summary |
|---|---|
| public static final EasingConfiguration DISABLED A disabled | |
| DISABLED_THRESHOLD | back to summary |
|---|---|
| private static final int DISABLED_THRESHOLD | |
| durationMs | back to summary |
|---|---|
| private final int durationMs | |
| frames | back to summary |
|---|---|
| private final int frames | |
| function | back to summary |
|---|---|
| private final EasingFunction function | |
| threshold | back to summary |
|---|---|
| private final int threshold | |
| EasingConfiguration | back to summary |
|---|---|
| private EasingConfiguration() | |
| EasingConfiguration | back to summary |
|---|---|
| private EasingConfiguration(EasingConfiguration. | |
| builder | back to summary |
|---|---|
| public static EasingConfiguration. Returns a new builder for constructing an | |
| disabledConfig | back to summary |
|---|---|
| private static EasingConfiguration disabledConfig() | |
| equals | back to summary |
|---|---|
| public boolean equals(Object object) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getDurationMs | back to summary |
|---|---|
| public int getDurationMs() Returns the total duration of the easing animation in milliseconds. The per-frame delay is
| |
| getFrameDelayMs | back to summary |
|---|---|
| public long getFrameDelayMs() Returns the delay between each animation frame, derived as
| |
| getFrames | back to summary |
|---|---|
| public int getFrames() Returns the number of intermediate frames rendered during the animation. Higher values produce smoother animations at the cost of increased
CPU usage. The per-frame delay is
| |
| getFunction | back to summary |
|---|---|
| public EasingFunction getFunction() Returns the easing function applied to interpolate progress across frames.
| |
| getThreshold | back to summary |
|---|---|
| public int getThreshold() Returns the minimum tick amount required to trigger easing. Ticks below this value are applied instantly. A threshold of
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| shouldEase | back to summary |
|---|---|
| public boolean shouldEase(int tickBy) Returns whether easing should be applied for the given tick amount. Returns
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
EasingConfiguration.
This builder is not thread-safe.
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private int | |
| private EasingFunction | |
| private int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public EasingConfiguration | Returns: a new, immutableEasingConfigurationConstructs a new |
| public EasingConfiguration. | Returns: this builderthe animation duration; must be durationMs)>= 0Sets the total duration of the easing animation in milliseconds. |
| public EasingConfiguration. | Returns: this builderthe number of frames; must be frames)>= 1Sets the number of intermediate frames rendered during the animation. |
| public EasingConfiguration. | Returns: this builderthe easing function to apply; must not be function)nullSets the easing function used to interpolate progress across frames. |
| public EasingConfiguration. | Returns: this builderthe minimum tick amount; must be threshold)>= 0Sets the minimum tick amount required to trigger easing. |
| durationMs | back to summary |
|---|---|
| private int durationMs | |
| frames | back to summary |
|---|---|
| private int frames | |
| function | back to summary |
|---|---|
| private EasingFunction function | |
| threshold | back to summary |
|---|---|
| private int threshold | |
| EasingConfigurationBuilder | back to summary |
|---|---|
| public EasingConfigurationBuilder() | |
| build | back to summary |
|---|---|
| public EasingConfiguration build() Constructs a new
| |
| duration | back to summary |
|---|---|
| public EasingConfiguration. Sets the total duration of the easing animation in milliseconds. The per-frame delay is computed as
| |
| frames | back to summary |
|---|---|
| public EasingConfiguration. Sets the number of intermediate frames rendered during the animation. Higher values produce smoother animations at the cost of increased CPU usage.
The per-frame delay is computed as
| |
| function | back to summary |
|---|---|
| public EasingConfiguration. Sets the easing function used to interpolate progress across frames.
| |
| threshold | back to summary |
|---|---|
| public EasingConfiguration. Sets the minimum tick amount required to trigger easing. Ticks smaller than this value are applied instantly without animation.
Set to
| |