Skip to content

Commit 23a44d9

Browse files
committed
8340784: Remove PassFailJFrame constructor with screenshots
Backport-of: 50ca450417a5da7d4c6c08154515b8407bf656e8
1 parent 5c19cf5 commit 23a44d9

File tree

1 file changed

+9
-51
lines changed

1 file changed

+9
-51
lines changed

test/jdk/java/awt/regtesthelpers/PassFailJFrame.java

Lines changed: 9 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -359,7 +359,7 @@ public enum Position {HORIZONTAL, VERTICAL, TOP_LEFT_CORNER}
359359
* the default values of {@value #ROWS} and {@value #COLUMNS}
360360
* for rows and columns.
361361
* <p>
362-
* See {@link #PassFailJFrame(String,String,long,int,int,boolean)} for
362+
* See {@link #PassFailJFrame(String,String,long,int,int)} for
363363
* more details.
364364
*
365365
* @param instructions the instructions for the tester
@@ -382,7 +382,7 @@ public PassFailJFrame(String instructions)
382382
* and the default values of {@value #ROWS} and {@value #COLUMNS}
383383
* for rows and columns.
384384
* <p>
385-
* See {@link #PassFailJFrame(String,String,long,int,int,boolean)} for
385+
* See {@link #PassFailJFrame(String,String,long,int,int)} for
386386
* more details.
387387
*
388388
* @param instructions the instructions for the tester
@@ -404,9 +404,8 @@ public PassFailJFrame(String instructions, long testTimeOut)
404404
* with the given title, instructions and timeout as well as
405405
* the default values of {@value #ROWS} and {@value #COLUMNS}
406406
* for rows and columns.
407-
* The screenshot feature is not enabled, if you use this constructor.
408407
* <p>
409-
* See {@link #PassFailJFrame(String,String,long,int,int,boolean)} for
408+
* See {@link #PassFailJFrame(String,String,long,int,int)} for
410409
* more details.
411410
*
412411
* @param title the title of the instruction frame
@@ -424,41 +423,11 @@ public PassFailJFrame(String title, String instructions,
424423
this(title, instructions, testTimeOut, ROWS, COLUMNS);
425424
}
426425

427-
/**
428-
* Constructs a frame which displays test instructions and
429-
* the <i>Pass</i> / <i>Fail</i> buttons
430-
* with the given title, instructions, timeout, number of rows and columns.
431-
* The screenshot feature is not enabled, if you use this constructor.
432-
* <p>
433-
* See {@link #PassFailJFrame(String,String,long,int,int,boolean)} for
434-
* more details.
435-
*
436-
* @param title the title of the instruction frame
437-
* @param instructions the instructions for the tester
438-
* @param testTimeOut the test timeout in minutes
439-
* @param rows the number of rows for the text component
440-
* which displays test instructions
441-
* @param columns the number of columns for the text component
442-
* which displays test instructions
443-
*
444-
* @throws InterruptedException if the current thread is interrupted
445-
* while waiting for EDT to finish creating UI components
446-
* @throws InvocationTargetException if an exception is thrown while
447-
* creating UI components on EDT
448-
*/
449-
public PassFailJFrame(String title, String instructions,
450-
long testTimeOut,
451-
int rows, int columns)
452-
throws InterruptedException, InvocationTargetException {
453-
this(title, instructions, testTimeOut, rows, columns, false);
454-
}
455-
456426
/**
457427
* Constructs a frame which displays test instructions and
458428
* the <i>Pass</i> / <i>Fail</i> buttons
459429
* as well as supporting UI components with the given title, instructions,
460-
* timeout, number of rows and columns,
461-
* and screen capture functionality.
430+
* timeout, number of rows and columns.
462431
* All the UI components are created on the EDT, so it is safe to call
463432
* the constructor on the main thread.
464433
* <p>
@@ -483,12 +452,6 @@ public PassFailJFrame(String title, String instructions,
483452
* the size of a text component which displays the instructions.
484453
* The preferred size of the instructions is calculated by
485454
* creating {@code new JTextArea(rows, columns)}.
486-
* <p>
487-
* If you enable screenshots by setting the {@code screenCapture}
488-
* parameter to {@code true}, a <i>Screenshot</i> button is added.
489-
* Clicking the <i>Screenshot</i> button takes screenshots of
490-
* all the monitors or all the windows registered with
491-
* {@code PassFailJFrame}.
492455
*
493456
* @param title the title of the instruction frame
494457
* @param instructions the instructions for the tester
@@ -497,8 +460,6 @@ public PassFailJFrame(String title, String instructions,
497460
* which displays test instructions
498461
* @param columns the number of columns for the text component
499462
* which displays test instructions
500-
* @param screenCapture if set to {@code true}, enables screen capture
501-
* functionality
502463
*
503464
* @throws InterruptedException if the current thread is interrupted
504465
* while waiting for EDT to finish creating UI components
@@ -510,13 +471,11 @@ public PassFailJFrame(String title, String instructions,
510471
*/
511472
public PassFailJFrame(String title, String instructions,
512473
long testTimeOut,
513-
int rows, int columns,
514-
boolean screenCapture)
474+
int rows, int columns)
515475
throws InterruptedException, InvocationTargetException {
516476
invokeOnEDT(() -> createUI(title, instructions,
517477
testTimeOut,
518-
rows, columns,
519-
screenCapture));
478+
rows, columns));
520479
}
521480

522481
/**
@@ -613,8 +572,7 @@ private static void invokeOnEDTUncheckedException(Runnable doRun) {
613572
}
614573

615574
private static void createUI(String title, String instructions,
616-
long testTimeOut, int rows, int columns,
617-
boolean enableScreenCapture) {
575+
long testTimeOut, int rows, int columns) {
618576
frame = new JFrame(title);
619577
frame.setLayout(new BorderLayout());
620578

@@ -623,7 +581,7 @@ private static void createUI(String title, String instructions,
623581
frame.add(createInstructionUIPanel(instructions,
624582
testTimeOut,
625583
rows, columns,
626-
enableScreenCapture,
584+
false,
627585
false, 0),
628586
BorderLayout.CENTER);
629587
frame.pack();

0 commit comments

Comments
 (0)