< prev index next >
src/java.desktop/windows/classes/sun/awt/windows/WRobotPeer.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -23,13 +23,17 @@
* questions.
*/
package sun.awt.windows;
-import java.awt.*;
+import java.awt.GraphicsDevice;
+import java.awt.Point;
+import java.awt.Rectangle;
import java.awt.peer.RobotPeer;
+import sun.java2d.SunGraphicsEnvironment;
+
final class WRobotPeer extends WObjectPeer implements RobotPeer
{
WRobotPeer() {
create();
}
@@ -46,11 +50,12 @@
public native void create();
public native void mouseMoveImpl(int x, int y);
@Override
public void mouseMove(int x, int y) {
- mouseMoveImpl(x, y);
+ Point point = SunGraphicsEnvironment.convertToDeviceSpace(x, y);
+ mouseMoveImpl(point.x, point.y);
}
@Override
public native void mousePress(int buttons);
@Override
public native void mouseRelease(int buttons);
< prev index next >