org.minueto.handlers
Interface MinuetoMouseHandler


public interface MinuetoMouseHandler

The MinuetoMouseHanlder is an interface for receiving a mouse event (motion, click) from a MinuetoWindow and handling it.

In other words, the class that will handle mouse input from MinuetoWindow must extend this interface. In turn, that class must be registered with the MinuetoEventQueue.

An event is generated everytime the mouse is clicked or moved. When the handle method on the MinuetoEventQueue is invoked, that event is processed and the appropriate method in MinuetoMouseHandler is invoked.

Since:
Minueto 0.4
See Also:
MinuetoMouse, MinuetoEventQueue

Method Summary
 void handleMouseMove(int x, int y)
          Invoked when the mouse cursor is moved.
 void handleMousePress(int x, int y, int button)
          Invoked when a mouse button is pressed.
 void handleMouseRelease(int x, int y, int button)
          Invoked when a mouse button is released.
 

Method Detail

handleMousePress

void handleMousePress(int x,
                      int y,
                      int button)
Invoked when a mouse button is pressed. The current position of the mouse pointer (relative to the window) and the identity of the button are passed throught the method arguments.

The MinuetoMouse class stores the constants used to identify the mouse buttons.

Parameters:
x - int denoting the X position of the mouse.
y - int denoting the Y position of the mouse.
button - int denoting which button was pressed.
See Also:
MinuetoMouse

handleMouseRelease

void handleMouseRelease(int x,
                        int y,
                        int button)
Invoked when a mouse button is released. The current position of the mouse pointer (relative to the window) and the identity of the button are passed throught the method arguments.

The MinuetoMouse class stores the constants used to identify the mouse buttons.

Parameters:
x - int denoting the X position of the mouse.
y - int denoting the Y position of the mouse.
button - int denoting which button was released.
See Also:
MinuetoMouse

handleMouseMove

void handleMouseMove(int x,
                     int y)
Invoked when the mouse cursor is moved. The current position of the mouse pointer (relative to the window) are passed throught the method arguments.

This method is invoked very often when the mouse is moved. To avoid performance impacts, avoid having expensive (slow) code in this method.

Parameters:
x - int denoting the X position of the mouse.
y - int denoting the Y position of the mouse.
See Also:
MinuetoMouse