Package org.locationtech.udig.project.command

Examples of org.locationtech.udig.project.command.UndoableMapCommand.run()


        handler.setCurrentShape(editGeom.getShell());
       UndoableMapCommand command = behaviour.getCommand(handler);
       command.setMap((Map) handler.getContext().getMap());
       nullProgressMonitor = new NullProgressMonitor();
       command.run(nullProgressMonitor);
       assertFalse(handler.getCurrentGeom().isChanged());
       assertNotNull(handler.getCurrentGeom().getFeatureIDRef().get());
      
       
        assertEquals( count+1, source.getCount(Query.ALL) );
View Full Code Here


        bb.addPoint(20,20, geom2.getShell());
       
        AcceptChangesBehaviour behaviour = new AcceptChangesBehaviour(Point.class, false);
        UndoableMapCommand command = behaviour.getCommand(handler);
        command.setMap((Map) handler.getContext().getMap());
        command.run(new NullProgressMonitor());
        assertEquals( "Should have 2 points", 2, ((Geometry) feature.getDefaultGeometry()).getCoordinates().length); //$NON-NLS-1$
        assertEquals( "Should have 2 geoms", 2, ((Geometry) feature.getDefaultGeometry()).getNumGeometries()); //$NON-NLS-1$
    }

    /**
 
View Full Code Here

        bb.addPoint(100,100, geom2.getShell());
       
        AcceptChangesBehaviour behaviour=new AcceptChangesBehaviour(LineString.class, false);
        UndoableMapCommand command = behaviour.getCommand(handler);
        command.setMap((Map) handler.getContext().getMap());
        command.run(new NullProgressMonitor());
       
        layer.getMapInternal().getEditManagerInternal().commitTransaction();
       
        FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
        FeatureSource<SimpleFeatureType, SimpleFeature> resource = layer.getResource(FeatureSource.class, new NullProgressMonitor());
View Full Code Here

        handler.setCurrentShape(geom2.getShell());
       
        AcceptChangesBehaviour behaviour=new AcceptChangesBehaviour(LineString.class, false);
        UndoableMapCommand command = behaviour.getCommand(handler);
        command.setMap((Map) handler.getContext().getMap());
        command.run(new NullProgressMonitor());
       
        layer.getMapInternal().getEditManagerInternal().commitTransaction();
       
        FilterFactory fac = CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
        Set<String> fids = new HashSet<String>();
View Full Code Here

                        if (c instanceof PostDeterminedEffectCommand) {
                            PostDeterminedEffectCommand command = (PostDeterminedEffectCommand) c;
                            if( command.execute(submonitor) )
                                commandsRan.add(command);
                        }else{
                        c.run(submonitor);
                        commandsRan.add(c);
                        }
                        submonitor.done();
                    }catch(Exception e){
                      EditPlugin.trace( e.getClass().getName()+" executing "+c+":"+e.getMessage(), e);
View Full Code Here

        } else {
            command=setEditStateCommand;
        }
        command.setMap(handler.getContext().getMap());
        try {
            command.run(new NullProgressMonitor());
        } catch (Exception e1) {
            throw (RuntimeException) new RuntimeException( e1 );
        }
        return new UndoRedoCommand(command);
    }
View Full Code Here

                if (testing) {
                    c.setMap((Map) getContext().getMap());
                    try {
                        NullProgressMonitor nullProgressMonitor = new NullProgressMonitor();
                        c.run(nullProgressMonitor);
                    } catch (Exception e1) {
                        throw (RuntimeException) new RuntimeException().initCause(e1);
                    }
                } else{
                    getContext().sendASyncCommand(c);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.