All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class dispatcher.Recovery

java.lang.Object
   |
   +----dispatcher.Recovery

public class Recovery
extends Object
This class maintains the undo/redo ability of the application. The object of this class (single object in the application) holds the array of last actions so that user may undo and redo them.


Variable Index

 o DEL
The action type is delete
 o EDIT
The action type is edit
 o INS
The action type is insert
 o SELECT
The action type is select

Constructor Index

 o Recovery()
Constructs the Recovery object with empty recovery list.

Method Index

 o getRedoNumber()
Returns the remained number of redo actions.
 o getUndoNumber()
Returns the remained number of undo actions.
 o newAction(int, String, int, int, int)
Registers a new action to the recovery list.
 o redo(Graphics)
Redo the last undone action (if possible).
 o reset()
Resets the number of available undo/redo actions.
 o undo(Graphics)
Undo the last action (if possible).

Variables

 o INS
 public static final int INS
The action type is insert

 o DEL
 public static final int DEL
The action type is delete

 o EDIT
 public static final int EDIT
The action type is edit

 o SELECT
 public static final int SELECT
The action type is select

Constructors

 o Recovery
 public Recovery()
Constructs the Recovery object with empty recovery list.

Methods

 o getUndoNumber
 public int getUndoNumber()
Returns the remained number of undo actions.

 o getRedoNumber
 public int getRedoNumber()
Returns the remained number of redo actions.

 o reset
 public void reset()
Resets the number of available undo/redo actions. All recovery information is lost.

 o newAction
 public void newAction(int actionType,
                       String picText,
                       int position,
                       int numberOfShapes,
                       int currOffset)
Registers a new action to the recovery list.

Parameters:
actionType - the action type (INS/DEL/EDIT/SELECT)
picText - the pic text affected by the registered action
position - the index of changed shape in the picture list
numberOfShapes - the number of shapes affected by the registered action
currOffset - the current element adjustment needed for the action
 o undo
 public void undo(Graphics g)
Undo the last action (if possible). Collects the restored pic text and recompiles it.

 o redo
 public void redo(Graphics g)
Redo the last undone action (if possible). Collects the restored pic text and recompiles it.


All Packages  Class Hierarchy  This Package  Previous  Next  Index