1 16 package com.buchuki.ensmer.input.event; 17 18 import java.awt.event.*; 19 20 29 public class EnsmerMouseButtonEvent extends EnsmerMouseEvent { 30 31 37 public EnsmerMouseButtonEvent(int button) { 38 this.button = button; 39 } 40 41 48 public EnsmerMouseButtonEvent(MouseEvent event) { 49 super(event); 50 this.button = event.getButton(); 51 } 52 53 61 @Override 62 public boolean equals(Object obj) { 63 return getClass().equals(obj.getClass()) && ((EnsmerMouseButtonEvent) obj).getButton() == button; 64 } 65 66 72 @Override 73 public int hashCode() { 74 return button + getClass().hashCode(); 75 } 76 77 83 public int getButton() { 84 return button; 85 } 86 87 90 private int button; 91 } 92 93 | Popular Tags |