| java.lang.Object jimm.datavision.gui.cmd.CommandHistory
CommandHistory | public class CommandHistory (Code) | | A command history holds comands and manages undo and redo behavior. To
use a new command for the first time, pass it to perform .
You can then call undo and redo to walk the
command history chain.
author: Jim Menard, jimm@io.com |
baselineIndex | protected int baselineIndex(Code) | | If the command index is different than the baseline index then something
has changed, and isChanged will return true .
|
commandIndex | protected int commandIndex(Code) | | |
CommandHistory | public CommandHistory()(Code) | | |
add | public synchronized void add(Command command)(Code) | | Add a command to the history list without performing it. If the history
cursor is not at the top of the stack, first erase all of the
commands after the cursor.
Parameters: command - the command to add |
canRedo | public boolean canRedo()(Code) | | Answers the question, "Is there anything to redo?"
|
canUndo | public boolean canUndo()(Code) | | Answers the question, "Is there anything to undo?"
|
getCommandName | public String getCommandName(int index)(Code) | | Return the name of the command at index. Returns null
if there is no such command.
|
getRedoName | public String getRedoName()(Code) | | Return the name of the command that would be redone were one to call
redo(). Returns null if there is no such command.
|
getUndoName | public String getUndoName()(Code) | | Return the name of the command that would be undone were one to call
undo(). Returns null if there is no such command.
|
isChanged | public boolean isChanged()(Code) | | Answers the question, "Has anything changed?"
|
perform | public synchronized void perform(Command command)(Code) | | Perform a command and add it to the history list. If the history
cursor is not at the top of the stack, first erase all of the
commands after the cursor.
Parameters: command - the command to perform |
redo | public synchronized void redo()(Code) | | Redo the command under the the history cursor.
|
setBaseline | public void setBaseline()(Code) | | Resets the baseline index. The method isChanged returns
false only when the baseline index is equal to the
current command index.
|
undo | public synchronized void undo()(Code) | | Undo the command at the history cursor.
|
updateMenu | protected void updateMenu()(Code) | | |
|
|