8341037: Use standard layouts in DefaultFrameIconTest.java and MenuCrash.java
Reviewed-by: azvegint, prr
This commit is contained in:
parent
76283dd270
commit
c43202baf6
@ -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");
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user