RFR: 8317836: FX nodes embedded in JFXPanel need to track component orientation [v2]

Prasanta Sadhukhan psadhukhan at openjdk.org
Fri Oct 27 03:19:05 UTC 2023


On Thu, 26 Oct 2023 18:16:26 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Optimization
>
> modules/javafx.swing/src/main/java/javafx/embed/swing/JFXPanel.java line 817:
> 
>> 815:             ComponentOrientation cor = this.getComponentOrientation();
>> 816:             if (!cor.equals(ComponentOrientation.UNKNOWN)) {
>> 817:                 getScene().setNodeOrientation(cor.equals(ComponentOrientation.RIGHT_TO_LEFT) ?
> 
> 1. I think getScene() might return null (sorry, did not see this immediately)
> 2. if possible, could we try limit code to one statement per line, i.e.
> 
> 
> Scene scene = getScene(); // it's a volatile, so better assign to a variable
> if(scene != null) {
>   boolean rtl = cor.equals();
>   scene.setNodeOrientation(rtl ? ...);
> }

ok..updated..

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1271#discussion_r1374027490


More information about the openjfx-dev mailing list