GP.Reactors
Class MouseInteractor

java.lang.Object
  |
  +--GP.Reactors.MouseInteractor
All Implemented Interfaces:
Reactor

public abstract class MouseInteractor
extends java.lang.Object
implements Reactor

This is a mouse interactor that allows you to define actions that happen when the mouse is moved, or its button is pressed or released. You must override thos class to use it.


Constructor Summary
MouseInteractor()
          Build a mouse interactor within the applet.
MouseInteractor(Graphic graphic)
          Builds a mouse interactor within a graphic.
 
Method Summary
 void ButtonMotion()
          Override this method to perform an action while the mouse is being moved with the button pressed.
 void ButtonPress()
          Override this method to perform an action when the mouse button is pressed.
 void ButtonRelease()
          Override this method to perform an action when the mouse button is released
 Position GetPosition()
          Use this function to get the position of the mouse at the time of the call.
 void TurnOff()
          This method is used to make this interactor stop listening to mouse events.
 void TurnOn()
          This method is used to cause this reactor to listen to mouse events.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MouseInteractor

public MouseInteractor()
Build a mouse interactor within the applet.

MouseInteractor

public MouseInteractor(Graphic graphic)
Builds a mouse interactor within a graphic.
Parameters:
container - graphic in which the mouse interactor will respond
Method Detail

ButtonPress

public void ButtonPress()
Override this method to perform an action when the mouse button is pressed.

ButtonRelease

public void ButtonRelease()
Override this method to perform an action when the mouse button is released

ButtonMotion

public void ButtonMotion()
Override this method to perform an action while the mouse is being moved with the button pressed. This method is called until the button is released whether the mouse is inside the graphic or not.

GetPosition

public Position GetPosition()
Use this function to get the position of the mouse at the time of the call.
Returns:
The position of the mouse.

TurnOff

public void TurnOff()
This method is used to make this interactor stop listening to mouse events.
Specified by:
TurnOff in interface Reactor

TurnOn

public void TurnOn()
This method is used to cause this reactor to listen to mouse events.
Specified by:
TurnOn in interface Reactor