|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.nexttext.behaviour.AbstractAction net.nexttext.behaviour.control.Condition net.nexttext.behaviour.control.OnDrag
public class OnDrag
A Condition which is true when the TextObject is being dragged by the mouse.
It implements the Locatable interface which returns the location of the mouse offset by the vector between the mouse and the TextObject when the drag started. If the TextObject is moved to this position it is like dragging it with the mouse. The position is that of the last TextObject which was dragged, so it's only appropriate to use this Locatable in the true condition of OnDrag.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface net.nexttext.behaviour.Action |
---|
Action.ActionResult |
Constructor Summary | |
---|---|
OnDrag(Action trueAction)
Creates an OnDrag which performs the given Action when the mouse button 1 is pressed. |
|
OnDrag(Action trueAction,
Action falseAction)
Creates an OnDrag which performs one of the given Actions, depending on whether or not the mouse button 1 is pressed. |
|
OnDrag(int buttonToCheck,
Action trueAction)
Creates an OnDrag which performs the given Action when the selected mouse button is pressed. |
|
OnDrag(int buttonToCheck,
Action trueAction,
Action falseAction)
Creates an OnDrag 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 selected mouse button is pressed over the given TextObject. |
processing.core.PVector |
getLocation()
Gets the target position of the dragged TextObject, if it would follow the mouse. |
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 |
---|
public OnDrag(Action trueAction)
trueAction
- the Action to perform when the mouse button 1 is pressedpublic OnDrag(Action trueAction, Action falseAction)
trueAction
- the Action to perform when the mouse button 1 is pressedfalseAction
- the Action to perform when the mouse button 1 is releasedpublic OnDrag(int buttonToCheck, Action trueAction)
buttonToCheck
- the mouse button to considertrueAction
- the Action to perform when the selected mouse button is pressedpublic OnDrag(int buttonToCheck, Action trueAction, Action falseAction)
buttonToCheck
- the mouse button to considertrueAction
- the Action to perform when the selected mouse button is pressedfalseAction
- the Action to perform when the selected mouse button is releasedMethod Detail |
---|
public boolean condition(TextObject to)
condition
in class Condition
to
- the TextObject to consider
public processing.core.PVector getLocation()
getLocation
in interface Locatable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |