RFR: 8317116: Provide layouts for multiple test UI in PassFailJFrame [v2]

Alexey Ivanov aivanov at openjdk.org
Fri Sep 27 14:30:36 UTC 2024


On Fri, 27 Sep 2024 14:21:14 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> test/jdk/java/awt/regtesthelpers/PassFailJFrame.java line 1405:
>> 
>>> 1403:          * Positions the test UI windows in a row to the right of
>>> 1404:          * the instruction frame. The top of the windows is aligned to
>>> 1405:          * that of the instruction frame.
>> 
>> Since we are touching this, what are our options for positioning the instruction frame?
>> 
>> The `.position(PassFailJFrame.Position.TOP_LEFT_CORNER)` has no effect now with positionTestUIRightRow:
>> 
>> 
>>         PassFailJFrame.builder()
>>                       .instructions(INSTRUCTIONS)
>>                       .rows(15)
>>                       .columns(30)
>>                       .testUI(() -> WindowCreator.createTestWindows(2))
>>                       .position(PassFailJFrame.Position.TOP_LEFT_CORNER)
>>                       .positionTestUIRightRow()
>>                       .build()
>>                       .awaitAndCheck();
>> 
>> 
>> Should we provide a way to place instruction frame in arbitrary location on screen?
>> It will allow us to provide more flexibility and more advanced layouts without too much effort from a test developer.
>
> If you call `.position(PassFailJFrame.Position.TOP_LEFT_CORNER)` after `.positionTestUIRightRow`, it is respected.

> Should we provide a way to place instruction frame in arbitrary location on screen?

You can do it by using the `InstructionUI` interface that's passed to you when you implement a custom layout.

We're still trying to encapsulate the frame that hosts the instructions… if it's exposed, then the test developer can do whatever they want… yet then they have to ensure calling methods on that frame from EDT.

I'd rather not expose the frame at this time.

How often does one need to position the instructions at an arbitrary location on the screen? The `TOP_LEFT_CORNER` position is used by 6 tests only.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21207#discussion_r1778717585


More information about the client-libs-dev mailing list