View Javadoc
1   package org.newdawn.slick;
2   
3   /**
4    * Description of classes that respond to mouse related input events.
5    * 
6    * @author kevin
7    */
8   public interface MouseListener extends ControlledInputReceiver {
9   
10      /**
11       * Notification that the mouse wheel position was updated.
12       *
13       * @param change The amount of the wheel has moved
14       */
15      public abstract void mouseWheelMoved(int change);
16  
17      /**
18       * Notification that a mouse button was clicked. Due to double click
19       * handling the single click may be delayed slightly. For absolute notification
20       * of single clicks use mousePressed().
21       *
22       * To be absolute this method should only be used when considering double clicks
23       *
24       * @param button The index of the button (starting at 0)
25       * @param x The x position of the mouse when the button was pressed
26       * @param y The y position of the mouse when the button was pressed
27       * @param clickCount The number of times the button was clicked
28       */
29      public abstract void mouseClicked(int button, int x, int y, int clickCount);
30  
31      /**
32       * Notification that a mouse button was pressed.
33       *
34       * @param button The index of the button (starting at 0)
35       * @param x The x position of the mouse when the button was pressed
36       * @param y The y position of the mouse when the button was pressed
37       */
38      public abstract void mousePressed(int button, int x, int y);
39  
40      /**
41       * Notification that a mouse button was released.
42       *
43       * @param button The index of the button (starting at 0)
44       * @param x The x position of the mouse when the button was released
45       * @param y The y position of the mouse when the button was released
46       */
47      public abstract void mouseReleased(int button, int x, int y);
48  
49      /**
50       * Notification that mouse cursor was moved.
51       *
52       * @param oldX The old x position of the mouse
53       * @param oldY The old y position of the mouse
54       * @param newX The new x position of the mouse
55       * @param newY The new y position of the mouse
56       */
57      public abstract void mouseMoved(int oldX, int oldY, int newX, int newY);
58  
59      /**
60       * Notification that mouse cursor was dragged.
61       *
62       * @param oldX The old x position of the mouse
63       * @param oldY The old y position of the mouse
64       * @param newX The new x position of the mouse
65       * @param newY The new y position of the mouse
66       */
67      public abstract void mouseDragged(int oldX, int oldY, int newX, int newY);
68  
69  }