net.nexttext.input
Class MouseDefault

java.lang.Object
  extended by net.nexttext.input.InputSource
      extended by net.nexttext.input.Mouse
          extended by net.nexttext.input.MouseDefault
All Implemented Interfaces:
Locatable

public class MouseDefault
extends Mouse

The MouseDefault is a Mouse InputSource for Processing which is automatically updated as the sketch is running.


Field Summary
 
Fields inherited from class net.nexttext.input.Mouse
CENTER, LEFT, RIGHT
 
Constructor Summary
MouseDefault(processing.core.PApplet p)
          Builds a MouseDefault.
 
Method Summary
 int getX()
          Get the current x position of the mouse.
 int getY()
          Get the current y position of the mouse.
 boolean isPressed(int button)
          Gets whether the specified mouse button is pressed.
 void mouseEvent(java.awt.event.MouseEvent event)
          Handles a MouseEvent.
 
Methods inherited from class net.nexttext.input.Mouse
getLocation, getPosition
 
Methods inherited from class net.nexttext.input.InputSource
getIterator
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MouseDefault

public MouseDefault(processing.core.PApplet p)
Builds a MouseDefault.

Parameters:
p - the parent PApplet the MouseDefault is added to
Method Detail

getX

public int getX()
Get the current x position of the mouse.

Specified by:
getX in class Mouse

getY

public int getY()
Get the current y position of the mouse.

Specified by:
getY in class Mouse

isPressed

public boolean isPressed(int button)
Gets whether the specified mouse button is pressed.

Specified by:
isPressed in class Mouse
Parameters:
button - is a static button definition.
Returns:
if the specified button is pressed.

mouseEvent

public void mouseEvent(java.awt.event.MouseEvent event)
Handles a MouseEvent.

Registered to be called automatically by the PApplet.

Parameters:
event -