gumbo.graphic.input
Interface MouseSensor

All Superinterfaces:
Disposable
All Known Implementing Classes:
AbstractMouseSensor

public interface MouseSensor
extends Disposable

A sensor associated with a mouse input device, which provides position and button status that should be interpreted relative to none or more sensor target spaces. A mouse can be 2D or 3D.

Version:
$Revision: 1.3 $
Author:
Jon Barrilleaux (jonb@jmbaai.com) of JMB and Associates Inc.

Method Summary
 void addMouseTarget(SpaceNode target)
          Adds a target space to be monitored by this sensor.
 BooleanField.EventOut getMouseActiveOut()
          Sends an event when the sensor starts or stops being active on a given sensor target.
 StateSetField.EventOut getMouseButtonsOut()
          Sends an event each time the mouse button state (MouseSensors.BUTTON_???) changes while this sensor is active (see getMouseActiveOut()).
 BooleanField.EventOut getMouseCaptureOut()
          Sends an event when the sensor target captures or releases the mouse inputs (movement and buttons).
 BooleanField.EventIn getMouseEnableIn()
          Enables/disables this sensor.
 Point3Field.EventOut getMouseMoveOut()
          Sends an event each time the mouse position changes while this sensor is active (see getMouseActiveOut()).
 BooleanField.EventOut getMouseOverOut()
          Sends an event when the mouse enters or exists a sensor target area.
 SpaceNodeField.EventOut getMouseSpaceOut()
          Sends an event when the sensor starts being active in a new sensor target space.
 void removeMouseTarget(SpaceNode target)
          Removes a target space being monitored by this sensor.
 
Methods inherited from interface gumbo.util.Disposable
dispose, isDisposed
 

Method Detail

addMouseTarget

public void addMouseTarget(SpaceNode target)
Adds a target space to be monitored by this sensor.

Parameters:
target - Reference to the target. Never null. Duplicates are ignored.

removeMouseTarget

public void removeMouseTarget(SpaceNode target)
Removes a target space being monitored by this sensor.

Parameters:
target - Reference to the target. Never null. Missing are ignored.

getMouseEnableIn

public BooleanField.EventIn getMouseEnableIn()
Enables/disables this sensor. When disabled, status outputs (active, over, capture) will go false if not already false. While disabled, mouse inputs are ignored and there are no outputs. The default is true.


getMouseOverOut

public BooleanField.EventOut getMouseOverOut()
Sends an event when the mouse enters or exists a sensor target area. Note that over should work (and mouse movement and button events should be generated) even if the mouse is captured by another target; otherwise, the drop aspect of drag-and-drop implementations may be affected.


getMouseCaptureOut

public BooleanField.EventOut getMouseCaptureOut()
Sends an event when the sensor target captures or releases the mouse inputs (movement and buttons). Should reflect the true system status as regards mouse capture (which typically starts when a drag starts while over a sensor target).


getMouseSpaceOut

public SpaceNodeField.EventOut getMouseSpaceOut()
Sends an event when the sensor starts being active in a new sensor target space. Sent after active out but before any other output events. Never null while active.


getMouseActiveOut

public BooleanField.EventOut getMouseActiveOut()
Sends an event when the sensor starts or stops being active on a given sensor target. While true, the sensor is actively sending events. Will go true before and false after all other output eventss. Based on the OR of mouse-over and mouse-capture.


getMouseButtonsOut

public StateSetField.EventOut getMouseButtonsOut()
Sends an event each time the mouse button state (MouseSensors.BUTTON_???) changes while this sensor is active (see getMouseActiveOut()). The state set should reflect the true "old" state of the mouse buttons when the sensor becomes active (e.g. a button may be down already). Never null while active.


getMouseMoveOut

public Point3Field.EventOut getMouseMoveOut()
Sends an event each time the mouse position changes while this sensor is active (see getMouseActiveOut()). The position is relative to the current sensor target space (see getMouseSpaceOut()). Never null while active.