21 * questions.
22 */
23
24 /*
25 @test %I% %E%
26 @bug 6315717
27 @summary verifies that Robot is accepting extra mouse buttons
28 @author Andrei Dmitriev : area=awt.mouse
29 @library ../../regtesthelpers
30 @build Util
31 @run main AcceptExtraMouseButtons
32 */
33
34 //if we do robot.mousePress(InputEvent.BUTTON1_DOWN_MASK) the test must
35 // 1) accept it (i.e. don't throw an IllegalArgumentException
36 // 2) actually post a MouseEvent
37 // Also, Robot should still accept InputEvent.BUTTONx_MASKs
38
39 import java.awt.*;
40 import java.awt.event.*;
41 import sun.awt.SunToolkit;
42 import test.java.awt.regtesthelpers.Util;
43
44 public class AcceptExtraMouseButtons extends Frame {
45 static String tk = Toolkit.getDefaultToolkit().getClass().getName();
46 static Robot robot;
47 static int [] standardButtonMasks = {InputEvent.BUTTON1_MASK,
48 InputEvent.BUTTON2_MASK,
49 InputEvent.BUTTON3_MASK};
50 static int [] buttonsPressed;
51 static int [] buttonsReleased;
52 static int [] buttonsClicked;
53
54 static int buttonsNum = MouseInfo.getNumberOfButtons();
55
56 public static void main(String []s){
57
58 //MouseInfo.getNumberOfButtons() reports two more buttons on XToolkit
59 //as they reserved for wheel (both directions).
60 if (tk.equals("sun.awt.X11.XToolkit") || tk.equals("sun.awt.motif.MToolkit")) {
61 buttonsNum = buttonsNum - 2;
|
21 * questions.
22 */
23
24 /*
25 @test %I% %E%
26 @bug 6315717
27 @summary verifies that Robot is accepting extra mouse buttons
28 @author Andrei Dmitriev : area=awt.mouse
29 @library ../../regtesthelpers
30 @build Util
31 @run main AcceptExtraMouseButtons
32 */
33
34 //if we do robot.mousePress(InputEvent.BUTTON1_DOWN_MASK) the test must
35 // 1) accept it (i.e. don't throw an IllegalArgumentException
36 // 2) actually post a MouseEvent
37 // Also, Robot should still accept InputEvent.BUTTONx_MASKs
38
39 import java.awt.*;
40 import java.awt.event.*;
41 import test.java.awt.regtesthelpers.Util;
42
43 public class AcceptExtraMouseButtons extends Frame {
44 static String tk = Toolkit.getDefaultToolkit().getClass().getName();
45 static Robot robot;
46 static int [] standardButtonMasks = {InputEvent.BUTTON1_MASK,
47 InputEvent.BUTTON2_MASK,
48 InputEvent.BUTTON3_MASK};
49 static int [] buttonsPressed;
50 static int [] buttonsReleased;
51 static int [] buttonsClicked;
52
53 static int buttonsNum = MouseInfo.getNumberOfButtons();
54
55 public static void main(String []s){
56
57 //MouseInfo.getNumberOfButtons() reports two more buttons on XToolkit
58 //as they reserved for wheel (both directions).
59 if (tk.equals("sun.awt.X11.XToolkit") || tk.equals("sun.awt.motif.MToolkit")) {
60 buttonsNum = buttonsNum - 2;
|