com.jme.input.dummy
Class DummyMouseInput

java.lang.Object
  extended by com.jme.input.Input
      extended by com.jme.input.MouseInput
          extended by com.jme.input.dummy.DummyMouseInput

public class DummyMouseInput
extends MouseInput

Mouse input handler that is a Dummy input.

Version:
$Id: DummyMouseInput.java 4310 2009-05-01 13:53:42Z blaine.dev $
Author:
Kai Börnert
See Also:
Cursor, Mouse

Field Summary
 
Fields inherited from class com.jme.input.MouseInput
INPUT_AWT, INPUT_LWJGL, listeners
 
Constructor Summary
protected DummyMouseInput()
          Constructor creates a new DummyMouseInput object.
 
Method Summary
 void clear()
           
 void clearButton(int buttonCode)
           
 void destroy()
          destroy does nothing at all
 int getButtonCount()
          We return the values for a simple standartmouse here.
 int getButtonIndex(java.lang.String buttonName)
          getButtonIndex returns 0;
 java.lang.String getButtonName(int buttonIndex)
          getButtonName returns the name of a given button index.
 int getWheelDelta()
          getWheelDelta retrieves the change of the mouse wheel, if any.
 int getWheelRotation()
           
 int getXAbsolute()
          getXAbsolute gets the absolute x axis value (Always 0 for Dummymouse).
 int getXDelta()
          getXDelta retrieves the change of the x position, if any.
 int getYAbsolute()
          getYAbsolute gets the absolute y axis value.(Always 0 for Dummymouse)
 int getYDelta()
          getYDelta retrieves the change of the y position, if any.
 boolean isButtonDown(int buttonCode)
          isButtonDown returns false, the Dummymouse can't be pressed.
 boolean isCursorVisible()
          isCursorVisible Returns false, can you see a DummyMouse?.
 void setCursorPosition(int x, int y)
           
 void setCursorVisible(boolean v)
          setCursorVisible sets the visiblity of the hardware cursor, since it's a Dummymouse we don't do anything!.
 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, Dummymouse ignores it
 void setHardwareCursor(java.net.URL file, int xHotspot, int yHotspot)
          Loads and sets a hardware cursor, Dummymouse ignores it
 void update()
          updateState updates the mouse state, in out case it does nothing at all.
 
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

DummyMouseInput

protected DummyMouseInput()
Constructor creates a new DummyMouseInput object.

Method Detail

destroy

public void destroy()
destroy does nothing at all

Specified by:
destroy in class MouseInput
See Also:
MouseInput.destroy()

getButtonIndex

public int getButtonIndex(java.lang.String buttonName)
getButtonIndex returns 0;

Specified by:
getButtonIndex in class MouseInput
Parameters:
buttonName - the name to get the code for.
Returns:
the code for the given button name.
See Also:
MouseInput.getButtonIndex(java.lang.String)

getButtonName

public java.lang.String getButtonName(int buttonIndex)
getButtonName returns the name of a given button index.

Specified by:
getButtonName in class MouseInput
Parameters:
buttonIndex - the code to get the name for.
Returns:
the name for the given button code.
See Also:
MouseInput.getButtonName(int)

isButtonDown

public boolean isButtonDown(int buttonCode)
isButtonDown returns false, the Dummymouse can't be pressed.

Specified by:
isButtonDown in class MouseInput
Parameters:
buttonCode - the button code to check.
Returns:
true if the button is pressed, false otherwise.
See Also:
MouseInput.isButtonDown(int)

getWheelDelta

public int getWheelDelta()
getWheelDelta retrieves the change of the mouse wheel, if any. (There can't be any in ase of a DummyMouse)

Specified by:
getWheelDelta in class MouseInput
Returns:
the change in the mouse wheel.
See Also:
MouseInput.getWheelDelta()

getXDelta

public int getXDelta()
getXDelta retrieves the change of the x position, if any. (Dummymouses can'T move)

Specified by:
getXDelta in class MouseInput
Returns:
the change along the x axis.
See Also:
MouseInput.getXDelta()

getYDelta

public int getYDelta()
getYDelta retrieves the change of the y position, if any. (Dummymouses can'T move)

Specified by:
getYDelta in class MouseInput
Returns:
the change along the y axis.
See Also:
MouseInput.getYDelta()

getXAbsolute

public int getXAbsolute()
getXAbsolute gets the absolute x axis value (Always 0 for Dummymouse).

Specified by:
getXAbsolute in class MouseInput
Returns:
the absolute x axis value.
See Also:
MouseInput.getXAbsolute()

getYAbsolute

public int getYAbsolute()
getYAbsolute gets the absolute y axis value.(Always 0 for Dummymouse)

Specified by:
getYAbsolute in class MouseInput
Returns:
the absolute y axis value.
See Also:
MouseInput.getYAbsolute()

update

public void update()
updateState updates the mouse state, in out case it does nothing at all.

Specified by:
update in class MouseInput
See Also:
MouseInput.update()

setCursorVisible

public void setCursorVisible(boolean v)
setCursorVisible sets the visiblity of the hardware cursor, since it's a Dummymouse we don't do anything!.

Specified by:
setCursorVisible in class MouseInput
Parameters:
v - true turns the cursor on false turns it off
See Also:
MouseInput.setCursorVisible(boolean)

isCursorVisible

public boolean isCursorVisible()
isCursorVisible Returns false, can you see a DummyMouse?.

Specified by:
isCursorVisible in class MouseInput
Returns:
the visibility of the hardware cursor
See Also:
MouseInput.isCursorVisible()

setHardwareCursor

public void setHardwareCursor(java.net.URL file)
Description copied from class: MouseInput
setHardwareCursor sets the image to use for the hardware cursor.

Specified by:
setHardwareCursor in class MouseInput
Parameters:
file - URL to cursor image

setHardwareCursor

public void setHardwareCursor(java.net.URL file,
                              int xHotspot,
                              int yHotspot)
Loads and sets a hardware cursor, Dummymouse ignores it

Specified by:
setHardwareCursor in class MouseInput
Parameters:
url - to imagefile
xHotspot - from image left
yHotspot - from image bottom

setHardwareCursor

public void setHardwareCursor(java.net.URL file,
                              Image[] images,
                              int[] delays,
                              int xHotspot,
                              int yHotspot)
This method will set an animated harware cursor, Dummymouse ignores it

Specified by:
setHardwareCursor in class MouseInput
Parameters:
file - in this method file is only used as a key for cursor cashing
images - the animation frames
delays - delays between changing each frame
xHotspot - from image left
yHotspot - from image bottom

getWheelRotation

public int getWheelRotation()
Specified by:
getWheelRotation in class MouseInput
Returns:
absolte wheel rotation

getButtonCount

public int getButtonCount()
We return the values for a simple standartmouse here.

Specified by:
getButtonCount in class MouseInput
Returns:
number of mouse buttons

setCursorPosition

public void setCursorPosition(int x,
                              int y)
Specified by:
setCursorPosition in class MouseInput

clear

public void clear()
Specified by:
clear in class MouseInput

clearButton

public void clearButton(int buttonCode)
Specified by:
clearButton in class MouseInput