Dashboard > UDIG Developer Guide > Home > 6 Working with GIS Application > 04 Commands > 5 Composite Commands
5 Composite Commands Log In | Sign Up   View a printable version of the current page.

Added by Jesse Eichar , last edited by Jody Garnett on Mar 25, 2008  (view change)
Labels: 
(None)

Composite Commnads

Composite Commands provide a way to combine commands into one unit. A composite command is executed and undone as if it is a single command.

Example Usage

Example taken from Zoom.java which is a tool see Tools:

NavigationCommandFactory factory = NavigationCommandFactory.getInstance();

NavCommand[] commands = new NavCommand[] {
   factory.createSetViewportCenterCommand(m.pixelToWorld( r.x + r.width / 2, r.y + r.height / 2)),
   factory.createZoomCommand(r.width / getContext().getMapDisplay().getDisplaySize().getWidth()) };

   map.sendCommand(factory.createCompositeCommand(commands));
Powered by a free Atlassian Confluence Open Source Project License granted to uDig. Evaluate Confluence today.
Powered by Atlassian Confluence 2.7.1, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators
User-friendly Desktop Internet GIS