RFR: 8317836: FX nodes embedded in JFXPanel need to track component orientation [v8]
Kevin Rushforth
kcr at openjdk.org
Tue Oct 31 15:59:47 UTC 2023
On Tue, 31 Oct 2023 15:42:50 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
> I can add in JFXPanel.java
> ```
> if (!cor.equals(ComponentOrientation.UNKNOWN)) {
> boolean rtl = cor.equals(ComponentOrientation.RIGHT_TO_LEFT);
> stage.setNodeOrientation(rtl ? NodeOrientation.RIGHT_TO_LEFT :
> NodeOrientation.LEFT_TO_RIGHT);
> } else {
> stage.setNodeOrientation(NodeOrientation.LEFT_TO_RIGHT);
> }
> ```
>
> if that is what your MonkeyTester expects..
Presuming we want to treat UNKOWN the same as RIGHT_TO_LEFT, which I think we do, then it's even simpler than that. Just remove the check for UNKNOWN entirely, in which case `rtl` will be true if `cor` is RIGHT_TO_LEFT and false otherwise, meaning that UNKNOWN will be treated the same as LEFT_TO_RIGHT.
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1271#issuecomment-1787503711
More information about the openjfx-dev
mailing list