RFR: 8341670: [Text, TextFlow] Public API for Text Layout Info [v23]

Andy Goryachev angorya at openjdk.org
Mon Apr 7 18:44:52 UTC 2025


On Sat, 5 Apr 2025 07:53:35 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:

>> Andy Goryachev has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 48 commits:
>> 
>>  - Merge remote-tracking branch 'origin/master' into ag.text.layout.api
>>  - Merge remote-tracking branch 'origin/master' into ag.text.layout.api
>>  - twice
>>  - tests
>>  - review comments
>>  - Merge remote-tracking branch 'origin/master' into ag.text.layout.api
>>  - Merge remote-tracking branch 'origin/master' into ag.text.layout.api
>>  - review comments
>>  - Merge remote-tracking branch 'origin/master' into ag.text.layout.api
>>  - 25 25
>>  - ... and 38 more: https://git.openjdk.org/jfx/compare/76282bcf...33cf88d8
>
> modules/javafx.graphics/src/main/java/javafx/scene/text/CaretInfo.java line 62:
> 
>> 60:      *     {@code (index < 0 || index > getSegmentCount())}
>> 61:      */
>> 62:     public abstract Rectangle2D getSegmentAt(int index);
> 
> The naming style in `CaretInfo`, `LayoutInfo`, and `TextLineInfo` is a bit inconsistent in that it uses both `getFoo()` as well as `foo()` (both with and without method arguments). I think you should decide on one way or the other.

`TextLineInfo` is a record, I don't want to add duplicate getXXX() aliases there.

The other (in `LayoutInfo`) are modeled after `Text`/`TextFlow` (e.g. `underlineShape()`), I have no problem with any of these.  I don't think we have strict rules regarding naming, and these are not java beans to utilize some sort of naming pattern in accessors, but I could be missing something.

Could you be more specific?

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1596#discussion_r2031798909


More information about the openjfx-dev mailing list