Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8226753

Point2D and Point3D should implement Interpolatable

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • jfx13
    • javafx
    • None
    • source, binary
    • minimal
    • Java API
    • JDK

      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)

            nlisker Nir Lisker
            nlisker Nir Lisker
            Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: