org.argouml.model
Class ModelCommand

java.lang.Object
  extended by org.argouml.model.ModelCommand
Direct Known Subclasses:
DummyModelCommand

public abstract class ModelCommand
extends java.lang.Object

A command to record the state of an object before an undoable change.

The model implementation should create a ModelCommand for any undoable operation performed. Any mutator method should normally be undoable except loading a model from file.


Constructor Summary
ModelCommand()
           
 
Method Summary
abstract  java.lang.Object execute()
          Execute this command.
abstract  boolean isRedoable()
          Determine whether the command can be redone once undone.
abstract  boolean isUndoable()
          Determine whether the command can be undone.
abstract  void undo()
          Undo this command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelCommand

public ModelCommand()
Method Detail

execute

public abstract java.lang.Object execute()
Execute this command.

Returns:
any result generated by this command

isUndoable

public abstract boolean isUndoable()
Determine whether the command can be undone.

Returns:
true if the command can be undone

isRedoable

public abstract boolean isRedoable()
Determine whether the command can be redone once undone.

Returns:
true if the command can be redone

undo

public abstract void undo()
Undo this command.



ArgoUML © 1996-2006ArgoUML HomepageArgoUML Cookbook