Package org.locationtech.udig.tools.edit.commands

Examples of org.locationtech.udig.tools.edit.commands.SetEditStateCommand


    public UndoableMapCommand getCommand( EditToolHandler handler ) {
        assert handler != null;
       
        UndoableComposite commands = new UndoableComposite();
       
        commands.addCommand(new SetEditStateCommand(handler, EditState.BUSY ));
        commands.addCommand( new SplitFeaturesCommand(handler) );
        commands.addCommand( new SetEditStateCommand(handler, EditState.NONE ));
       
        return commands;
    }
View Full Code Here


    public UndoableMapCommand getCommand( EditToolHandler handler ) {
        UndoableComposite composite = new UndoableComposite();
        List<EditGeom> geoms = handler.getEditBlackboard(handler.getEditLayer()).getGeoms();
        composite.getCommands().add(new DeselectEditGeomCommand(handler, geoms ));
        composite.getCommands().add(new SetEditStateCommand(handler, EditState.NONE));
        return composite;
    }
View Full Code Here

                commands.getCommands().add(createEditGeomCommand);
                commands.getCommands().add(EditUtils.instance.appendPathToShape(iter, shapeType, handler, bb, createEditGeomCommand.getShapeProvider()));
                commands.getCommands().add( new SetCurrentGeomCommand(handler, createEditGeomCommand.getShapeProvider()));
                commands.getCommands().add(handler.getCommand(handler.getAcceptBehaviours()));
               
                commands.getFinalizerCommands().add( new SetEditStateCommand(handler, EditState.NONE));
                return commands;
            }finally{
                drawCommand.setValid(false);
                drawCommand=null;
                path=null;
View Full Code Here

        }
        EditState oldState = handler.getCurrentState();

        // This is the list of commands we are going to send off
        List<UndoableMapCommand> commands = new ArrayList<UndoableMapCommand>();
        commands.add(new SetEditStateCommand(handler, EditState.COMMITTING));

        ILayer layer = handler.getEditLayer();

        Set<Entry<String, GeometryCreationUtil.Bag>> entries = idToGeom.entrySet();
        for( Entry<String, GeometryCreationUtil.Bag> entry : entries ) {

            commands.addAll(processIntoCommands(handler, layer, entry));
        }

        UndoableComposite composite = new UndoableComposite(commands);
        composite.setName(Messages.WriteChangesBehaviour_commandName);
        composite.getFinalizerCommands().add(new SetEditStateCommand(handler, EditState.MODIFYING));

        handler.setCurrentState(oldState);

        return composite;
    }
View Full Code Here

            throw new IllegalArgumentException("Current state is not legal"); //$NON-NLS-1$
        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) {
View Full Code Here

            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

            EventType eventType ) {
        if( !isValid(handler, e, eventType))
            throw new IllegalStateException("Current state is illegal this method should not be called"); //$NON-NLS-1$
       
        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

            command = init(handler, e, eventType);
        generalPath.lineTo(e.x, e.y);
       
        updateShapes(handler, e);
       
        SetEditStateCommand setEditStateCommand = new SetEditStateCommand(handler, EditState.CREATING);
       
        return executeCommand(handler, command, setEditStateCommand);
    }
View Full Code Here

            // TODO/ this is a workaround to test some bugs we are aware of and can't quickly fix so...
            String errorMessage = testToGeometry(handler.getCurrentGeom());
            if( errorMessage!=null ){
               openErrorBubble(handler, e, errorMessage);
               return new SetEditStateCommand(handler, EditState.MODIFYING);
            }
            return createMoveCommand(handler);
        }
View Full Code Here

           
            if( errorMessage==null ){
                return createMoveCommand(handler);
            }else{
                openErrorBubble(handler, e, errorMessage);
                return new SetEditStateCommand(handler, EditState.MODIFYING);
            }
        }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.tools.edit.commands.SetEditStateCommand

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.