|
||||||||||
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(org.eclipse.swt.events.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(org.eclipse.swt.widgets.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(org.eclipse.swt.events.MouseEvent e)
|
void |
mouseDown(org.eclipse.swt.events.MouseEvent e)
|
void |
mouseMove(org.eclipse.swt.events.MouseEvent e)
|
void |
mouseUp(org.eclipse.swt.events.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(org.eclipse.swt.widgets.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()
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.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 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(org.eclipse.swt.events.MouseEvent e)
mouseDoubleClick
in interface org.eclipse.swt.events.MouseListener
public void mouseDown(org.eclipse.swt.events.MouseEvent e)
mouseDown
in interface org.eclipse.swt.events.MouseListener
public void mouseUp(org.eclipse.swt.events.MouseEvent e)
mouseUp
in interface org.eclipse.swt.events.MouseListener
public void mouseMove(org.eclipse.swt.events.MouseEvent e)
mouseMove
in interface org.eclipse.swt.events.MouseMoveListener
public void dragDetected(org.eclipse.swt.events.DragDetectEvent e)
dragDetected
in interface org.eclipse.swt.events.DragDetectListener
public void handleEvent(org.eclipse.swt.widgets.Event e)
handleEvent
in interface org.eclipse.swt.widgets.Listener
public static void setup(org.eclipse.swt.widgets.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 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 |