public class DefaultUndoRedoCommandStack extends Object implements UndoRedoCommandStack
Constructor and Description |
---|
DefaultUndoRedoCommandStack() |
Modifier and Type | Method and Description |
---|---|
void |
add(Command command) |
void |
addObserver(Observer o) |
boolean |
canRedo()
If a redo can be performed on the stack.
|
boolean |
canUndo()
If an undo can be performed on the stack.
|
void |
clear() |
void |
deleteObserver(Observer o) |
void |
deleteObservers() |
void |
endComplex() |
Command |
getNextRedoCommand() |
Command |
getNextUndoCommand() |
List |
getRedoInfos()
Returns the list of UndoRedoInfo in the REDO stack
|
List |
getUndoInfos()
Returns the list of UndoRedoInfo in the UNDO stack
|
boolean |
inComplex() |
void |
redo()
Re-does the following redoable elements.
|
void |
redo(int commands)
Re-does a number of the following redoable element.
|
int |
size() |
void |
startComplex(String description) |
void |
undo()
Undoes the following undoable elements.
|
void |
undo(int commands)
Undoes a number of the following undoable elements.
|
public void add(Command command)
add
in interface UndoRedoCommandStack
public void undo() throws UndoException
UndoRedoStack
undo
in interface UndoRedoStack
UndoException
- if there is an error performing de undo elementpublic void redo() throws RedoException
UndoRedoStack
redo
in interface UndoRedoStack
RedoException
- if there is an error performing de redo elementpublic void redo(int commands) throws RedoException
UndoRedoStack
redo
in interface UndoRedoStack
commands
- the number of elements to redoRedoException
- if there is an error performing de redo elementpublic void undo(int commands) throws UndoException
UndoRedoStack
undo
in interface UndoRedoStack
commands
- the number of elements to undoUndoException
- if there is an error performing de undo elementpublic boolean canUndo()
UndoRedoStack
canUndo
in interface UndoRedoStack
public boolean canRedo()
UndoRedoStack
canRedo
in interface UndoRedoStack
public List getUndoInfos()
UndoRedoStack
getUndoInfos
in interface UndoRedoStack
public List getRedoInfos()
UndoRedoStack
getRedoInfos
in interface UndoRedoStack
public int size()
size
in interface UndoRedoCommandStack
public void clear()
clear
in interface UndoRedoCommandStack
public Command getNextUndoCommand()
getNextUndoCommand
in interface UndoRedoCommandStack
public Command getNextRedoCommand()
getNextRedoCommand
in interface UndoRedoCommandStack
public void addObserver(Observer o)
addObserver
in interface Observable
public void deleteObserver(Observer o)
deleteObserver
in interface Observable
public void deleteObservers()
deleteObservers
in interface Observable
public void endComplex()
endComplex
in interface UndoRedoCommandStack
public void startComplex(String description)
startComplex
in interface UndoRedoCommandStack
public boolean inComplex()
inComplex
in interface UndoRedoCommandStack