Package org.locationtech.udig.project.command

Examples of org.locationtech.udig.project.command.UndoableComposite


        List<UndoableMapCommand> commands=new ArrayList<UndoableMapCommand>();
               
        commands.add(handler.getCommand(handler.getAcceptBehaviours()));
        if( handler.getCurrentState()==EditState.CREATING)
            commands.add(new SetEditStateCommand(handler, EditState.MODIFYING));
        UndoableComposite undoableComposite = new UndoableComposite(commands);
        undoableComposite.setMap(handler.getContext().getMap());
        try {
            undoableComposite.run(new NullProgressMonitor());
        } catch (Exception e1) {
            throw new RuntimeException(e1);
        }
        return new UndoRedoCommand(undoableComposite);
    }
View Full Code Here


            EditGeom currentGeom = handler.getCurrentGeom();
            if( currentGeom==null )
                return;
            EditBlackboard editBlackboard = currentGeom.getEditBlackboard();
            if( editBlackboard.getSelection().isEmpty() || hasNoPoints() ){
                UndoableComposite composite=new UndoableComposite();
                composite.getCommands().add(new SetEditStateCommand(handler, EditState.BUSY));
                composite.getCommands().add(new RemoveAllVerticesCommand(handler));
                composite.getCommands().add(handler.getCommand(handler.getAcceptBehaviours()));
                composite.getCommands().add(new SetCurrentGeomCommand(handler, (PrimitiveShape)null));
                composite.getFinalizerCommands().add(new SetEditStateCommand(handler, EditState.MODIFYING));
                handler.getContext().sendASyncCommand(composite);
            }else{
                UndoableComposite composite=new UndoableComposite();
                composite.getFinalizerCommands().add(new SetEditStateCommand(handler, EditState.MODIFYING));
                composite.getCommands().add(new SetEditStateCommand(handler, EditState.BUSY));
                RemoveSelectedVerticesCommand removeCommand = new RemoveSelectedVerticesCommand(handler);
                removeCommand.setRunAnimation(editBlackboard.getSelection().size()<10);
                composite.getCommands().add(removeCommand);
                handler.getContext().sendASyncCommand(composite);
            }
        }
View Full Code Here

        List<UndoableMapCommand> commands=new ArrayList<UndoableMapCommand>();
        commands.add(new SetEditStateCommand(handler, EditState.CREATING));
        commands.add(new CreateAndSelectHoleCommand(handler));
        commands.add(new AddVertexCommand(handler, handler.getEditBlackboard(handler.getEditLayer()),
                Point.valueOf(e.x, e.y)));
        return new UndoableComposite(commands);
    }
View Full Code Here

        UndoableMapCommand command=command2;
        if (command != null) {
            List<UndoableMapCommand> commands = new ArrayList<UndoableMapCommand>();
            commands.add(command);
            commands.add(setEditStateCommand);
            UndoableComposite undoableComposite = new UndoableComposite(commands);
            command=undoableComposite;
        } else {
            command=setEditStateCommand;
        }
        command.setMap(handler.getContext().getMap());
View Full Code Here

        }
       
        EditBlackboard blackboard = editBlackboard;
        PrimitiveShape currentShape = handler.getCurrentShape();
        if (currentShape == null) {
            UndoableComposite undoableComposite = startNewShape(handler, blackboard);
            return undoableComposite;
        }

        currentShape=currentShape.getEditGeom().getShell();
       
View Full Code Here

        commands.add(new SetCurrentGeomCommand(handler, new PrimitiveProvider()));
       
        if( handler.getContext().getEditManager().getEditFeature()!=null ){
            commands.add(handler.getContext().getEditFactory().createNullEditFeatureCommand());
        }
        UndoableComposite undoableComposite = new UndoableComposite(commands);
        return undoableComposite;
    }
View Full Code Here

        }

        commands.add(new SetCurrentGeomCommand(handler, new PrimitiveProvider()));
      
        return new UndoableComposite(commands);
    }
View Full Code Here

        public LayerStrategy( Layer layer ) {
            this.layer = layer;
        }

        public void applyCoordinateReferenceSystem( CoordinateReferenceSystem crs ) {
            UndoableComposite commands=new UndoableComposite();
            List<MapCommand> commandList = commands.getCommands();
            commandList.add(new SetLayerCRSCommand(layer, crs));
            if( layer.getCRS()==ILayer.UNKNOWN_CRS &&
                    layer.getMap().getViewportModel().getCRS().equals(ILayer.UNKNOWN_CRS) ){
                IPreferenceStore store=ProjectUIPlugin.getDefault().getPreferenceStore();
                store.setDefault(SHOW_DIALOG_KEY, true);
View Full Code Here

        ILayer editLayer = handler.getEditLayer();
        EditBlackboard bb = handler.getEditBlackboard(editLayer);
        commands.add(new DeselectEditGeomCommand(handler, bb.getGeoms()));
        commands.add(new StartEditingCommand(handler, e, type));
       
        UndoableComposite undoableComposite = new UndoableComposite(commands);
        undoableComposite.setMap(handler.getContext().getMap());
        try {
            undoableComposite.run(new NullProgressMonitor());
        } catch (Exception e1) {
            throw new RuntimeException(e1);
        }
        return new UndoRedoCommand(undoableComposite);
View Full Code Here

         *
         * @param handler
         * @return
         */
        private UndoableMapCommand createMoveCommand( EditToolHandler handler ) {
            UndoableComposite command = new UndoableComposite();
            command.getCommands().add(
                    new MoveVertexCommand(lastPoint, this.selection, handler, start,
                            EditState.MODIFYING, isSnappingValid()));
            command.getFinalizerCommands().add(
                    new SetEditStateCommand(handler, EditState.MODIFYING));
            return command;
        }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.command.UndoableComposite

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.