com.jme.input.mouse
Class TriggersMouseInputListener

java.lang.Object
  extended by com.jme.input.mouse.TriggersMouseInputListener
All Implemented Interfaces:
MouseInputListener

 class TriggersMouseInputListener
extends java.lang.Object
implements MouseInputListener

Each MouseInputHandlerDevice has an instance of this class which is subscribed at the MouseInput to receive mouse events and forward them to the mouse triggers.


Field Summary
static boolean DO_CLAMP
           
 
Constructor Summary
TriggersMouseInputListener()
           
 
Method Summary
 void activate()
           
(package private)  void add(MouseInputHandlerDevice.MouseAxisTrigger trigger)
           
(package private)  void add(MouseInputHandlerDevice.MouseButtonTrigger trigger)
           
 void deactivate()
           
 boolean isActivated()
           
 void onButton(int button, boolean pressed, int x, int y)
          Called in KeyInput.update() whenever a mouse button is pressed or released.
 void onMove(int xDelta, int yDelta, int newX, int newY)
          Called in KeyInput.update() whenever the mouse is moved.
 void onWheel(int wheelDelta, int x, int y)
          Called in KeyInput.update() whenever the mouse wheel is rotated.
(package private)  void remove(MouseInputHandlerDevice.MouseAxisTrigger trigger)
           
(package private)  void remove(MouseInputHandlerDevice.MouseButtonTrigger trigger)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DO_CLAMP

public static final boolean DO_CLAMP
See Also:
Constant Field Values
Constructor Detail

TriggersMouseInputListener

public TriggersMouseInputListener()
Method Detail

activate

public void activate()

isActivated

public boolean isActivated()

deactivate

public void deactivate()

onButton

public void onButton(int button,
                     boolean pressed,
                     int x,
                     int y)
Description copied from interface: MouseInputListener
Called in KeyInput.update() whenever a mouse button is pressed or released.

Specified by:
onButton in interface MouseInputListener
Parameters:
button - index of the mouse button that was pressed/released
pressed - true if button was pressed, false if released
x - x position of the mouse while button was pressed/released
y - y position of the mouse while button was pressed/released

onWheel

public void onWheel(int wheelDelta,
                    int x,
                    int y)
Description copied from interface: MouseInputListener
Called in KeyInput.update() whenever the mouse wheel is rotated.

Specified by:
onWheel in interface MouseInputListener
Parameters:
wheelDelta - steps the wheel was rotated
x - x position of the mouse while wheel was rotated
y - y position of the mouse while wheel was rotated

onMove

public void onMove(int xDelta,
                   int yDelta,
                   int newX,
                   int newY)
Description copied from interface: MouseInputListener
Called in KeyInput.update() whenever the mouse is moved.

Specified by:
onMove in interface MouseInputListener
Parameters:
xDelta - delta of the x coordinate since the last mouse movement event
yDelta - delta of the y coordinate since the last mouse movement event
newX - x position of the mouse after the mouse was moved
newY - y position of the mouse after the mouse was moved

add

void add(MouseInputHandlerDevice.MouseButtonTrigger trigger)

remove

void remove(MouseInputHandlerDevice.MouseButtonTrigger trigger)

add

void add(MouseInputHandlerDevice.MouseAxisTrigger trigger)

remove

void remove(MouseInputHandlerDevice.MouseAxisTrigger trigger)