de.lessvoid.nifty.render
Class NiftyMouseImpl

java.lang.Object
  extended by de.lessvoid.nifty.render.NiftyMouseImpl
All Implemented Interfaces:
NiftyMouse

public class NiftyMouseImpl
extends Object
implements NiftyMouse


Constructor Summary
NiftyMouseImpl(RenderDevice renderDevice, InputSystem inputSystem, TimeProvider timeProvider)
           
 
Method Summary
 void enableMouseCursor(String id)
          Enable the given MouseCursor.
 String getCurrentId()
          Get the current mouse cursor id or null if no mouse cursor is set.
 long getNoMouseMovementTime()
          This returns the time in ms that no mouse movement has occurred.
 int getX()
          Get the current mouse position x coordinate.
 int getY()
          Get the current mouse position y coordinate.
 void registerMouseCursor(String id, String filename, int hotspotX, int hotspotY)
          Register, load and prepare the given file for use as a mouse cursor later.
 void resetMouseCursor()
          Reset the mouse cursor back to the native one.
 void setMousePosition(int x, int y)
          Set the mouse position to the given x, y coordinate with (0,0) being the upper left corner of the screen.
 void unregisterAll()
          This unregisters all mouse cursors and disposes all resources that might have been allocated.
 void updateMousePosition(int x, int y)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NiftyMouseImpl

public NiftyMouseImpl(RenderDevice renderDevice,
                      InputSystem inputSystem,
                      TimeProvider timeProvider)
Method Detail

registerMouseCursor

public void registerMouseCursor(String id,
                                String filename,
                                int hotspotX,
                                int hotspotY)
                         throws IOException
Description copied from interface: NiftyMouse
Register, load and prepare the given file for use as a mouse cursor later.

Specified by:
registerMouseCursor in interface NiftyMouse
Parameters:
id - id of mouse cursor for later reference
filename - the image to load.
hotspotX - the hotspot x coordinate of the cursor image with 0 being left
hotspotY - the hotspot y coordinate of the cursor image with 0 being top
Throws:
IOException

getCurrentId

public String getCurrentId()
Description copied from interface: NiftyMouse
Get the current mouse cursor id or null if no mouse cursor is set.

Specified by:
getCurrentId in interface NiftyMouse
Returns:
mouse cursor id or null

unregisterAll

public void unregisterAll()
Description copied from interface: NiftyMouse
This unregisters all mouse cursors and disposes all resources that might have been allocated.

Specified by:
unregisterAll in interface NiftyMouse

resetMouseCursor

public void resetMouseCursor()
Description copied from interface: NiftyMouse
Reset the mouse cursor back to the native one. This disables a currently enabled custom mouse cursor.

Specified by:
resetMouseCursor in interface NiftyMouse

enableMouseCursor

public void enableMouseCursor(String id)
Description copied from interface: NiftyMouse
Enable the given MouseCursor.

Specified by:
enableMouseCursor in interface NiftyMouse
Parameters:
id - the cursor id to enable

setMousePosition

public void setMousePosition(int x,
                             int y)
Description copied from interface: NiftyMouse
Set the mouse position to the given x, y coordinate with (0,0) being the upper left corner of the screen.

Specified by:
setMousePosition in interface NiftyMouse
Parameters:
x - x coordinate
y - y coordinage

getX

public int getX()
Description copied from interface: NiftyMouse
Get the current mouse position x coordinate.

Specified by:
getX in interface NiftyMouse
Returns:
x mouse x coordinate

getY

public int getY()
Description copied from interface: NiftyMouse
Get the current mouse position y coordinate.

Specified by:
getY in interface NiftyMouse
Returns:
y mouse y coordinate

getNoMouseMovementTime

public long getNoMouseMovementTime()
Description copied from interface: NiftyMouse
This returns the time in ms that no mouse movement has occurred.

Specified by:
getNoMouseMovementTime in interface NiftyMouse
Returns:
the time in ms between now and the last time the mouse have been moved

updateMousePosition

public void updateMousePosition(int x,
                                int y)


Copyright © 2012. All Rights Reserved.