Changeset 945
- Timestamp:
- 10/26/12 10:13:40 (12 years ago)
- Location:
- trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/gui
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/gui/MouseButtonDown.java
r927 r945 37 37 * </p> 38 38 * 39 * @see MouseButtonInteraction#MouseButtonInteraction(Button )39 * @see MouseButtonInteraction#MouseButtonInteraction(Button,int,int) 40 40 */ 41 public MouseButtonDown(Button button ) {42 super(button );41 public MouseButtonDown(Button button, int x, int y) { 42 super(button, x, y); 43 43 } 44 44 … … 71 71 public String toString() { 72 72 if (super.getButton() == Button.LEFT) { 73 return "left mouse button down ";73 return "left mouse button down (" + getX() + "," + getY() + ")"; 74 74 } 75 75 else if (super.getButton() == Button.MIDDLE) { 76 return "middle mouse button down ";76 return "middle mouse button down (" + getX() + "," + getY() + ")"; 77 77 } 78 78 else if (super.getButton() == Button.RIGHT) { 79 return "right mouse button down ";79 return "right mouse button down (" + getX() + "," + getY() + ")"; 80 80 } 81 81 else { 82 return "unknown mouse button down ";82 return "unknown mouse button down (" + getX() + "," + getY() + ")"; 83 83 } 84 84 } … … 110 110 public boolean equals(Object obj) { 111 111 if (obj instanceof MouseButtonDown) { 112 return getButton().equals(((MouseButtonDown) obj).getButton()); 112 return 113 getButton().equals(((MouseButtonDown) obj).getButton()) && 114 (getX() == ((MouseButtonDown) obj).getX()) && 115 (getY() == ((MouseButtonDown) obj).getY()); 113 116 } 114 117 return false; … … 122 125 @Override 123 126 public int hashCode() { 124 return getButton().hashCode() ;127 return getButton().hashCode() + getX() + getY(); 125 128 } 126 129 -
trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/gui/MouseButtonInteraction.java
r927 r945 53 53 /** 54 54 * <p> 55 * The x coordinate, where the mouse interaction took place 56 * </p> 57 */ 58 private int x; 59 60 /** 61 * <p> 62 * The y coordinate, where the mouse interaction took place 63 * </p> 64 */ 65 private int y; 66 67 /** 68 * <p> 55 69 * Constructor. Creates a new {@link MouseButtonInteraction} 56 70 * </p> … … 58 72 * @param button 59 73 * the button associated with the interaction 74 * @param x 75 * the x coordinate of where the interaction took place on the target 76 * @param y 77 * the y coordinate of where the interaction took place on the target 60 78 */ 61 public MouseButtonInteraction(Button button ) {79 public MouseButtonInteraction(Button button, int x, int y) { 62 80 this.button = button; 81 this.x = x; 82 this.y = y; 63 83 } 64 84 … … 72 92 public Button getButton() { 73 93 return button; 94 } 95 96 /** 97 * <p> 98 * Returns the x coordinate of where the interaction took place on the target. 99 * </p> 100 * 101 * @return the x coordinate 102 */ 103 public int getX() { 104 return x; 105 } 106 107 /** 108 * <p> 109 * Returns the y coordinate of where the interaction took place on the target. 110 * </p> 111 * 112 * @return the y coordinate 113 */ 114 public int getY() { 115 return y; 74 116 } 75 117 -
trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/gui/MouseButtonUp.java
r927 r945 37 37 * </p> 38 38 * 39 * @see MouseButtonInteraction#MouseButtonInteraction(Button )39 * @see MouseButtonInteraction#MouseButtonInteraction(Button,int,int) 40 40 */ 41 public MouseButtonUp(Button button ) {42 super(button );41 public MouseButtonUp(Button button, int x, int y) { 42 super(button, x, y); 43 43 } 44 44 … … 71 71 public String toString() { 72 72 if (super.getButton() == Button.LEFT) { 73 return "left mouse button up ";73 return "left mouse button up (" + getX() + "," + getY() + ")"; 74 74 } 75 75 else if (super.getButton() == Button.MIDDLE) { 76 return "middle mouse button up ";76 return "middle mouse button up (" + getX() + "," + getY() + ")"; 77 77 } 78 78 else if (super.getButton() == Button.RIGHT) { 79 return "right mouse button up ";79 return "right mouse button up (" + getX() + "," + getY() + ")"; 80 80 } 81 81 else { 82 return "unknown mouse button up ";82 return "unknown mouse button up (" + getX() + "," + getY() + ")"; 83 83 } 84 84 } … … 110 110 public boolean equals(Object obj) { 111 111 if (obj instanceof MouseButtonUp) { 112 return getButton().equals(((MouseButtonUp) obj).getButton()); 112 return 113 getButton().equals(((MouseButtonUp) obj).getButton()) && 114 (getX() == ((MouseButtonUp) obj).getX()) && 115 (getY() == ((MouseButtonUp) obj).getY()); 113 116 } 114 117 return false; … … 122 125 @Override 123 126 public int hashCode() { 124 return getButton().hashCode() ;127 return getButton().hashCode() + getX() + getY(); 125 128 } 126 129 } -
trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/gui/MouseClick.java
r927 r945 37 37 * </p> 38 38 * 39 * @see MouseButtonInteraction#MouseButtonInteraction(Button )39 * @see MouseButtonInteraction#MouseButtonInteraction(Button,int,int) 40 40 */ 41 public MouseClick(Button button ) {42 super(button );41 public MouseClick(Button button, int x, int y) { 42 super(button, x, y); 43 43 } 44 44 … … 71 71 public String toString() { 72 72 if (super.getButton() == Button.LEFT) { 73 return "left mouse click ";73 return "left mouse click (" + getX() + "," + getY() + ")"; 74 74 } 75 75 else if (super.getButton() == Button.MIDDLE) { 76 return "middle mouse click ";76 return "middle mouse click (" + getX() + "," + getY() + ")"; 77 77 } 78 78 else if (super.getButton() == Button.RIGHT) { 79 return "right mouse click ";79 return "right mouse click (" + getX() + "," + getY() + ")"; 80 80 } 81 81 else { 82 return "unknown mouse button click ";82 return "unknown mouse button click (" + getX() + "," + getY() + ")"; 83 83 } 84 84 } … … 110 110 public boolean equals(Object obj) { 111 111 if (obj instanceof MouseClick) { 112 return getButton().equals(((MouseClick) obj).getButton()); 112 return 113 getButton().equals(((MouseClick) obj).getButton()) && 114 (getX() == ((MouseClick) obj).getX()) && 115 (getY() == ((MouseClick) obj).getY()); 113 116 } 114 117 return false; … … 122 125 @Override 123 126 public int hashCode() { 124 return getButton().hashCode() ;127 return getButton().hashCode() + getX() + getY(); 125 128 } 126 129 } -
trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/gui/MouseDoubleClick.java
r927 r945 38 38 * </p> 39 39 * 40 * @see MouseButtonInteraction#MouseButtonInteraction(Button )40 * @see MouseButtonInteraction#MouseButtonInteraction(Button, int, int) 41 41 */ 42 public MouseDoubleClick(Button button ) {43 super(button );42 public MouseDoubleClick(Button button, int x, int y) { 43 super(button, x, y); 44 44 } 45 45 … … 72 72 public String toString() { 73 73 if (super.getButton() == Button.LEFT) { 74 return "left mouse double click ";74 return "left mouse double click (" + getX() + "," + getY() + ")"; 75 75 } 76 76 else if (super.getButton() == Button.MIDDLE) { 77 return "middle mouse double click ";77 return "middle mouse double click (" + getX() + "," + getY() + ")"; 78 78 } 79 79 else if (super.getButton() == Button.RIGHT) { 80 return "right mouse double click ";80 return "right mouse double click (" + getX() + "," + getY() + ")"; 81 81 } 82 82 else { 83 return "unknown mouse button double click ";83 return "unknown mouse button double click (" + getX() + "," + getY() + ")"; 84 84 } 85 85 } … … 111 111 public boolean equals(Object obj) { 112 112 if (obj instanceof MouseDoubleClick) { 113 return getButton().equals(((MouseDoubleClick) obj).getButton()); 113 return 114 getButton().equals(((MouseDoubleClick) obj).getButton()) && 115 (getX() == ((MouseDoubleClick) obj).getX()) && 116 (getY() == ((MouseDoubleClick) obj).getY()); 114 117 } 115 118 return false; … … 123 126 @Override 124 127 public int hashCode() { 125 return getButton().hashCode() ;128 return getButton().hashCode() + getX() + getY(); 126 129 } 127 130 }
Note: See TracChangeset
for help on using the changeset viewer.