net.nexttext.behaviour.control
Class OnMouseDepressed

java.lang.Object
  extended by net.nexttext.behaviour.AbstractAction
      extended by net.nexttext.behaviour.control.Condition
          extended by net.nexttext.behaviour.control.OnMouseDepressed
All Implemented Interfaces:
Action
Direct Known Subclasses:
OnMousePressed, OnMouseReleased

public class OnMouseDepressed
extends Condition

A Condition which is true when a mouse button is down and false when a mouse button is up.


Nested Class Summary
 
Nested classes/interfaces inherited from interface net.nexttext.behaviour.Action
Action.ActionResult
 
Constructor Summary
OnMouseDepressed(Action trueAction)
          Creates an OnMouseDepressed which performs the given Action when the mouse button 1 is pressed.
OnMouseDepressed(Action trueAction, Action falseAction)
          Creates an OnMouseDepressed which performs one of the given Actions, depending on whether or not the mouse button 1 is pressed.
OnMouseDepressed(int buttonToCheck, Action trueAction)
          Creates an OnMouseDepressed which performs the given Action when the selected mouse button is pressed.
OnMouseDepressed(int buttonToCheck, Action trueAction, Action falseAction)
          Creates an OnMouseDepressed which performs one of the given Actions, depending on whether or not the selected mouse button is pressed.
 
Method Summary
 boolean condition(TextObject to)
          Checks whether or not the mouse is over the given TextObject.
 
Methods inherited from class net.nexttext.behaviour.control.Condition
behave, complete, getRequiredProperties
 
Methods inherited from class net.nexttext.behaviour.AbstractAction
behave, behave, getDisplayName, makeBehaviour, properties, setDisplayName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OnMouseDepressed

public OnMouseDepressed(Action trueAction)
Creates an OnMouseDepressed which performs the given Action when the mouse button 1 is pressed.

Parameters:
trueAction - the Action to perform when the mouse button 1 is pressed

OnMouseDepressed

public OnMouseDepressed(Action trueAction,
                        Action falseAction)
Creates an OnMouseDepressed which performs one of the given Actions, depending on whether or not the mouse button 1 is pressed.

Parameters:
trueAction - the Action to perform when the mouse button 1 is pressed
falseAction - the Action to perform when the mouse button 1 is released

OnMouseDepressed

public OnMouseDepressed(int buttonToCheck,
                        Action trueAction)
Creates an OnMouseDepressed which performs the given Action when the selected mouse button is pressed.

Parameters:
buttonToCheck - the mouse button to consider
trueAction - the Action to perform when the selected mouse button is pressed

OnMouseDepressed

public OnMouseDepressed(int buttonToCheck,
                        Action trueAction,
                        Action falseAction)
Creates an OnMouseDepressed which performs one of the given Actions, depending on whether or not the selected mouse button is pressed.

Parameters:
buttonToCheck - the mouse button to consider
trueAction - the Action to perform when the selected mouse button is pressed
falseAction - the Action to perform when the selected mouse button is released
Method Detail

condition

public boolean condition(TextObject to)
Checks whether or not the mouse is over the given TextObject.

Specified by:
condition in class Condition
Parameters:
to - the TextObject to consider
Returns:
the outcome of the condition