RFR: 8373038: Interpolator factories should follow method naming convention
Andy Goryachev
angorya at openjdk.org
Thu Dec 4 00:24:10 UTC 2025
On Wed, 3 Dec 2025 17:08:24 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:
> The following interpolator factories don't follow the standard method naming convention:
>
> * `Interpolator.SPLINE(double, double, double, double)`
> * `Interpolator.TANGENT(Duration, double, Duration, double)`
> * `Interpolator.TANGENT(Duration, double)`
> * `Interpolator.STEPS(int, StepPosition)`
>
> New methods named `ofSpline`, `ofTangent`, and `ofSteps` are added. The existing methods are deprecated (not for removal) in favor of the correctly-named methods. This change is in line with the new `ofLinear` method added with #1977.
lgtm
modules/javafx.controls/src/main/java/javafx/scene/control/skin/PaginationSkin.java line 97:
> 95: private static final double SWIPE_THRESHOLD = 0.30;
> 96: private static final double TOUCH_THRESHOLD = 15;
> 97: private static final Interpolator interpolator = Interpolator.ofSpline(0.4829, 0.5709, 0.6803, 0.9928);
Off-topic: shouldn't this interpolator be specified by the stylesheet (i.e. to be able to modify the transition if needed)?
More of a question for @kevinrushforth
modules/javafx.graphics/src/main/java/javafx/animation/Interpolator.java line 192:
> 190:
> 191: /**
> 192: * Use {@link #ofSpline(double, double, double, double)}.
maybe something like "This poorly named method is deprecated in favor of ..." or words to that extent?
or keep the original description?
-------------
Marked as reviewed by angorya (Reviewer).
PR Review: https://git.openjdk.org/jfx/pull/1996#pullrequestreview-3537381451
PR Review Comment: https://git.openjdk.org/jfx/pull/1996#discussion_r2586989217
PR Review Comment: https://git.openjdk.org/jfx/pull/1996#discussion_r2586983857
More information about the openjfx-dev
mailing list