|
|
@ -21,23 +21,23 @@ public class CustomRobot extends Robot{ |
|
|
|
BufferedImage scoreCurrentScreen; |
|
|
|
BufferedImage scoreCurrentScreen; |
|
|
|
int[] calibration_data = new int[]{0,0,1,1}; |
|
|
|
int[] calibration_data = new int[]{0,0,1,1}; |
|
|
|
long lastCalibrationTime = 0; |
|
|
|
long lastCalibrationTime = 0; |
|
|
|
GraphicsEnvironment ge; |
|
|
|
public static GraphicsEnvironment ge; |
|
|
|
GraphicsDevice[] gs; |
|
|
|
public static GraphicsDevice[] gs; |
|
|
|
|
|
|
|
|
|
|
|
public CustomRobot() throws AWTException { |
|
|
|
public CustomRobot() throws AWTException { |
|
|
|
super(); |
|
|
|
super(); |
|
|
|
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); |
|
|
|
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); |
|
|
|
GraphicsDevice[] gs = ge.getScreenDevices(); |
|
|
|
GraphicsDevice[] gs = ge.getScreenDevices(); |
|
|
|
this.ge=ge; |
|
|
|
CustomRobot.ge=ge; |
|
|
|
this.gs=gs; |
|
|
|
CustomRobot.gs=gs; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public CustomRobot(GraphicsDevice screen) throws AWTException { |
|
|
|
public CustomRobot(GraphicsDevice screen) throws AWTException { |
|
|
|
super(screen); |
|
|
|
super(screen); |
|
|
|
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); |
|
|
|
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); |
|
|
|
GraphicsDevice[] gs = ge.getScreenDevices(); |
|
|
|
GraphicsDevice[] gs = ge.getScreenDevices(); |
|
|
|
this.ge=ge; |
|
|
|
CustomRobot.ge=ge; |
|
|
|
this.gs=gs; |
|
|
|
CustomRobot.gs=gs; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public synchronized BufferedImage getSizedCapture(Rectangle r) { |
|
|
|
public synchronized BufferedImage getSizedCapture(Rectangle r) { |
|
|
|