1 16 package com.buchuki.ensmer.input.event; 17 18 import java.awt.event.*; 19 20 27 public class MouseWheelEvent extends EnsmerMouseEvent implements Measurable { 28 29 32 public MouseWheelEvent() { 33 super(); 34 } 35 36 43 public MouseWheelEvent(java.awt.event.MouseWheelEvent event) { 44 super(event); 45 } 46 47 56 public float getMagnitude() { 57 java.awt.event.MouseWheelEvent evt = (java.awt.event.MouseWheelEvent ) getInputEvent(); 58 if (evt == null) { 59 throw new IllegalStateException ("No MouseWheelEvent to retrieve magnitude from"); 60 } 61 return evt.getWheelRotation(); 62 } 63 64 71 @Override 72 public boolean equals(Object obj) { 73 return getClass().equals(obj.getClass()); 74 } 75 76 82 @Override 83 public int hashCode() { 84 return getClass().hashCode(); 85 } 86 87 } 88 | Popular Tags |