etomica.modifier
Class ModifyAction

java.lang.Object
  extended by etomica.modifier.ModifyAction
All Implemented Interfaces:
IAction, Serializable

public class ModifyAction
extends Object
implements IAction, Serializable

Wraps a Modifier instance so that the modification can be performed as the consequence of an action. Permits for example a modification initiated by a user-interface thread to be executed by the controller thread. Call to setValueForAction stores value for modifier, which is then invoked when a subsequent call to actionPerformed is made.

See Also:
Serialized Form

Constructor Summary
ModifyAction(Modifier modifier)
          Constuctor requires the wrapped Modifier, which is final.
 
Method Summary
 void actionPerformed()
          Executes the setValue method of the wrapped modifier, using the value given in the most recent call to this.setValue.
 Dimension getDimension()
           
 double getValue()
           
 Modifier getWrappedModifier()
           
 void setValueForAction(double newValue)
          Stores the new value to be set by the wrapped modifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModifyAction

public ModifyAction(Modifier modifier)
Constuctor requires the wrapped Modifier, which is final. Default activity group is null, and default targetAction is this.

Method Detail

actionPerformed

public void actionPerformed()
Executes the setValue method of the wrapped modifier, using the value given in the most recent call to this.setValue. Uses zero if this.setValue was not previously invoked.

Specified by:
actionPerformed in interface IAction

setValueForAction

public void setValueForAction(double newValue)
Stores the new value to be set by the wrapped modifier. Value is not set until actionPerformed is invoked.


getValue

public double getValue()

getDimension

public Dimension getDimension()

getWrappedModifier

public Modifier getWrappedModifier()