RFR: 8332895: Support interpolation for backgrounds and borders [v22]

Andy Goryachev angorya at openjdk.org
Fri Aug 9 15:40:41 UTC 2024


On Fri, 9 Aug 2024 02:23:11 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:

>> modules/javafx.graphics/src/main/java/javafx/css/StyleConverter.java line 113:
>> 
>>> 111:          * @return a {@code Map} of the constituent values
>>> 112:          */
>>> 113:         Map<CssMetaData<? extends Styleable, ?>, Object> convertBack(T value);
>> 
>> perhaps `convertToMap` might be better?  or something along the lines of `toInstance`/`toMap` ?   `decompose` / `reconstruct` ?  (though decompose might evoke wrong associations)
>
> `reconstruct` is a misnomer, as reconstruction is a two-step operation (`convertBack` followed by `convert`). To be fair, I don't like any of these better than `convertBack`, mostly because I want to stress that those two operations are closely related, and none of the alternatives evoke that sentiment. That being said, this is a minor API and I don't really mind either way, but absent a compelling reason, I'd prefer to stick to `convertBack`.

That's fine, I just think `convertBack` implies an arrow of time or a preferred spatial direction.

Maybe `toMap()`, but as long as the method is sufficiently documented, we should be fine.  Naming _is_ hard.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1522#discussion_r1711692474


More information about the openjfx-dev mailing list