2362N/A * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. 1063N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1063N/A * This code is free software; you can redistribute it and/or modify it 1063N/A * under the terms of the GNU General Public License version 2 only, as 1063N/A * published by the Free Software Foundation. 1063N/A * This code is distributed in the hope that it will be useful, but WITHOUT 1063N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1063N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1063N/A * version 2 for more details (a copy is included in the LICENSE file that 1063N/A * You should have received a copy of the GNU General Public License version 1063N/A * 2 along with this work; if not, write to the Free Software Foundation, 1063N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 1063N/A @summary Support for high resolution mouse wheel is still incomplete. AWT panel needs to be supported 1063N/A @author dmitry.cherepanov@...: area=awt.mouse 1063N/A//Manual tests should run as applet tests if possible because they 1063N/A// get their environments cleaned up, including AWT threads, any 1063N/A// test created threads, and any system resources used by the test 1063N/A// such as file descriptors. (This is normally not a problem as 1063N/A// main tests usually run in a separate VM, however on some platforms 1063N/A// such as the Mac, separate VMs are not possible and non-applet 1063N/A// tests will cause problems). Also, you don't have to worry about 1063N/A// synchronisation stuff in Applet tests the way you do in main 1063N/A //Declare things used in the test, like buttons and labels here 1063N/A //Create instructions for the user here, as well as set up 1063N/A // the environment -- set the layout manager, add buttons, 1063N/A " the test is relevant for windows platforms and ",
1063N/A " mouses with high-resolution wheel, please just press pass if it's not the case ",
1063N/A " place the mouse cursor above the green panel and rotate the mouse wheel " ,
1063N/A " the test will print all mouse wheel messages into the logging panel, ",
1063N/A " please make sure that some of the messages have non-zero 'wheelRotation' value ",
1063N/A " in this case the test passes, otherwise it fails, ",
1063N/A " please make sure the test works OK if the mouse wheel is rotated very slow " 1063N/A //Get things going. Request focus, set size, et cetera 1063N/A //What would normally go into main() will probably go here. 1063N/A //Use System.out.println for diagnostic messages that you want 1063N/A // to read after the test is done. 1063N/A //Use Sysout.println for messages you want the tester to read. 1063N/A //The rest of this class is the actions which perform the test... 1063N/A //Use Sysout.println to communicate with the user NOT System.out!! 1063N/A //Sysout.println ("Something Happened!"); 1063N/A/* Place other classes related to the test after this line */ 1063N/A/**************************************************** 1063N/A DO NOT modify anything below -- it's a standard 1063N/A chunk of code whose purpose is to make user 1063N/A interaction uniform, and thereby make it simpler 1063N/A to read and understand someone else's test. 1063N/A ****************************************************/ 1063N/A This is part of the standard test machinery. 1063N/A It creates a dialog (with the instructions), and is the interface 1063N/A for sending text messages to the user. 1063N/A To print the instructions, send an array of strings to Sysout.createDialog 1063N/A WithInstructions method. Put one line of instructions per array entry. 1063N/A To display a message for the tester to see, simply call Sysout.println 1063N/A with the string to be displayed. 1063N/A This mimics System.out.println but works within the test harness as well 1063N/A This is part of the standard test machinery. It provides a place for the 1063N/A test instructions to be displayed, and a place for interactive messages 1063N/A to the user to be displayed. 1063N/A To have the test instructions displayed, see Sysout. 1063N/A To have a message to the user be displayed, see Sysout. 1063N/A Do not call anything in this dialog directly. 1063N/A //DO NOT call this directly, go through Sysout 1063N/A //DO NOT call this directly, go through Sysout 1063N/A //Clear out any current instructions 1063N/A //Go down array of instruction strings 1063N/A //chop up each into pieces maxSringLength long 1063N/A //if longer than max then chop off first max chars to print 1063N/A //Try to chop on a word boundary 1063N/A //DO NOT call this directly, go through Sysout