com.partnersoft.v3x.gadgets
Class TwoStepActionSequence

java.lang.Object
  extended by com.partnersoft.v3x.gadgets.TwoStepActionSequence
Direct Known Subclasses:
ThreeStepActionSequence

public class TwoStepActionSequence
extends java.lang.Object

A mechanism for actions involving a specification and action toggle (usually from a button). For example, to delete something on a map, you need to specify the thing you want to move and press the delete button (activating the action). Includes logic for validation of the specified object.


Field Summary
protected  java.lang.Object specified
           
 
Constructor Summary
TwoStepActionSequence()
           
 
Method Summary
 UnaryFunction getAction()
          The function called on the specified item when the ActiveToggle is switched on.
 Toggle getActiveToggle()
          When switched on, this toggle activates the sequence.
 UnaryFunction getRelease()
          The function called on the specified item when the ActiveToggle is switched off.
 SpecificationListener getSpecificationListener()
           
protected  java.lang.Object getSpecified()
           
 UnaryPredicate getValidator()
          The predicate called on the specified item to verify if it is valid for this action sequence.
 Toggle getValidToggle()
          Indicates whether the current specified item is considered valid for the sequence.
 void setAction(UnaryFunction newAction)
          The function called on the specified item when the ActiveToggle is switched on.
protected  void setActiveToggle(Toggle newToggle)
           
 void setRelease(UnaryFunction newRelease)
          The function called on the specified item when the ActiveToggle is switched off.
 void setValidator(UnaryPredicate newValidator)
          The predicate called on the specified item to verify if it is valid for this action sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

specified

protected java.lang.Object specified
Constructor Detail

TwoStepActionSequence

public TwoStepActionSequence()
Method Detail

getSpecificationListener

public SpecificationListener getSpecificationListener()

getActiveToggle

public Toggle getActiveToggle()
When switched on, this toggle activates the sequence.


getValidToggle

public Toggle getValidToggle()
Indicates whether the current specified item is considered valid for the sequence.


getAction

public UnaryFunction getAction()
The function called on the specified item when the ActiveToggle is switched on.


setAction

public void setAction(UnaryFunction newAction)
The function called on the specified item when the ActiveToggle is switched on.


getRelease

public UnaryFunction getRelease()
The function called on the specified item when the ActiveToggle is switched off.


setRelease

public void setRelease(UnaryFunction newRelease)
The function called on the specified item when the ActiveToggle is switched off.


getValidator

public UnaryPredicate getValidator()
The predicate called on the specified item to verify if it is valid for this action sequence.


setValidator

public void setValidator(UnaryPredicate newValidator)
The predicate called on the specified item to verify if it is valid for this action sequence.


getSpecified

protected java.lang.Object getSpecified()

setActiveToggle

protected void setActiveToggle(Toggle newToggle)