|
||||||||||
| 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.swt.input.SWTMouseInput
public class SWTMouseInput
Note: portions originally from the jme-swt source.
| Nested Class Summary | |
|---|---|
(package private) static class |
SWTMouseInput.EventType
|
| Field Summary |
|---|
| Fields inherited from class com.jme.input.MouseInput |
|---|
INPUT_AWT, INPUT_LWJGL, listeners |
| Constructor Summary | |
|---|---|
protected |
SWTMouseInput()
|
| Method Summary | |
|---|---|
void |
clear()
|
void |
clearButton(int buttonCode)
|
protected void |
destroy()
destroy cleans up the native mouse interface. |
void |
dragDetected(DragDetectEvent e)
|
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. |
void |
handleEvent(Event e)
|
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 |
mouseDoubleClick(MouseEvent e)
|
void |
mouseDown(MouseEvent e)
|
void |
mouseMove(MouseEvent e)
|
void |
mouseUp(MouseEvent e)
|
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.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. |
static void |
setup(Composite canvas,
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 |
| Constructor Detail |
|---|
protected SWTMouseInput()
| Method Detail |
|---|
protected void destroy()
MouseInputdestroy cleans up the native mouse interface.
Destroy is protected now - please is MouseInput.destroyIfInitalized().
destroy in class MouseInputpublic int getButtonIndex(java.lang.String buttonName)
MouseInputgetButtonIndex gets the button code for a given button
name.
getButtonIndex in class MouseInputbuttonName - the name to get the code for.
public boolean isButtonDown(int buttonCode)
MouseInputisButtonDown returns true if a given button is pressed,
false if it is not pressed.
isButtonDown in class MouseInputbuttonCode - the button code to check.
public java.lang.String getButtonName(int buttonIndex)
MouseInputgetButtonName gets the button name for a given button
code.
getButtonName in class MouseInputbuttonIndex - the code to get the name for.
public int getWheelDelta()
MouseInputgetWheelDelta gets the change in the mouse wheel.
getWheelDelta in class MouseInputpublic int getXDelta()
MouseInputgetXDelta gets the change along the x axis.
getXDelta in class MouseInputpublic int getYDelta()
MouseInputgetYDelta gets the change along the y axis.
getYDelta in class MouseInputpublic int getXAbsolute()
MouseInputgetXAbsolute gets the absolute x axis value.
getXAbsolute in class MouseInputpublic int getYAbsolute()
MouseInputgetYAbsolute gets the absolute y axis value.
getYAbsolute in class MouseInputpublic void update()
MouseInput
update in class MouseInputpublic void setCursorVisible(boolean v)
MouseInputsetCursorVisible sets the visiblity of the hardware cursor.
setCursorVisible in class MouseInputv - true turns the cursor on false turns it offpublic boolean isCursorVisible()
MouseInputisCursorVisible
isCursorVisible in class MouseInputpublic void setHardwareCursor(java.net.URL file)
MouseInputsetHardwareCursor sets the image to use for the hardware cursor.
setHardwareCursor in class MouseInputfile - URL to cursor image
public void setHardwareCursor(java.net.URL file,
int xHotspot,
int yHotspot)
MouseInputsetHardwareCursor sets the image and hotspot position to use for the hardware cursor.
setHardwareCursor in class MouseInputfile - URL to cursor imagexHotspot - Cursor X hotspot positionyHotspot - Cursor Y hotspot position
public void setHardwareCursor(java.net.URL file,
Image[] images,
int[] delays,
int xHotspot,
int yHotspot)
MouseInput
setHardwareCursor in class MouseInputfile - 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 bottom
public void setCursorPosition(int x,
int y)
setCursorPosition in class MouseInputpublic int getWheelRotation()
getWheelRotation in class MouseInputpublic int getButtonCount()
getButtonCount in class MouseInputpublic 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 mouseDoubleClick(MouseEvent e)
public void mouseDown(MouseEvent e)
public void mouseUp(MouseEvent e)
public void mouseMove(MouseEvent e)
public void dragDetected(DragDetectEvent e)
public void handleEvent(Event e)
public static void setup(Composite canvas,
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 MouseInputpublic void clearButton(int buttonCode)
clearButton in class MouseInput
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||