Package org.locationtech.udig.project.command

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


    /**
   * @param e
   * @param bounds
   */
  protected void sendSelectionCommand(MapMouseEvent e, Envelope bounds) {
    MapCommand command;
    if( e.isModifierDown(MapMouseEvent.MOD2_DOWN_MASK) ) {
            command = new BBoxSelectionCommand(bounds, BBoxSelectionCommand.ADD);
        }else if( e.isModifierDown(MapMouseEvent.MOD1_DOWN_MASK) ){
            command = new BBoxSelectionCommand(bounds, BBoxSelectionCommand.SUBTRACT);
        }else{
View Full Code Here


        });
    }

    private void updateLayerFilter( Filter filter ) {
        updatingLayerFilter=true;
        MapCommand createSelectCommand = SelectionCommandFactory.getInstance().createSelectCommand(layer, filter);
        layer.getMap().sendCommandSync(createSelectCommand);
        updatingLayerFilter=false;

        setZoomToSelectionToolEnablement();
    }
View Full Code Here

            }
           
            if( layer==null){
                setSelection(filter==null?(Filter)getData():filter, destinationLayer, monitor);
            }else{
                MapCommand c=EditCommandFactory.getInstance().createCopyFeaturesCommand( layer, filter, destinationLayer);
                destinationMap.sendCommandASync(c);
            }
        }else{
            setSelection((Filter)getData(), destinationLayer, monitor);
        }
View Full Code Here

    /**
     * @param e
     * @param bounds
     */
    protected void sendSelectionCommand( MapMouseEvent e, Envelope bounds ) {
        MapCommand command;
        if (e.isModifierDown(MapMouseEvent.MOD2_DOWN_MASK)) {
            command = getContext().getSelectionFactory().createBBoxSelectionCommand(bounds, BBoxSelectionCommand.ADD);
        } else if (e.isModifierDown(MapMouseEvent.MOD1_DOWN_MASK)) {
            command = getContext().getSelectionFactory().createBBoxSelectionCommand(bounds, BBoxSelectionCommand.SUBTRACT);
        } else {
View Full Code Here

            }                   
        }, GeoToolsAdapters.progress(monitor) );
       
        final Geometry hole = union[0];
       
        MapCommand drillHoleCommand = new AbstractCommand(){
           
            public void run( IProgressMonitor monitor ) throws Exception {
                for( Layer targetLayer : getMap().getLayersInternal() ){
                    //make hole filter for target layer
                    if( targetLayer == layer ){
View Full Code Here

        ILayer layer = (ILayer) target;
        IMap map = layer.getMap();
       
        final CoordinateReferenceSystem after = layer.getCRS();
       
        MapCommand changeProjection = new ChangeCRSCommand(after);
        map.sendCommandASync( changeProjection );
       
    }
View Full Code Here

     * @param bookmark
     *            The bookmark to go to
     */
    private void gotoBookmark(Bookmark bookmark) {
        BookmarkCommandFactory factory = BookmarkCommandFactory.getInstance();
        MapCommand cmd = factory.createGotoBookmarkCommand(bookmark);
        ApplicationGIS.getActiveMap().sendCommandASync(cmd);
    }
View Full Code Here

        // generate a fid filter out of the invalid features
        for( SimpleFeature feature : results ) {
            fid.add(ff.featureId(feature.getID()));
        }
        // select the invalid features on the current layer
        MapCommand selectionCommand = SelectionCommandFactory.getInstance().createSelectCommand(
                layer, ff.id(fid));
        layer.getMap().sendCommandASync(selectionCommand);
    }
View Full Code Here

        Coordinate c2 = context.getMap().getViewportModel().pixelToWorld(x2, y2);

        Envelope bounds = new Envelope(c1, c2);

        // remove the bounding box selection
        MapCommand cmd = new BBoxSelectionCommand(bounds, BBoxSelectionCommand.NONE);
        getContext().sendASyncCommand(cmd);

        selectionBoxCommand.setValid(false);
        getContext().getViewportPane().repaint();
    }
View Full Code Here

    private Filter selectFeaturesUnderBBox(Envelope boundDrawn, int SelectionType) {

        // updates the merge context with bounds
        this.mergeContext.addBound(boundDrawn);

        MapCommand command = context.getSelectionFactory().createBBoxSelectionCommand(boundDrawn,
                SelectionType);
        getContext().sendSyncCommand(command);

        // SelectionBoxCommand selectionBoxCommand = this.mergeContext.getSelectionBoxCommand();
        // selectionBoxCommand.setValid(true);
View Full Code Here

TOP

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

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.