jdk/test/java/awt/Focus/NonFocusableResizableTooSmall/NonFocusableResizableTooSmall.java
author goetz
Tue, 14 Jun 2016 10:44:59 +0200
changeset 39056 d99e63b6d962
parent 5506 202f599c92aa
permissions -rw-r--r--
8159690: [TESTBUG] Mark headful tests with @key headful. Reviewed-by: simonis, alexsch
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
128
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
     1
/*
39056
d99e63b6d962 8159690: [TESTBUG] Mark headful tests with @key headful.
goetz
parents: 5506
diff changeset
     2
 * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
128
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
     4
 *
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
     7
 * published by the Free Software Foundation.
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
     8
 *
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    13
 * accompanied this code).
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    14
 *
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    18
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 128
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 128
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 128
diff changeset
    21
 * questions.
128
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    22
 */
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    23
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    24
/*
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    25
  @test
39056
d99e63b6d962 8159690: [TESTBUG] Mark headful tests with @key headful.
goetz
parents: 5506
diff changeset
    26
  @key headful
128
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    27
  @bug 6581927
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    28
  @summary Non-focusable frame should honor the size of the frame buttons/decorations when resizing
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    29
  @library ../../regtesthelpers
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    30
  @build Util
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    31
  @author anthony.petrov@...: area=awt.toplevel
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    32
  @run main NonFocusableResizableTooSmall
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    33
*/
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    34
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    35
/**
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    36
 * NonFocusableResizableTooSmall.java
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    37
 *
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    38
 * summary:  Non-focusable frame should honor the size of the frame buttons/decorations when resizing
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    39
 */
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    40
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    41
import java.awt.*;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    42
import java.awt.event.*;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    43
import test.java.awt.regtesthelpers.Util;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    44
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    45
public class NonFocusableResizableTooSmall
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    46
{
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    47
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    48
    //*** test-writer defined static variables go here ***
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    49
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    50
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    51
    private static void init()
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    52
    {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    53
        //*** Create instructions for the user here ***
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    54
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    55
        String[] instructions =
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    56
        {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    57
            "This is an AUTOMATIC test, simply wait until it is done.",
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    58
            "The result (passed or failed) will be shown in the",
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    59
            "message window below."
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    60
        };
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    61
        Sysout.createDialog( );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    62
        Sysout.printInstructions( instructions );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    63
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    64
        final Frame frame = new Frame();
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    65
        frame.setFocusableWindowState(false);
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    66
        frame.setSize(200, 100);
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    67
        frame.setVisible(true);
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    68
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    69
        final Robot robot = Util.createRobot();
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    70
        robot.setAutoDelay(20);
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    71
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    72
        // To be sure the window is shown and packed
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    73
        Util.waitForIdle(robot);
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    74
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    75
        final Insets insets = frame.getInsets();
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    76
        System.out.println("The insets of the frame: " + insets);
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    77
        if (insets.right == 0 || insets.bottom == 0) {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    78
            System.out.println("The test environment must have non-zero right & bottom insets!");
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    79
            pass();
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    80
            return;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    81
        }
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    82
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    83
        // Let's move the mouse pointer to the bottom-right coner of the frame (the "size-grip")
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    84
        final Rectangle bounds1 = frame.getBounds();
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    85
        System.out.println("The bounds before resizing: " + bounds1);
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    86
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    87
        robot.mouseMove(bounds1.x + bounds1.width - 1, bounds1.y + bounds1.height - 1);
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    88
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    89
        // ... and start resizing to some very small
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    90
        robot.mousePress( InputEvent.BUTTON1_MASK );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    91
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    92
        // Now resize the frame so that the width is smaller
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    93
        // than the widths of the left and the right borders.
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    94
        // The sum of widths of the icon of the frame + the control-buttons
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    95
        // (close, minimize, etc.) should be definitely larger!
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    96
        robot.mouseMove(bounds1.x + insets.left + insets.right - 5, bounds1.y + bounds1.height - 1);
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    97
        Util.waitForIdle(robot);
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    98
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
    99
        robot.mouseRelease( InputEvent.BUTTON1_MASK );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   100
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   101
        Util.waitForIdle(robot);
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   102
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   103
        // Check the current bounds of the frame
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   104
        final Rectangle bounds2 = frame.getBounds();
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   105
        System.out.println("The bounds after resizing: " + bounds2);
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   106
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   107
        if (bounds2.width <= (insets.left + insets.right)) {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   108
            fail("The frame has been resized to very small.");
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   109
        }
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   110
        pass();
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   111
    }//End  init()
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   112
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   113
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   114
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   115
    /*****************************************************
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   116
     * Standard Test Machinery Section
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   117
     * DO NOT modify anything in this section -- it's a
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   118
     * standard chunk of code which has all of the
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   119
     * synchronisation necessary for the test harness.
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   120
     * By keeping it the same in all tests, it is easier
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   121
     * to read and understand someone else's test, as
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   122
     * well as insuring that all tests behave correctly
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   123
     * with the test harness.
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   124
     * There is a section following this for test-
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   125
     * classes
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   126
     ******************************************************/
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   127
    private static boolean theTestPassed = false;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   128
    private static boolean testGeneratedInterrupt = false;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   129
    private static String failureMessage = "";
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   130
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   131
    private static Thread mainThread = null;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   132
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   133
    private static int sleepTime = 300000;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   134
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   135
    // Not sure about what happens if multiple of this test are
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   136
    //  instantiated in the same VM.  Being static (and using
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   137
    //  static vars), it aint gonna work.  Not worrying about
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   138
    //  it for now.
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   139
    public static void main( String args[] ) throws InterruptedException
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   140
    {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   141
        mainThread = Thread.currentThread();
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   142
        try
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   143
        {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   144
            init();
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   145
        }
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   146
        catch( TestPassedException e )
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   147
        {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   148
            //The test passed, so just return from main and harness will
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   149
            // interepret this return as a pass
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   150
            return;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   151
        }
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   152
        //At this point, neither test pass nor test fail has been
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   153
        // called -- either would have thrown an exception and ended the
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   154
        // test, so we know we have multiple threads.
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   155
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   156
        //Test involves other threads, so sleep and wait for them to
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   157
        // called pass() or fail()
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   158
        try
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   159
        {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   160
            Thread.sleep( sleepTime );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   161
            //Timed out, so fail the test
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   162
            throw new RuntimeException( "Timed out after " + sleepTime/1000 + " seconds" );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   163
        }
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   164
        catch (InterruptedException e)
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   165
        {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   166
            //The test harness may have interrupted the test.  If so, rethrow the exception
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   167
            // so that the harness gets it and deals with it.
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   168
            if( ! testGeneratedInterrupt ) throw e;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   169
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   170
            //reset flag in case hit this code more than once for some reason (just safety)
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   171
            testGeneratedInterrupt = false;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   172
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   173
            if ( theTestPassed == false )
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   174
            {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   175
                throw new RuntimeException( failureMessage );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   176
            }
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   177
        }
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   178
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   179
    }//main
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   180
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   181
    public static synchronized void setTimeoutTo( int seconds )
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   182
    {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   183
        sleepTime = seconds * 1000;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   184
    }
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   185
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   186
    public static synchronized void pass()
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   187
    {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   188
        Sysout.println( "The test passed." );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   189
        Sysout.println( "The test is over, hit  Ctl-C to stop Java VM" );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   190
        //first check if this is executing in main thread
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   191
        if ( mainThread == Thread.currentThread() )
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   192
        {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   193
            //Still in the main thread, so set the flag just for kicks,
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   194
            // and throw a test passed exception which will be caught
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   195
            // and end the test.
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   196
            theTestPassed = true;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   197
            throw new TestPassedException();
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   198
        }
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   199
        theTestPassed = true;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   200
        testGeneratedInterrupt = true;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   201
        mainThread.interrupt();
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   202
    }//pass()
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   203
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   204
    public static synchronized void fail()
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   205
    {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   206
        //test writer didn't specify why test failed, so give generic
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   207
        fail( "it just plain failed! :-)" );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   208
    }
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   209
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   210
    public static synchronized void fail( String whyFailed )
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   211
    {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   212
        Sysout.println( "The test failed: " + whyFailed );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   213
        Sysout.println( "The test is over, hit  Ctl-C to stop Java VM" );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   214
        //check if this called from main thread
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   215
        if ( mainThread == Thread.currentThread() )
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   216
        {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   217
            //If main thread, fail now 'cause not sleeping
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   218
            throw new RuntimeException( whyFailed );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   219
        }
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   220
        theTestPassed = false;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   221
        testGeneratedInterrupt = true;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   222
        failureMessage = whyFailed;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   223
        mainThread.interrupt();
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   224
    }//fail()
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   225
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   226
}// class NonFocusableResizableTooSmall
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   227
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   228
//This exception is used to exit from any level of call nesting
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   229
// when it's determined that the test has passed, and immediately
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   230
// end the test.
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   231
class TestPassedException extends RuntimeException
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   232
{
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   233
}
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   234
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   235
//*********** End Standard Test Machinery Section **********
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   236
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   237
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   238
//************ Begin classes defined for the test ****************
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   239
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   240
// if want to make listeners, here is the recommended place for them, then instantiate
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   241
//  them in init()
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   242
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   243
/* Example of a class which may be written as part of a test
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   244
class NewClass implements anInterface
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   245
 {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   246
   static int newVar = 0;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   247
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   248
   public void eventDispatched(AWTEvent e)
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   249
    {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   250
      //Counting events to see if we get enough
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   251
      eventCount++;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   252
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   253
      if( eventCount == 20 )
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   254
       {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   255
         //got enough events, so pass
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   256
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   257
         NonFocusableResizableTooSmall.pass();
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   258
       }
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   259
      else if( tries == 20 )
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   260
       {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   261
         //tried too many times without getting enough events so fail
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   262
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   263
         NonFocusableResizableTooSmall.fail();
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   264
       }
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   265
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   266
    }// eventDispatched()
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   267
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   268
 }// NewClass class
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   269
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   270
*/
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   271
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   272
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   273
//************** End classes defined for the test *******************
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   274
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   275
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   276
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   277
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   278
/****************************************************
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   279
 Standard Test Machinery
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   280
 DO NOT modify anything below -- it's a standard
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   281
  chunk of code whose purpose is to make user
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   282
  interaction uniform, and thereby make it simpler
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   283
  to read and understand someone else's test.
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   284
 ****************************************************/
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   285
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   286
/**
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   287
 This is part of the standard test machinery.
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   288
 It creates a dialog (with the instructions), and is the interface
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   289
  for sending text messages to the user.
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   290
 To print the instructions, send an array of strings to Sysout.createDialog
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   291
  WithInstructions method.  Put one line of instructions per array entry.
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   292
 To display a message for the tester to see, simply call Sysout.println
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   293
  with the string to be displayed.
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   294
 This mimics System.out.println but works within the test harness as well
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   295
  as standalone.
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   296
 */
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   297
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   298
class Sysout
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   299
{
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   300
    private static TestDialog dialog;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   301
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   302
    public static void createDialogWithInstructions( String[] instructions )
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   303
    {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   304
        dialog = new TestDialog( new Frame(), "Instructions" );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   305
        dialog.printInstructions( instructions );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   306
        dialog.setVisible(true);
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   307
        println( "Any messages for the tester will display here." );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   308
    }
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   309
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   310
    public static void createDialog( )
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   311
    {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   312
        dialog = new TestDialog( new Frame(), "Instructions" );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   313
        String[] defInstr = { "Instructions will appear here. ", "" } ;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   314
        dialog.printInstructions( defInstr );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   315
        dialog.setVisible(true);
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   316
        println( "Any messages for the tester will display here." );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   317
    }
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   318
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   319
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   320
    public static void printInstructions( String[] instructions )
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   321
    {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   322
        dialog.printInstructions( instructions );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   323
    }
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   324
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   325
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   326
    public static void println( String messageIn )
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   327
    {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   328
        dialog.displayMessage( messageIn );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   329
        System.out.println(messageIn);
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   330
    }
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   331
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   332
}// Sysout  class
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   333
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   334
/**
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   335
  This is part of the standard test machinery.  It provides a place for the
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   336
   test instructions to be displayed, and a place for interactive messages
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   337
   to the user to be displayed.
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   338
  To have the test instructions displayed, see Sysout.
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   339
  To have a message to the user be displayed, see Sysout.
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   340
  Do not call anything in this dialog directly.
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   341
  */
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   342
class TestDialog extends Dialog
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   343
{
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   344
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   345
    TextArea instructionsText;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   346
    TextArea messageText;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   347
    int maxStringLength = 80;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   348
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   349
    //DO NOT call this directly, go through Sysout
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   350
    public TestDialog( Frame frame, String name )
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   351
    {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   352
        super( frame, name );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   353
        int scrollBoth = TextArea.SCROLLBARS_BOTH;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   354
        instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   355
        add( "North", instructionsText );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   356
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   357
        messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   358
        add("Center", messageText);
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   359
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   360
        pack();
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   361
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   362
        setVisible(true);
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   363
    }// TestDialog()
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   364
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   365
    //DO NOT call this directly, go through Sysout
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   366
    public void printInstructions( String[] instructions )
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   367
    {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   368
        //Clear out any current instructions
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   369
        instructionsText.setText( "" );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   370
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   371
        //Go down array of instruction strings
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   372
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   373
        String printStr, remainingStr;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   374
        for( int i=0; i < instructions.length; i++ )
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   375
        {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   376
            //chop up each into pieces maxSringLength long
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   377
            remainingStr = instructions[ i ];
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   378
            while( remainingStr.length() > 0 )
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   379
            {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   380
                //if longer than max then chop off first max chars to print
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   381
                if( remainingStr.length() >= maxStringLength )
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   382
                {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   383
                    //Try to chop on a word boundary
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   384
                    int posOfSpace = remainingStr.
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   385
                        lastIndexOf( ' ', maxStringLength - 1 );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   386
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   387
                    if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   388
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   389
                    printStr = remainingStr.substring( 0, posOfSpace + 1 );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   390
                    remainingStr = remainingStr.substring( posOfSpace + 1 );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   391
                }
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   392
                //else just print
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   393
                else
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   394
                {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   395
                    printStr = remainingStr;
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   396
                    remainingStr = "";
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   397
                }
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   398
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   399
                instructionsText.append( printStr + "\n" );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   400
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   401
            }// while
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   402
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   403
        }// for
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   404
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   405
    }//printInstructions()
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   406
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   407
    //DO NOT call this directly, go through Sysout
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   408
    public void displayMessage( String messageIn )
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   409
    {
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   410
        messageText.append( messageIn + "\n" );
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   411
        System.out.println(messageIn);
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   412
    }
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   413
8be10f1a3d12 6581927: REG : Non focusable frame can be minimized to very small & Frame icon can be seen on frame buttons.
anthony
parents:
diff changeset
   414
}// TestDialog  class