8341037: Use standard layouts in DefaultFrameIconTest.java and MenuCrash.java

Reviewed-by: azvegint, prr
This commit is contained in:
Alexey Ivanov 2024-10-02 16:10:48 +00:00
parent 76283dd270
commit c43202baf6
2 changed files with 2 additions and 22 deletions

View File

@ -50,21 +50,11 @@ public class DefaultFrameIconTest {
.instructions(INSTRUCTIONS) .instructions(INSTRUCTIONS)
.columns(45) .columns(45)
.testUI(DefaultFrameIconTest::createAndShowUI) .testUI(DefaultFrameIconTest::createAndShowUI)
.positionTestUI(DefaultFrameIconTest::positionTestWindows) .positionTestUIRightRow()
.build() .build()
.awaitAndCheck(); .awaitAndCheck();
} }
private static void positionTestWindows(List<? extends Window> testWindows,
PassFailJFrame.InstructionUI instructionUI) {
int gap = 5;
int x = instructionUI.getLocation().x + instructionUI.getSize().width + gap;
for (Window w : testWindows) {
w.setLocation(x, instructionUI.getLocation().y);
x += w.getWidth() + gap;
}
}
private static List<Window> createAndShowUI() { private static List<Window> createAndShowUI() {
Frame testFrame = new Frame("Frame DefaultFrameIconTest"); Frame testFrame = new Frame("Frame DefaultFrameIconTest");
Dialog testDialog = new Dialog(testFrame, "Dialog DefaultFrameIconTest"); Dialog testDialog = new Dialog(testFrame, "Dialog DefaultFrameIconTest");

View File

@ -62,7 +62,7 @@ public class MenuCrash {
.instructions(INSTRUCTIONS) .instructions(INSTRUCTIONS)
.columns(45) .columns(45)
.testUI(MenuCrash::createAndShowUI) .testUI(MenuCrash::createAndShowUI)
.positionTestUI(MenuCrash::positionTestWindows) .positionTestUIRightRow()
.build() .build()
.awaitAndCheck(); .awaitAndCheck();
} }
@ -81,16 +81,6 @@ public class MenuCrash {
return List.of(frame1, frame2); return List.of(frame1, frame2);
} }
private static void positionTestWindows(List<? extends Window> testWindows,
PassFailJFrame.InstructionUI instructionUI) {
int gap = 5;
int x = instructionUI.getLocation().x + instructionUI.getSize().width + gap;
for (Window w : testWindows) {
w.setLocation(x, instructionUI.getLocation().y);
x += w.getWidth() + gap;
}
}
static class MenuFrame extends Frame { static class MenuFrame extends Frame {
private final TextField field; private final TextField field;