1
1
/*
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.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* 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}
359
359
* the default values of {@value #ROWS} and {@value #COLUMNS}
360
360
* for rows and columns.
361
361
* <p>
362
- * See {@link #PassFailJFrame(String,String,long,int,int,boolean )} for
362
+ * See {@link #PassFailJFrame(String,String,long,int,int)} for
363
363
* more details.
364
364
*
365
365
* @param instructions the instructions for the tester
@@ -382,7 +382,7 @@ public PassFailJFrame(String instructions)
382
382
* and the default values of {@value #ROWS} and {@value #COLUMNS}
383
383
* for rows and columns.
384
384
* <p>
385
- * See {@link #PassFailJFrame(String,String,long,int,int,boolean )} for
385
+ * See {@link #PassFailJFrame(String,String,long,int,int)} for
386
386
* more details.
387
387
*
388
388
* @param instructions the instructions for the tester
@@ -404,9 +404,8 @@ public PassFailJFrame(String instructions, long testTimeOut)
404
404
* with the given title, instructions and timeout as well as
405
405
* the default values of {@value #ROWS} and {@value #COLUMNS}
406
406
* for rows and columns.
407
- * The screenshot feature is not enabled, if you use this constructor.
408
407
* <p>
409
- * See {@link #PassFailJFrame(String,String,long,int,int,boolean )} for
408
+ * See {@link #PassFailJFrame(String,String,long,int,int)} for
410
409
* more details.
411
410
*
412
411
* @param title the title of the instruction frame
@@ -424,41 +423,11 @@ public PassFailJFrame(String title, String instructions,
424
423
this (title , instructions , testTimeOut , ROWS , COLUMNS );
425
424
}
426
425
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
-
456
426
/**
457
427
* Constructs a frame which displays test instructions and
458
428
* the <i>Pass</i> / <i>Fail</i> buttons
459
429
* 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.
462
431
* All the UI components are created on the EDT, so it is safe to call
463
432
* the constructor on the main thread.
464
433
* <p>
@@ -483,12 +452,6 @@ public PassFailJFrame(String title, String instructions,
483
452
* the size of a text component which displays the instructions.
484
453
* The preferred size of the instructions is calculated by
485
454
* 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}.
492
455
*
493
456
* @param title the title of the instruction frame
494
457
* @param instructions the instructions for the tester
@@ -497,8 +460,6 @@ public PassFailJFrame(String title, String instructions,
497
460
* which displays test instructions
498
461
* @param columns the number of columns for the text component
499
462
* which displays test instructions
500
- * @param screenCapture if set to {@code true}, enables screen capture
501
- * functionality
502
463
*
503
464
* @throws InterruptedException if the current thread is interrupted
504
465
* while waiting for EDT to finish creating UI components
@@ -510,13 +471,11 @@ public PassFailJFrame(String title, String instructions,
510
471
*/
511
472
public PassFailJFrame (String title , String instructions ,
512
473
long testTimeOut ,
513
- int rows , int columns ,
514
- boolean screenCapture )
474
+ int rows , int columns )
515
475
throws InterruptedException , InvocationTargetException {
516
476
invokeOnEDT (() -> createUI (title , instructions ,
517
477
testTimeOut ,
518
- rows , columns ,
519
- screenCapture ));
478
+ rows , columns ));
520
479
}
521
480
522
481
/**
@@ -613,8 +572,7 @@ private static void invokeOnEDTUncheckedException(Runnable doRun) {
613
572
}
614
573
615
574
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 ) {
618
576
frame = new JFrame (title );
619
577
frame .setLayout (new BorderLayout ());
620
578
@@ -623,7 +581,7 @@ private static void createUI(String title, String instructions,
623
581
frame .add (createInstructionUIPanel (instructions ,
624
582
testTimeOut ,
625
583
rows , columns ,
626
- enableScreenCapture ,
584
+ false ,
627
585
false , 0 ),
628
586
BorderLayout .CENTER );
629
587
frame .pack ();
0 commit comments