etomica.action
Class AtomActionTranslateBy

java.lang.Object
  extended by etomica.action.AtomActionTranslateBy
All Implemented Interfaces:
AtomAction, Serializable

public class AtomActionTranslateBy
extends Object
implements AtomAction, Serializable

Moves (translates) an atom by a specified vector amount. To move all atoms in a molecule (or atom group), wrap an instance of this class in an AtomGroupAction.

See Also:
Serialized Form

Constructor Summary
AtomActionTranslateBy(ISpace space)
           
 
Method Summary
 void actionPerformed(IAtom atom)
           
 IVectorMutable getTranslationVector()
          Returns the translation vector, the distance that the atom will be moved by this action.
 void setTranslationVector(IVector translationVector)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AtomActionTranslateBy

public AtomActionTranslateBy(ISpace space)
Method Detail

actionPerformed

public void actionPerformed(IAtom atom)
Specified by:
actionPerformed in interface AtomAction

getTranslationVector

public IVectorMutable getTranslationVector()
Returns the translation vector, the distance that the atom will be moved by this action. Returns the vector used by this instance, not a copy, so any manipulation of the returned vector will affect the action of this instance.


setTranslationVector

public void setTranslationVector(IVector translationVector)
Parameters:
destination - The translation vector to set. A local copy is made of the given vector.