com.jme3.input.awt
Class AwtMouseInput

java.lang.Object
  extended by com.jme3.input.awt.AwtMouseInput
All Implemented Interfaces:
Input, MouseInput, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.util.EventListener

public class AwtMouseInput
extends java.lang.Object
implements MouseInput, java.awt.event.MouseListener, java.awt.event.MouseWheelListener, java.awt.event.MouseMotionListener

AwtMouseInput


Field Summary
static int WHEEL_AMP
           
 
Fields inherited from interface com.jme3.input.MouseInput
AXIS_WHEEL, AXIS_X, AXIS_Y, BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT
 
Constructor Summary
AwtMouseInput()
           
 
Method Summary
 void destroy()
          Ceases listening to events from the device.
 int getButtonCount()
          Returns the number of buttons the mouse has.
 long getInputTimeNanos()
           
 void initialize()
          Initializes the native side to listen into events from the device.
 boolean isInitialized()
           
 void mouseClicked(java.awt.event.MouseEvent awtEvt)
           
 void mouseDragged(java.awt.event.MouseEvent awtEvt)
           
 void mouseEntered(java.awt.event.MouseEvent awtEvt)
           
 void mouseExited(java.awt.event.MouseEvent awtEvt)
           
 void mouseMoved(java.awt.event.MouseEvent awtEvt)
           
 void mousePressed(java.awt.event.MouseEvent awtEvt)
           
 void mouseReleased(java.awt.event.MouseEvent awtEvt)
           
 void mouseWheelMoved(java.awt.event.MouseWheelEvent awtEvt)
           
 void setCursorVisible(boolean visible)
          Set whether the mouse cursor should be visible or not.
 void setInputListener(RawInputListener listener)
          Sets the input listener to receive events from this device.
 void setInputSource(java.awt.Component comp)
           
 void setNativeCursor(JmeCursor cursor)
          Sets the cursor to use.
 void update()
          Queries the device for input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WHEEL_AMP

public static int WHEEL_AMP
Constructor Detail

AwtMouseInput

public AwtMouseInput()
Method Detail

setInputSource

public void setInputSource(java.awt.Component comp)

initialize

public void initialize()
Description copied from interface: Input
Initializes the native side to listen into events from the device.

Specified by:
initialize in interface Input

destroy

public void destroy()
Description copied from interface: Input
Ceases listening to events from the device.

Specified by:
destroy in interface Input

isInitialized

public boolean isInitialized()
Specified by:
isInitialized in interface Input
Returns:
True if the device has been initialized and not destroyed.
See Also:
Input.initialize(), Input.destroy()

setInputListener

public void setInputListener(RawInputListener listener)
Description copied from interface: Input
Sets the input listener to receive events from this device. The appropriate events should be dispatched through the callbacks in RawInputListener.

Specified by:
setInputListener in interface Input

getInputTimeNanos

public long getInputTimeNanos()
Specified by:
getInputTimeNanos in interface Input
Returns:
The current absolute time as nanoseconds. This time is expected to be relative to the time given in InputEvents time property.

setCursorVisible

public void setCursorVisible(boolean visible)
Description copied from interface: MouseInput
Set whether the mouse cursor should be visible or not.

Specified by:
setCursorVisible in interface MouseInput
Parameters:
visible - Whether the mouse cursor should be visible or not.

update

public void update()
Description copied from interface: Input
Queries the device for input. All events should be sent to the RawInputListener set with setInputListener.

Specified by:
update in interface Input
See Also:
Input.setInputListener(com.jme3.input.RawInputListener)

getButtonCount

public int getButtonCount()
Description copied from interface: MouseInput
Returns the number of buttons the mouse has. Typically 3 for most mice.

Specified by:
getButtonCount in interface MouseInput
Returns:
the number of buttons the mouse has.

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent awtEvt)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent awtEvt)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent awtEvt)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent awtEvt)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent awtEvt)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseWheelMoved

public void mouseWheelMoved(java.awt.event.MouseWheelEvent awtEvt)
Specified by:
mouseWheelMoved in interface java.awt.event.MouseWheelListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent awtEvt)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent awtEvt)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

setNativeCursor

public void setNativeCursor(JmeCursor cursor)
Description copied from interface: MouseInput
Sets the cursor to use.

Specified by:
setNativeCursor in interface MouseInput
Parameters:
cursor - The cursor to use.