01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: /**
18: * @author Dmitry A. Durnev
19: * @version $Revision$
20: */package org.apache.harmony.awt.wtk;
21:
22: import java.awt.Color;
23: import java.awt.Rectangle;
24: import java.awt.image.BufferedImage;
25:
26: /**
27: * A cross-platform interface for java.awt.Robot implementation
28: */
29: public interface NativeRobot {
30:
31: /**
32: * @see java.awt.Robot#createScreenCapture(Rectangle)
33: * @param screenRect rectangle to capture in screen coordinates
34: * @return the captured image or null if
35: * capture failed.
36: */
37: BufferedImage createScreenCapture(Rectangle screenRect);
38:
39: /**
40: * @see java.awt.Robot#getPixelColor(int, int)
41: */
42: Color getPixel(int x, int y);
43:
44: /**
45: * Generate a native system keyboard input event.
46: * @param keycode A Java virtual key code
47: * @param press A key is pressed if true, released otherwise
48: * @see java.awt.Robot#keyPress(int)
49: * @throws IllegalArgumentException if keycode is invalid in the native system
50: */
51: void keyEvent(int keycode, boolean press);
52:
53: /**
54: * Generate a native system mouse button(s) press or release event.
55: * @param buttons A mask of Java mouse button flags
56: * @param press buttons are pressed if true, released otherwise
57: * @see java.awt.Robot#mousePress(int)
58: */
59: void mouseButton(int buttons, boolean press);
60:
61: /**
62: * Generate a native system mouse motion event.
63: *
64: * @see java.awt.Robot#mouseMove(int, int)
65: */
66: void mouseMove(int x, int y);
67:
68: /**
69: * Generate a native system mouse wheel event.
70: *
71: * @see java.awt.Robot#mouseWheel(int)
72: */
73: void mouseWheel(int wheelAmt);
74: }
|