jdk/test/java/awt/Mouse/MouseModifiersUnitTest/ExtraButtonDrag.java
author serb
Tue, 12 Nov 2013 20:24:25 +0400
changeset 21596 0e3a39f29dbc
parent 1962 6c293d33645b
child 23010 6dadb192ad81
permissions -rw-r--r--
8027696: Incorrect copyright header in the tests Reviewed-by: alanb, malenkov, mullan
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
21596
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 1962
diff changeset
     1
/*
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 1962
diff changeset
     2
 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 1962
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 1962
diff changeset
     4
 *
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 1962
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 1962
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 1962
diff changeset
     7
 * published by the Free Software Foundation.
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 1962
diff changeset
     8
 *
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 1962
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 1962
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 1962
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 1962
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 1962
diff changeset
    13
 * accompanied this code).
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 1962
diff changeset
    14
 *
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 1962
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 1962
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 1962
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 1962
diff changeset
    18
 *
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 1962
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 1962
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 1962
diff changeset
    21
 * questions.
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 1962
diff changeset
    22
 */
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 1962
diff changeset
    23
1962
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    24
/*
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    25
  @test %I% %E%
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    26
  @bug 6315717
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    27
  @summary verifies that drag events are coming for every button if the property is set to true
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    28
  @author Andrei Dmitriev : area=awt.mouse
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    29
  @run main ExtraButtonDrag
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    30
 */
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    31
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    32
//events from standard should also come
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    33
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    34
import java.awt.*;
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    35
import java.awt.event.*;
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    36
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    37
public class ExtraButtonDrag extends Frame {
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    38
    static String tk = Toolkit.getDefaultToolkit().getClass().getName();
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    39
    static Robot robot;
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    40
    static int [] buttonsPressed;
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    41
    static int [] buttonsReleased;
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    42
    static int [] buttonsClicked;
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    43
    volatile static boolean dragged = false;
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    44
    volatile static boolean moved = false;
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    45
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    46
    public ExtraButtonDrag(){
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    47
        super("ExtraButtonDrag");
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    48
    }
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    49
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    50
    public static void main(String []s){
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    51
        Frame frame = new ExtraButtonDrag();
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    52
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    53
        MouseAdapter ma = new MouseAdapter() {
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    54
                public void mouseDragged(MouseEvent e) {
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    55
                    System.out.println("Dragged "+e);// +" : "+ e.getButton() + " : " +e.getButtonState(e.getButton()));
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    56
                    dragged = true;
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    57
                }
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    58
                public void mouseMoved(MouseEvent e) {
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    59
                    System.out.println("Moved "+e);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    60
                    moved = true;
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    61
                }
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    62
                public void mousePressed(MouseEvent e) {
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    63
                    System.out.println(">>> "+e);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    64
                }
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    65
                public void mouseReleased(MouseEvent e) {
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    66
                    System.out.println(">>> "+e);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    67
                }
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    68
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    69
            };
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    70
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    71
        frame.addMouseMotionListener(ma);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    72
        frame.addMouseListener(ma);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    73
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    74
        frame.setSize(300, 300);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    75
        frame.setVisible(true);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    76
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    77
        int [] buttonMask = new int [MouseInfo.getNumberOfButtons()]; //InputEvent.getButtonMasks();
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    78
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    79
        for (int i = 0; i < MouseInfo.getNumberOfButtons(); i++){
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    80
            buttonMask[i] = InputEvent.getMaskForButton(i+1);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    81
            //            System.out.println("TEST: "+tmp[i]);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    82
        }
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    83
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    84
        try {
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    85
            robot = new Robot();
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    86
            robot.delay(1000);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    87
            Point centerFrame = new Point(frame.getLocationOnScreen().x + frame.getWidth()/2, frame.getLocationOnScreen().y + frame.getHeight()/2);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    88
            Point outboundsFrame = new Point(frame.getLocationOnScreen().x + frame.getWidth()*3/2, frame.getLocationOnScreen().y + frame.getHeight()/2);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    89
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    90
            System.out.println("areExtraMouseButtonsEnabled() == " + Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled() );
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    91
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    92
            for (int i = 0; i < MouseInfo.getNumberOfButtons(); i++){
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    93
                System.out.println("button to drag = " +(i+1) + " : value passed to robot = " +buttonMask[i]);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    94
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    95
                try {
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    96
                    dragMouse(buttonMask[i], centerFrame.x, centerFrame.y, outboundsFrame.x, outboundsFrame.y);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    97
                } catch (IllegalArgumentException e){
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    98
                    throw new RuntimeException("Test failed. Exception occured.", e);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
    99
                }
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   100
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   101
                robot.delay(500);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   102
                //this is a choice-case for X protocol issue: native events from extra buttons doesn't contain
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   103
                // the correct state so it's unable to decide if there is a drag or move. By default we send MOVED event.
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   104
                //XToolkit: extra buttons should report MOVED events only
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   105
                //WToolkit: extra buttons should report DRAGGED events only
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   106
                if (i > 2){ //extra buttons only
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   107
                    if (tk.equals("sun.awt.X11.XToolkit") || tk.equals("sun.awt.motif.MToolkit")) {
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   108
                        if (!moved || dragged) {
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   109
                            throw new RuntimeException("Test failed."+ tk +" Button = " +(i+1) + " moved = "+moved +" : dragged = " +dragged);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   110
                        }
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   111
                    } else { //WToolkit
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   112
                        if (moved || !dragged) {
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   113
                            throw new RuntimeException("Test failed."+ tk +" Button = " +(i+1) + " moved = "+moved +" : dragged = " +dragged);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   114
                        }
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   115
                    }
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   116
                } else {
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   117
                    if (moved || !dragged){
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   118
                        throw new RuntimeException("Test failed. Button = " +(i+1) + " not dragged.");
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   119
                    }
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   120
                }
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   121
            }
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   122
        } catch (Exception e){
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   123
            throw new RuntimeException("", e);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   124
        }
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   125
    }
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   126
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   127
    public static void dragMouse(int button, int x0, int y0, int x1, int y1){
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   128
        int curX = x0;
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   129
        int curY = y0;
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   130
        int dx = x0 < x1 ? 1 : -1;
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   131
        int dy = y0 < y1 ? 1 : -1;
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   132
        robot.mouseMove(x0, y0);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   133
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   134
        robot.delay(200);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   135
        dragged = false;
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   136
        moved = false;
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   137
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   138
        robot.mousePress(button);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   139
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   140
        while (curX != x1){
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   141
            curX += dx;
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   142
            robot.mouseMove(curX, curY);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   143
            robot.delay(5);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   144
        }
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   145
        while (curY != y1 ){
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   146
            curY += dy;
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   147
            robot.mouseMove(curX, curY);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   148
            robot.delay(5);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   149
        }
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   150
        robot.mouseRelease(button);
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   151
    }
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   152
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   153
}
6c293d33645b 6315717: Support for mouse with multiple scroll wheels and 4 or more buttons
dav
parents:
diff changeset
   154