Operations and the Undo/Redo System

The iTools system provides users with the ability to interactively undo and redo actions performed on visualizations or data items. As an iTool developer, you will need to provide some code to support the undo/redo feature; the amount of code required depends largely on the type of operation your operation class performs. The main dividing line is between data-centric operations that act directly on the data that underlies a visualization, and operations that act in a more generalized way, changing some value that may not be directly related to a data item. In most cases, operations that act directly on data are based on the IDLitDataOperation class, whereas operations that are more generalized are based on the IDLitOperation class.

Data-Centric Operations

Undo/redo functionality is handled automatically for data-centric operations based on the IDLitDataOperation class. The following things happen when the user requests an operation:

Generalized Operations

To provide undo/redo functionality, generalized operations (those based on the IDLitOperation class) must provide methods that record the initial and final values of the item being modified, along with methods that use the recorded values to undo or redo the operation. The following things happen when the user requests an operation: