Package com.jme3.input.awt
Class AwtMouseInput
java.lang.Object
com.jme3.input.awt.AwtMouseInput
- All Implemented Interfaces:
Input,MouseInput,MouseListener,MouseMotionListener,MouseWheelListener,EventListener
public class AwtMouseInput
extends Object
implements MouseInput, MouseListener, MouseWheelListener, MouseMotionListener
AwtMouseInput-
Field Summary
FieldsFields inherited from interface com.jme3.input.MouseInput
AXIS_WHEEL, AXIS_X, AXIS_Y, BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Ceases listening to events from the device.intReturns the number of buttons the mouse has.longvoidInitializes the native side to listen into events from the device.booleanvoidmouseClicked(MouseEvent awtEvt) voidmouseDragged(MouseEvent awtEvt) voidmouseEntered(MouseEvent awtEvt) voidmouseExited(MouseEvent awtEvt) voidmouseMoved(MouseEvent awtEvt) voidmousePressed(MouseEvent awtEvt) voidmouseReleased(MouseEvent awtEvt) voidmouseWheelMoved(MouseWheelEvent awtEvt) voidsetCursorVisible(boolean visible) Set whether the mouse cursor should be visible or not.voidsetInputListener(RawInputListener listener) Sets the input listener to receive events from this device.voidsetInputSource(Component comp) voidsetNativeCursor(JmeCursor cursor) Sets the cursor to use.voidupdate()Queries the device for input.
-
Field Details
-
WHEEL_AMP
public static int WHEEL_AMP
-
-
Constructor Details
-
AwtMouseInput
public AwtMouseInput()
-
-
Method Details
-
setInputSource
-
initialize
public void initialize()Description copied from interface:InputInitializes the native side to listen into events from the device.- Specified by:
initializein interfaceInput
-
destroy
public void destroy()Description copied from interface:InputCeases listening to events from the device. -
isInitialized
public boolean isInitialized()- Specified by:
isInitializedin interfaceInput- Returns:
- True if the device has been initialized and not destroyed.
- See Also:
-
setInputListener
Description copied from interface:InputSets the input listener to receive events from this device. The appropriate events should be dispatched through the callbacks in RawInputListener.- Specified by:
setInputListenerin interfaceInput- Parameters:
listener- the desired listener
-
getInputTimeNanos
public long getInputTimeNanos()- Specified by:
getInputTimeNanosin interfaceInput- 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:MouseInputSet whether the mouse cursor should be visible or not.- Specified by:
setCursorVisiblein interfaceMouseInput- Parameters:
visible- Whether the mouse cursor should be visible or not.
-
update
public void update()Description copied from interface:InputQueries the device for input. All events should be sent to the RawInputListener set with setInputListener. -
getButtonCount
public int getButtonCount()Description copied from interface:MouseInputReturns the number of buttons the mouse has. Typically 3 for most mice.- Specified by:
getButtonCountin interfaceMouseInput- Returns:
- the number of buttons the mouse has.
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-
mouseWheelMoved
- Specified by:
mouseWheelMovedin interfaceMouseWheelListener
-
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener
-
setNativeCursor
Description copied from interface:MouseInputSets the cursor to use.- Specified by:
setNativeCursorin interfaceMouseInput- Parameters:
cursor- The cursor to use.
-