Summary
Make javafx.geometry.Point2D
andjavafx.geometry.Point3D
implement javafx.animation.Interpolatable<T>
in order to be able to interpolate over them.
Problem
Point2D
and Point3D
are containers for double data (x, y, z). Since they do not implement Interpolatable<T>
, interpolation must happen over their internal values, which is cumbersome.
Solution
Make Point2D
and Point3D
implement Interpolatable<T>
.
Specification
The class definitions now declare implements Interpolatable<T>
:
public class Point2D implements Interpolatable<Point2D>
public class Point3D implements Interpolatable<Point3D>
The following method was added to Point2D:
/**
* {@inheritDoc}
*
* @since 13
*/
@Override
public Point2D interpolate(Point2D endValue, double t)
The following method was added to Point3D:
/**
* {@inheritDoc}
*
* @since 13
*/
@Override
public Point3D interpolate(Point3D endValue, double t)
- csr of
-
JDK-8226454 Point2D and Point3D should implement Interpolatable
-
- Resolved
-
- relates to
-
JDK-8226911 Interpolatable's contract should be reexamined
-
- Resolved
-