Class CubicBezierEasing
java.lang.Object
com.formdev.flatlaf.util.CubicBezierEasing
- All Implemented Interfaces:
Animator.Interpolator
An interpolator for
Animator that uses a cubic bezier curve.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CubicBezierEasingstatic final CubicBezierEasingstatic final CubicBezierEasingstatic final CubicBezierEasingstatic final CubicBezierEasingStandard easing as specified in Material design (0.4, 0, 0.2, 1). -
Constructor Summary
ConstructorsConstructorDescriptionCubicBezierEasing(float x1, float y1, float x2, float y2) Creates a cubic bezier easing interpolator with the given control points. -
Method Summary
Modifier and TypeMethodDescriptionfloatinterpolate(float fraction) Interpolate the given fraction and returns a new fraction.
-
Field Details
-
STANDARD_EASING
Standard easing as specified in Material design (0.4, 0, 0.2, 1).- See Also:
-
EASE
-
EASE_IN
-
EASE_IN_OUT
-
EASE_OUT
-
-
Constructor Details
-
CubicBezierEasing
public CubicBezierEasing(float x1, float y1, float x2, float y2) Creates a cubic bezier easing interpolator with the given control points. The start point of the cubic bezier curve is always 0,0 and the end point 1,1.- Parameters:
x1- the x coordinate of the first control point in range [0, 1]y1- the y coordinate of the first control point in range [0, 1]x2- the x coordinate of the second control point in range [0, 1]y2- the y coordinate of the second control point in range [0, 1]
-
-
Method Details
-
interpolate
public float interpolate(float fraction) Description copied from interface:Animator.InterpolatorInterpolate the given fraction and returns a new fraction. Both fractions are in range [0, 1].- Specified by:
interpolatein interfaceAnimator.Interpolator- Parameters:
fraction- the percent (0 to 1) elapsed of the current animation cycle- Returns:
- new fraction in range [0, 1]
-