RFR: 8341670: [Text, TextFlow] Public API for Text Layout Info [v7]
Andy Goryachev
angorya at openjdk.org
Wed Oct 23 22:55:18 UTC 2024
On Wed, 23 Oct 2024 18:48:47 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
>> Andy Goryachev has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 13 additional commits since the last revision:
>>
>> - Merge remote-tracking branch 'origin/master' into ag.text.layout.api
>> - remove line spacing
>> - tests
>> - whitespace
>> - caret info
>> - text line info
>> - Merge remote-tracking branch 'origin/master' into ag.text.layout.api
>> - convert to wrapper
>> - clarify
>> - javadoc
>> - ... and 3 more: https://git.openjdk.org/jfx/compare/3e3b66a1...5ab4f47a
>
> modules/javafx.graphics/src/main/java/javafx/scene/text/CaretInfo.java line 34:
>
>> 32: * @since 24
>> 33: */
>> 34: public sealed abstract class CaretInfo permits PrismCaretInfo {
>
> Given the API you define, is there a reason not to make this an interface?
Originally it was an interface. Then @prrace said "Why an interface ? It is easier to evolve a class when you want to add more info."
Since this thing is sealed, it probably does not matter, and access to class methods is _two_ nanoseconds faster (not that's important).
The only good thing about interface is the ease of mocking in testing, but we don't do that.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1596#discussion_r1813884704
More information about the openjfx-dev
mailing list