cdox.gui.undo
Class MoveAction

java.lang.Object
  extended bycdox.gui.undo.MoveAction
All Implemented Interfaces:
DoAction

public class MoveAction
extends java.lang.Object
implements DoAction

This is an action that represents a simple position change. It stores the source and destination points of the move and moves the element to the source position if undone and to the destination position if redone.

Version:
May 16th 2002
Author:
Rutger Bezema, Andreas Schmitz

Constructor Summary
MoveAction(Element e, java.awt.Point src, java.awt.Point dest)
          Makes a new MoveAction with the specified move.
 
Method Summary
 void invalidate()
          This method invalidates the action, which typically means that the undo/redo methods do nothing.
 void redo()
          Sets the position to the destination point.
 void undo()
          Sets the position to the source point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MoveAction

public MoveAction(Element e,
                  java.awt.Point src,
                  java.awt.Point dest)
Makes a new MoveAction with the specified move.

Parameters:
e - the element that has been moved.
src - the original position of the element.
dest - the target position of the element.
Method Detail

undo

public void undo()
Sets the position to the source point.

Specified by:
undo in interface DoAction

redo

public void redo()
Sets the position to the destination point.

Specified by:
redo in interface DoAction

invalidate

public void invalidate()
Description copied from interface: DoAction
This method invalidates the action, which typically means that the undo/redo methods do nothing.

Specified by:
invalidate in interface DoAction