46
47 public native void create();
48 public native void mouseMoveImpl(int x, int y);
49 @Override
50 public void mouseMove(int x, int y) {
51 mouseMoveImpl(x, y);
52 }
53 @Override
54 public native void mousePress(int buttons);
55 @Override
56 public native void mouseRelease(int buttons);
57 @Override
58 public native void mouseWheel(int wheelAmt);
59
60 @Override
61 public native void keyPress( int keycode );
62 @Override
63 public native void keyRelease( int keycode );
64
65 @Override
66 public int getRGBPixel(int x, int y) {
67 // See 7002846: that's ineffective, but works correctly with non-opaque windows
68 return getRGBPixels(new Rectangle(x, y, 1, 1))[0];
69 }
70
71 @Override
72 public int [] getRGBPixels(Rectangle bounds) {
73 int pixelArray[] = new int[bounds.width*bounds.height];
74 getRGBPixels(bounds.x, bounds.y, bounds.width, bounds.height, pixelArray);
75 return pixelArray;
76 }
77
78 private native void getRGBPixels(int x, int y, int width, int height, int pixelArray[]);
79 }
|
46
47 public native void create();
48 public native void mouseMoveImpl(int x, int y);
49 @Override
50 public void mouseMove(int x, int y) {
51 mouseMoveImpl(x, y);
52 }
53 @Override
54 public native void mousePress(int buttons);
55 @Override
56 public native void mouseRelease(int buttons);
57 @Override
58 public native void mouseWheel(int wheelAmt);
59
60 @Override
61 public native void keyPress( int keycode );
62 @Override
63 public native void keyRelease( int keycode );
64
65 @Override
66 public native void keyPressUnicode( int key );
67 @Override
68 public native void keyReleaseUnicode( int key );
69
70 @Override
71 public int getRGBPixel(int x, int y) {
72 // See 7002846: that's ineffective, but works correctly with non-opaque windows
73 return getRGBPixels(new Rectangle(x, y, 1, 1))[0];
74 }
75
76 @Override
77 public int [] getRGBPixels(Rectangle bounds) {
78 int pixelArray[] = new int[bounds.width*bounds.height];
79 getRGBPixels(bounds.x, bounds.y, bounds.width, bounds.height, pixelArray);
80 return pixelArray;
81 }
82
83 private native void getRGBPixels(int x, int y, int width, int height, int pixelArray[]);
84 }
|