Package org.locationtech.udig.project.command

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


                TableItem tableItem=(TableItem) item;
                Schema schema = new Schema();
                int columnIndex = schema.getIndexOf( feature.getFeatureType(), property );
                tableItem.setText(columnIndex+1, value.toString());
               
                UndoableComposite composite = new UndoableComposite();
                composite.getCommands().add(new SetEditingFlag(true));
               
                composite.getCommands().add(
                        EditCommandFactory.getInstance().createSetAttributeCommand(feature, layer, property, value));
                composite.getFinalizerCommands().add(new SetEditingFlag(false));
                layer.getMap().sendCommandASync(composite);
            }
        };
       
        final SimpleFeatureType schema = notifierLayer.getSchema();
View Full Code Here


        if (shapeType==ShapeType.POLYGON && addVertexCommand!=null && !addVertexCommand.getPointToAdd().equals(Point.valueOf((int)start[0], (int)start[1]))){
            commands.add( new AddVertexCommand(handler, bb, currentProvider, Point.valueOf((int)start[0], (int)start[1]), false));           
        }
       

        UndoableComposite undoableComposite = new UndoableComposite(commands);
        undoableComposite.getFinalizerCommands().add(new FireEventsCommand(bb));
        return undoableComposite;
    }
View Full Code Here

            ProjectPlugin.log("The split did not apply to any feature"); //$NON-NLS-1$
       
      throw new IllegalArgumentException(Messages.SplitFeaturesCommand_did_not_apply_to_any_feature);
    }
    IProgressMonitor splitMonitor = SubMonitor.convert(monitor, 20);
    composite = new UndoableComposite(undoableCommands);

    // cascade setMap on the aggregate commands
    composite.setMap(getMap());
    composite.run(splitMonitor);
View Full Code Here

     * @see SplitFeaturesCommand
     */
    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

                    Tool tool = ApplicationGIS.getToolManager().getActiveTool();

                    if (tool instanceof AbstractEditTool) {
                        EditToolHandler editToolHandler = ((AbstractEditTool) tool).getHandler();
                        List<Behaviour> behaviours = editToolHandler.getCancelBehaviours();
                        UndoableComposite compositeCommand = new UndoableComposite();
                        for( Behaviour behaviour : behaviours ) {
                            if (behaviour.isValid(editToolHandler)) {
                                UndoableMapCommand command = behaviour.getCommand(editToolHandler);
                                if (command != null)
                                    compositeCommand.getCommands().add(command);
                            }
                        }
                        if (!compositeCommand.getCommands().isEmpty())
                            editToolHandler.getContext().sendASyncCommand(compositeCommand);
                    }

                    return null;
                }
View Full Code Here

            if (layer.hasResource(getMapGraphicClass())) {
                toRemove.add(layer);
            }
        }

        UndoableComposite composite = new UndoableComposite();
        for( ILayer layer : toRemove ) {
            composite.getCommands().add( new DeleteLayerCommand((Layer)layer) );
        }

        map.sendCommandASync(composite);
    }
View Full Code Here

   * @return a {@linkplain CompositeCommand}
   * @see MapCommand
   */
  @Override
    public UndoableMapCommand createUndoableCompositeCommand(List<? extends UndoableMapCommand> commands) {
    return new UndoableComposite(commands);
  }
View Full Code Here

        apply(layer, getCRS(layer,code));
    }   

    public static void apply(Layer layer, CoordinateReferenceSystem crs ) {
        if(!layer.getCRS().equals(crs)) {
            UndoableComposite commands=new UndoableComposite();
            List<MapCommand> commandList = commands.getCommands();
            commandList.add(new SetLayerCRSCommand(layer, crs));
            layer.getMap().sendCommandASync(commands);
        }
    }
View Full Code Here

                if (!fidNotTrimmed.equals("")) { //$NON-NLS-1$

                    DialogUtil.openInformation(Messages.TrimFeaturesCommand_no_features_modified,
                            Messages.TrimFeaturesCommand_unvalid_intersection + fidNotTrimmed);
                } else {
                    composite = new UndoableComposite(undoableCommands);
                    try {
                        composite.run(monitor);
                    } catch (Exception e) {
                        throw new IllegalStateException(e.getMessage(), e);
                    }
View Full Code Here

   
    cmdList.add(addCmd);

    assert cmdList.size() >= 3; // Almost two delete and one add command

    this.compositeCmd = new UndoableComposite(cmdList);

  }
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.