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.
-
DEL
- The action type is delete
-
EDIT
- The action type is edit
-
INS
- The action type is insert
-
SELECT
- The action type is select
-
Recovery()
- Constructs the Recovery object with empty recovery list.
-
getRedoNumber()
- Returns the remained number of redo actions.
-
getUndoNumber()
- Returns the remained number of undo actions.
-
newAction(int, String, int, int, int)
- Registers a new action to the recovery list.
-
redo(Graphics)
- Redo the last undone action (if possible).
-
reset()
- Resets the number of available undo/redo actions.
-
undo(Graphics)
- Undo the last action (if possible).
INS
public static final int INS
- The action type is insert
DEL
public static final int DEL
- The action type is delete
EDIT
public static final int EDIT
- The action type is edit
SELECT
public static final int SELECT
- The action type is select
Recovery
public Recovery()
- Constructs the Recovery object with empty recovery list.
getUndoNumber
public int getUndoNumber()
- Returns the remained number of undo actions.
getRedoNumber
public int getRedoNumber()
- Returns the remained number of redo actions.
reset
public void reset()
- Resets the number of available undo/redo actions.
All recovery information is lost.
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
undo
public void undo(Graphics g)
- Undo the last action (if possible).
Collects the restored pic text and recompiles it.
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