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 import java.awt.event.MouseWheelEvent ; 33 34 35 43 public class MouseWheelCaptureEvent extends MouseCaptureEvent 44 { 45 48 private int rotation = 0; 49 50 public MouseWheelCaptureEvent( MouseWheelEvent event ) 51 { 52 super( CE_MOUSE_WHEEL, (MouseEvent )event ); 53 54 this.rotation = event.getWheelRotation(); 55 } 56 57 58 public MouseWheelCaptureEvent( int rotation ) 59 { 60 super( CE_MOUSE_WHEEL ); 61 62 this.rotation = rotation; 63 } 64 65 66 public int getWheelRotation() 67 { 68 return this.rotation; 69 } 70 71 72 76 public void performEvent( Robot r ) 77 { 78 super.performEvent( r ); 79 r.mouseWheel( getWheelRotation() ); 80 } 81 } 82 83 | Popular Tags |