1 26 27 package net.sourceforge.groboutils.uicapture.v1.event; 28 29 import java.awt.Robot ; 30 import java.awt.event.InputEvent ; 31 import java.awt.event.MouseEvent ; 32 33 34 40 public class MouseMovedCaptureEvent extends MouseCaptureEvent 41 { 42 45 private int x = -1; 46 47 50 private int y = -1; 51 52 public MouseMovedCaptureEvent( MouseEvent event ) 53 { 54 super( CE_MOUSE_MOVED, event ); 55 56 this.x = event.getX(); 57 this.y = event.getY(); 58 } 59 60 61 public MouseMovedCaptureEvent( int x, int y ) 62 { 63 super( CE_MOUSE_MOVED ); 64 65 this.x = x; 66 this.y = y; 67 } 68 69 70 public int getX() 71 { 72 return this.x; 73 } 74 75 76 public int getY() 77 { 78 return this.y; 79 } 80 81 82 86 public void performEvent( Robot r ) 87 { 88 super.performEvent( r ); 89 r.mouseMove( getX(), getY() ); 90 } 91 } 92 93 | Popular Tags |