uDig

«  MapInterceptor and LayerInterceptor   ::   Contents   ::   Simple Commands  »

Commands

Commands are the only acceptable way of modifying the data model. The reason for forcing developers to write and use commands is so that actions can be undone and redone, otherwise developers will directly attack the model and none of the changes will be able to be undone by the application user.

Command authors have a parallel but separate API than most extension authors. Command authors are permitted to use the internal API, that is classes with internal in their package name. Notice that Command authors are not permitted to reference any classes implementation classes (classes with impl in their package name).

Command Helper classes

There are a number of factories built into uDig that create commonly used commands.

  1. BasicCommandFactory: Creates the common commands such as Delete Layer Commands and Add Layer Commands.
  2. SelectionCommandFactory: Creates subset of ICommands that sets the current selection in layers. All the commands are normal Commands.
  3. NavigationCommandFactory: Creates common navigation commands such as PanCommand.
  4. EditCommandFactory: Creates edit commands such as ModifyFeatureCommand and AddFeatureCommand.
  5. DrawCommandFactory: Creates draw commands such as TranslationCommand and DrawShapeCommand.

«  MapInterceptor and LayerInterceptor   ::   Contents   ::   Simple Commands  »