net.refractions.udig.project.command
Interface ProjectCommand


public interface ProjectCommand

A Command in uDig describes an action that modifies the system's model.

Commands are single fire objects. They cannot be used more than once. This is to allow undoable commands to be a normal command, not a special case command.

Commands normally have factories associated with them, but they are also prototypes. The copy method returns a new Command without the undo data. The new Command can safely be executed with no negative side-effects.

Author:
jeichar
See Also:
A set of possible command categories are: zoom, pan, cut, paste, addVertex, etc.. Most commands are associated with tool whose job is to construct the commands. A Command object describes an concrete change, for example: setBBox(0,0,1,1); setBBox(2,2,3,3) would be a seperate object.

Method Summary
 ProjectCommand copy()
          Instantiates a new copy of the command that will operate in the same manner as the original command.
 java.lang.String getName()
          Returns the name of the Command
 void run()
          The method that performs the work of the command.
 

Method Detail

run

void run()
         throws java.lang.Exception
The method that performs the work of the command.

Run is called by UDIG when the command is received.

API how is this associated with a Thread? is it a Thread?

Throws:
java.lang.Exception

copy

ProjectCommand copy()
Instantiates a new copy of the command that will operate in the same manner as the original command. API isn't this cloneable?

Returns:
A copy of the current command. The new command must run the same way as the current object.

If the current command has already executed it cannot be used again, but a copy may because a copy should contain none of the state side-effect that execution has on a command


getName

java.lang.String getName()
Returns the name of the Command

Returns:
The name of the command.