|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.input.Input
com.jme.input.MouseInput
com.jmex.awt.input.AWTMouseInput
public class AWTMouseInput
AWTMouseInput
Field Summary | |
---|---|
static int |
WHEEL_AMP
|
Fields inherited from class com.jme.input.MouseInput |
---|
INPUT_AWT, INPUT_LWJGL, listeners |
Constructor Summary | |
---|---|
protected |
AWTMouseInput()
|
Method Summary | |
---|---|
void |
clear()
|
void |
clearButton(int buttonCode)
|
protected void |
destroy()
destroy cleans up the native mouse interface. |
int |
getButtonCount()
|
int |
getButtonIndex(java.lang.String buttonName)
getButtonIndex gets the button code for a given button
name. |
java.lang.String |
getButtonName(int buttonIndex)
getButtonName gets the button name for a given button
code. |
int |
getWheelDelta()
getWheelDelta gets the change in the mouse wheel. |
int |
getWheelRotation()
|
int |
getXAbsolute()
getXAbsolute gets the absolute x axis value. |
int |
getXDelta()
getXDelta gets the change along the x axis. |
int |
getYAbsolute()
getYAbsolute gets the absolute y axis value. |
int |
getYDelta()
getYDelta gets the change along the y axis. |
boolean |
isButtonDown(int buttonCode)
isButtonDown returns true if a given button is pressed,
false if it is not pressed. |
boolean |
isCursorVisible()
isCursorVisible |
boolean |
isDragOnly()
|
boolean |
isEnabled()
|
void |
mouseClicked(java.awt.event.MouseEvent arg0)
|
void |
mouseDragged(java.awt.event.MouseEvent arg0)
|
void |
mouseEntered(java.awt.event.MouseEvent arg0)
|
void |
mouseExited(java.awt.event.MouseEvent arg0)
|
void |
mouseMoved(java.awt.event.MouseEvent arg0)
|
void |
mousePressed(java.awt.event.MouseEvent arg0)
|
void |
mouseReleased(java.awt.event.MouseEvent arg0)
|
void |
mouseWheelMoved(java.awt.event.MouseWheelEvent arg0)
|
void |
setCursorPosition(int x,
int y)
|
void |
setCursorVisible(boolean v)
setCursorVisible sets the visiblity of the hardware cursor. |
void |
setDragOnly(boolean dragOnly)
|
void |
setEnabled(boolean enabled)
|
void |
setHardwareCursor(java.awt.Cursor cursor)
|
void |
setHardwareCursor(java.net.URL file)
setHardwareCursor sets the image to use for the hardware cursor. |
void |
setHardwareCursor(java.net.URL file,
Image[] images,
int[] delays,
int xHotspot,
int yHotspot)
This method will set an animated harware cursor. |
void |
setHardwareCursor(java.net.URL file,
int xHotspot,
int yHotspot)
setHardwareCursor sets the image and hotspot position to use for the hardware cursor. |
void |
setRelativeDelta(java.awt.Component c)
|
static void |
setup(java.awt.Canvas glCanvas,
boolean dragOnly)
Set up a canvas to fire mouse events via the input system. |
void |
update()
Updates the state of the mouse (position and button states). |
Methods inherited from class com.jme.input.MouseInput |
---|
addListener, containsListener, destroyIfInitalized, get, getListeners, getProvider, isInited, removeListener, removeListeners, setProvider, setProvider |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int WHEEL_AMP
Constructor Detail |
---|
protected AWTMouseInput()
Method Detail |
---|
protected void destroy()
MouseInput
destroy
cleans up the native mouse interface.
Destroy is protected now - please is MouseInput.destroyIfInitalized()
.
destroy
in class MouseInput
public int getButtonIndex(java.lang.String buttonName)
MouseInput
getButtonIndex
gets the button code for a given button
name.
getButtonIndex
in class MouseInput
buttonName
- the name to get the code for.
public boolean isButtonDown(int buttonCode)
MouseInput
isButtonDown
returns true if a given button is pressed,
false if it is not pressed.
isButtonDown
in class MouseInput
buttonCode
- the button code to check.
public java.lang.String getButtonName(int buttonIndex)
MouseInput
getButtonName
gets the button name for a given button
code.
getButtonName
in class MouseInput
buttonIndex
- the code to get the name for.
public int getWheelDelta()
MouseInput
getWheelDelta
gets the change in the mouse wheel.
getWheelDelta
in class MouseInput
public int getXDelta()
MouseInput
getXDelta
gets the change along the x axis.
getXDelta
in class MouseInput
public int getYDelta()
MouseInput
getYDelta
gets the change along the y axis.
getYDelta
in class MouseInput
public int getXAbsolute()
MouseInput
getXAbsolute
gets the absolute x axis value.
getXAbsolute
in class MouseInput
public int getYAbsolute()
MouseInput
getYAbsolute
gets the absolute y axis value.
getYAbsolute
in class MouseInput
public void update()
MouseInput
update
in class MouseInput
public void setCursorVisible(boolean v)
MouseInput
setCursorVisible
sets the visiblity of the hardware cursor.
setCursorVisible
in class MouseInput
v
- true turns the cursor on false turns it offpublic boolean isCursorVisible()
MouseInput
isCursorVisible
isCursorVisible
in class MouseInput
public void setHardwareCursor(java.net.URL file)
MouseInput
setHardwareCursor
sets the image to use for the hardware cursor.
setHardwareCursor
in class MouseInput
file
- URL to cursor imagepublic void setHardwareCursor(java.awt.Cursor cursor)
public void setHardwareCursor(java.net.URL file, int xHotspot, int yHotspot)
MouseInput
setHardwareCursor
sets the image and hotspot position to use for the hardware cursor.
setHardwareCursor
in class MouseInput
file
- URL to cursor imagexHotspot
- Cursor X hotspot positionyHotspot
- Cursor Y hotspot positionpublic void setHardwareCursor(java.net.URL file, Image[] images, int[] delays, int xHotspot, int yHotspot)
MouseInput
setHardwareCursor
in class MouseInput
file
- in this method file is only used as a key for cursor cashingimages
- the animation framesdelays
- delays between changing each framexHotspot
- from image leftyHotspot
- from image bottompublic void setCursorPosition(int x, int y)
setCursorPosition
in class MouseInput
public int getWheelRotation()
getWheelRotation
in class MouseInput
public int getButtonCount()
getButtonCount
in class MouseInput
public void setRelativeDelta(java.awt.Component c)
public boolean isEnabled()
public void setEnabled(boolean enabled)
enabled
- The enabled to set.public boolean isDragOnly()
public void setDragOnly(boolean dragOnly)
dragOnly
- The dragOnly to set.public void mouseClicked(java.awt.event.MouseEvent arg0)
mouseClicked
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent arg0)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent arg0)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent arg0)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent arg0)
mouseExited
in interface java.awt.event.MouseListener
public void mouseWheelMoved(java.awt.event.MouseWheelEvent arg0)
mouseWheelMoved
in interface java.awt.event.MouseWheelListener
public void mouseDragged(java.awt.event.MouseEvent arg0)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseMoved(java.awt.event.MouseEvent arg0)
mouseMoved
in interface java.awt.event.MouseMotionListener
public static void setup(java.awt.Canvas glCanvas, boolean dragOnly)
glCanvas
- canvas that should be listened todragOnly
- true to enable mouse input to jME only when the mouse is draggedpublic void clear()
clear
in class MouseInput
public void clearButton(int buttonCode)
clearButton
in class MouseInput
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |