Package org.locationtech.udig.project.ui.commands

Examples of org.locationtech.udig.project.ui.commands.IDrawCommand


            java.awt.Point end = viewPort.worldToPixel(coords[coords.length - 1]);
            commands.add(new ArrowDrawCommand(new Coordinate(start.x, start.y), new Coordinate(end.x, end.y)));
        }

        IToolContext toolContext = ApplicationGIS.createContext(ApplicationGIS.getActiveMap());
        IDrawCommand compositeCommand = toolContext.getDrawFactory().createCompositeDrawCommand(commands);
        toolContext.sendASyncCommand(compositeCommand);
    }
View Full Code Here


              if (pre)
                  varray = commands.getPreCommands();
              else
                  varray = commands.getPostCommands();
              for( int i = 0; i < varray.length; i++ ) {
                  IDrawCommand command = (IDrawCommand) varray[i];
                 
//                  //TODO probably add other command types as  exceptions.
//                  if(!enable && !(command instanceof IMapTransformCommand))
//                    continue;
                 
                  if (command.isValid()) {
                      command.setGraphics(g, pane);
                      try {
                          command.setMap(this.pane.getMapEditor().getMap());
                          command.run(new NullProgressMonitor());
                      } catch (Exception e) {
                          ProjectUIPlugin.log("", e); //$NON-NLS-1$
                            if(pre){
                                commands.removePre(command);
                            }else{
View Full Code Here

        if (adaptableFeature == null)
            return;

        final Layer layer = (Layer) adaptableFeature.getAdapter(Layer.class);

        IDrawCommand command = DrawCommandFactory.getInstance().createDrawFeatureCommand(feature,
                layer);

        ViewportPane pane = (ViewportPane) layer.getMapInternal().getRenderManager()
                .getMapDisplay();
        pane.addDrawCommand(command);

        PlatformGIS.syncInDisplayThread(PlatformUI.getWorkbench().getDisplay(), new Runnable(){
            public void run() {

                boolean result;
                result = MessageDialog.openConfirm(PlatformUI.getWorkbench().getDisplay()
                        .getActiveShell(), Messages.DeleteFeature_confirmation_title,
                        Messages.DeleteFeature_confirmation_text);

                if (result) {
                    UndoableMapCommand c = EditCommandFactory.getInstance().createDeleteFeature(
                            feature, layer);
                    executeCommand(c, layer.getMap());
                }
            }
        });
        command.setValid(false);
        pane.repaint();

    }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.ui.commands.IDrawCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.