|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mindfusion.diagramming.Command
public abstract class Command
Represents an action that can be undone or redone.
Constructor Summary | |
---|---|
Command(java.lang.String title)
Initializes a new Command instance. |
Method Summary | |
---|---|
void |
addSubCmd(Command cmd)
Adds a command object to a compound command. |
protected boolean |
adopt(Command command)
Merges adjacent commands in the history queue if they are related. |
abstract void |
execute(boolean undoEnabled)
This method is called internally by JDiagram when performing the action. |
protected CommandContext |
getContext()
|
CommandList |
getSubCommands()
Gets a collection of all command objects contained within the composite one. |
java.lang.String |
getTitle()
Gets the title of this command. |
protected boolean |
isContainerOf(Command command)
Determines whether a command has been initiated by this command and should be treated as a derivative. |
void |
redo()
This method is called by the UndoManager when redoing actions. |
void |
setTitle(java.lang.String value)
Sets the command title. |
void |
undo()
This method is called by the UndoManager when undoing actions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Command(java.lang.String title)
Command
instance.
title
- A String
containing the command title.Method Detail |
---|
public abstract void execute(boolean undoEnabled)
undoEnabled
- true
if the undo manager is enabled
at this time, otherwise false
.public void undo()
UndoManager
when undoing actions.
public void redo()
UndoManager
when redoing actions.
protected CommandContext getContext()
public void addSubCmd(Command cmd)
cmd
- A subordinate action that should be executed, undone or
redone together with this command.protected boolean isContainerOf(Command command)
command
- The Command for which to determine whether it is a derivative.
protected boolean adopt(Command command)
command
- The Command that might be adopted by this command.
public java.lang.String getTitle()
String
containing the command's title.public void setTitle(java.lang.String value)
value
- A String
containing the command's title.public CommandList getSubCommands()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |