org.xith3d.ui.hud.utils
Class MouseHoverWidgetMover

java.lang.Object
  extended by org.xith3d.ui.hud.utils.WidgetMover
      extended by org.xith3d.ui.hud.utils.MouseHoverWidgetMover

public class MouseHoverWidgetMover
extends WidgetMover

A MouseHoverWidgetMover interpolatedly moves a Widget from its current location to a destination location when the mouse hovers in and out.


Constructor Summary
MouseHoverWidgetMover(Widget widget)
          Creates a new MouseHoverWidgetMover for the given Widget and destination location.
MouseHoverWidgetMover(Widget widget, float destX, float destY, float speed)
          Creates a new MouseHoverWidgetMover for the given Widget and destination location.
MouseHoverWidgetMover(Widget widget, org.openmali.vecmath2.Tuple2f destLocation, float speed)
          Creates a new MouseHoverWidgetMover for the given Widget and destination location.
 
Method Summary
 long getMouseEnteredDelay()
           
 long getMouseLeftDelay()
           
 boolean isBlocked()
          If blocked, any mouse input is ignored.
protected  void onMouseEntered()
          This method is invoked, when the mouse entered the Widget's area.
protected  void onMouseLeft()
          This method is invoked, when the mouse left the Widget's area.
protected  void onMovementStopped()
          This method is invoked when the Widget has reached its destination location.
 void setBlocked(boolean blocked)
          Sets the MouseHoverWidgetMover blocked or unblocked.
 void setMouseEnteredDelay(long delay)
          Sets the delay for the onMouseEntered event.
 void setMouseLeftDelay(long delay)
          Sets the delay for the onMouseLeft event.
 
Methods inherited from class org.xith3d.ui.hud.utils.WidgetMover
getDestinationLocation, getDestinationLocationX, getDestinationLocationY, getSpeed, getStartLocation, getStartLocationX, getStartLocationY, getWidget, invert, isMoving, setDestinationLocation, setDestinationLocation, setSpeed, startMoving
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MouseHoverWidgetMover

public MouseHoverWidgetMover(Widget widget,
                             float destX,
                             float destY,
                             float speed)
Creates a new MouseHoverWidgetMover for the given Widget and destination location.

Parameters:
widget - the Widget to be moved
destX - the destination location x-coordinate
destY - the destination location y-coordinate
speed - the speed for the movement (in units per second)

MouseHoverWidgetMover

public MouseHoverWidgetMover(Widget widget,
                             org.openmali.vecmath2.Tuple2f destLocation,
                             float speed)
Creates a new MouseHoverWidgetMover for the given Widget and destination location.

Parameters:
widget - the Widget to be moved
destLocation - the destination location
speed - the speed for the movement (in units per second)

MouseHoverWidgetMover

public MouseHoverWidgetMover(Widget widget)
Creates a new MouseHoverWidgetMover for the given Widget and destination location.

Parameters:
widget - the Widget to be moved
Method Detail

setBlocked

public void setBlocked(boolean blocked)
Sets the MouseHoverWidgetMover blocked or unblocked. If blocked, any mouse input is ignored.

Parameters:
blocked -

isBlocked

public boolean isBlocked()
If blocked, any mouse input is ignored.

Returns:
if the MouseHoverWidgetMover is blocked or unblocked

setMouseEnteredDelay

public void setMouseEnteredDelay(long delay)
Sets the delay for the onMouseEntered event.

Parameters:
delay -

getMouseEnteredDelay

public long getMouseEnteredDelay()
Returns:
the delay for the onMouseEntered event

setMouseLeftDelay

public void setMouseLeftDelay(long delay)
Sets the delay for the onMouseLeft event.

Parameters:
delay -

getMouseLeftDelay

public long getMouseLeftDelay()
Returns:
the delay for the onMouseLeft event

onMouseEntered

protected void onMouseEntered()
This method is invoked, when the mouse entered the Widget's area.


onMouseLeft

protected void onMouseLeft()
This method is invoked, when the mouse left the Widget's area.


onMovementStopped

protected void onMovementStopped()
This method is invoked when the Widget has reached its destination location.

Overrides:
onMovementStopped in class WidgetMover