com.autodesk.undo
Interface UndoableChange


public interface UndoableChange

This abstract class provides a basis for implementing undoable changes in other classes. Note that if implementations of this class are coded as nested sub-classes these implementations should be declared static. If this is not done, when the instance of the class is written an instance of the enclosing class is also written. (This isn't a bug, it's a feature. If you don't believe that, then reread how sub-classes work.)

See Also:
UndoableEdit

Method Summary
 void die()
          Clean up an UndoableChange item.
 boolean merge(UndoableChange item)
          Attempt to merge two items together.
 void redo()
          Redo a change to an object.
 boolean sameGroup(UndoableChange item)
          Determine if the given item can be included in the same group as the current item.
 void undo()
          Undo a change to an object.
 

Method Detail

undo

void undo()
Undo a change to an object. Implementation of this class use this method to undo a change to an object.


redo

void redo()
Redo a change to an object. Implementations of this class use this method to redo a change on an object.


die

void die()
Clean up an UndoableChange item. This may be called when the change is no longer required by the Undo mechanism. Implementations of this method should clean up any resources that they are holding on to.


merge

boolean merge(UndoableChange item)
Attempt to merge two items together. This is called on each push to see if the stack can be simplified. The method is called for an item on the stack and the passed in item is the new item. Implementations of this method should change the existing item with data from the passed in item. If the merge is successful true should be returned and false otherwise.

Parameters:
item - the item to merge into this one. Will not be null.
Returns:
true of the merge is successful, false if the merge fails or a merge is not possible.

sameGroup

boolean sameGroup(UndoableChange item)
Determine if the given item can be included in the same group as the current item.

Parameters:
item - the item to compare with. Will not be null.
Returns:
true if the two items can be included in the same group, false otherwise.