Package org.locationtech.udig.tools.edit.support

Examples of org.locationtech.udig.tools.edit.support.PrimitiveShape


        for( Point p : oldGeom.getShell() ) {
            bb.addPoint(p.getX(), p.getY(), geom.getShell());
        }
       
        for( PrimitiveShape shape : oldGeom.getHoles() ) {
            PrimitiveShape hole = geom.newHole();
            for( Point p : shape ) {
                bb.addPoint(p.getX(), p.getY(), hole);
            }
        }
View Full Code Here


            getMap().getEditManagerInternal().setEditFeature(oldFeature, (Layer) oldLayer);
            if (deselectCreatedFeature) {
                EditBlackboard bb = geom.getEditBlackboard();
                EditGeom newGeom = bb.newGeom(geom.getFeatureIDRef().get(), geom.getShapeType());
                PrimitiveShape shell = geom.getShell();
                for( org.locationtech.udig.tools.edit.support.Point point : shell ) {
                    bb.addPoint(point.getX(), point.getY(), newGeom.getShell());
                }

                List<PrimitiveShape> holes = geom.getHoles();
                for( PrimitiveShape primitiveShape : holes ) {
                    PrimitiveShape newHole = newGeom.newHole();
                    for( Point point2 : primitiveShape ) {
                        bb.addPoint(point2.getX(), point2.getY(), newHole);
                    }
                }
                geom = newGeom;
View Full Code Here

            EditGeom inBlackboard = bb.newGeom(original.getFeatureIDRef().get(), original.getShapeType());
            inBlackboard.setChanged(original.isChanged());
            if( original == currentGeom )
                newCurrentGeom=inBlackboard;
           
            PrimitiveShape destination = inBlackboard.getShell();
            newCurrentGeom = setCurrentGeom(newCurrentGeom, destination, original.getShell());
           
            for( Iterator<Coordinate> iter=original.getShell().coordIterator(); iter.hasNext(); ) {
                bb.addCoordinate(iter.next(), destination);
            }
View Full Code Here

    public CreateAndSelectHoleCommand( IBlockingProvider<PrimitiveShape> shape ) {
        this.newShape=shape;
    }

    public void run( IProgressMonitor monitor ) throws Exception {
        PrimitiveShape primitiveShape = newShape.get(monitor);
        List<PrimitiveShape> holes = primitiveShape.getEditGeom().getHoles();
        for( PrimitiveShape shape : holes ) {
            if( shape.getNumPoints()==0 ){
                hole=shape;
                break;
            }
        }
        if( hole==null )
            this.hole = primitiveShape.getEditGeom().newHole();
        if( handler!=null ){
            this.oldShape=handler.getCurrentShape();
            handler.setCurrentShape(hole);
        }
    }
View Full Code Here

        this.provider=provider;
        this.tracker=tracker;
    }

    public void run( IProgressMonitor monitor ) throws Exception {
        PrimitiveShape shape = provider.get();
        if( shape==null || shape.getNumPoints()==0 )
            return;
        Point start = shape.getPoint(0);
        Point end= shape.getPoint(shape.getNumPoints()-1);
        int radius=PreferenceUtil.instance().getVertexRadius();

        if( start==null || end==null )
            return;
       
View Full Code Here

    }

    public Rectangle getValidArea() {
        if( provider==null )
            return null;
        PrimitiveShape obj = provider.get();
        if( obj==null )
            return null;
        return provider.get().getBounds();
    }
View Full Code Here

            getMap().getEditManagerInternal().setEditFeature(oldFeature, (Layer) oldLayer);
            if (deselectCreatedFeature) {
                EditBlackboard bb = geom.getEditBlackboard();
                EditGeom newGeom = bb.newGeom(geom.getFeatureIDRef().get(), geom.getShapeType());
                PrimitiveShape shell = geom.getShell();
                for( org.locationtech.udig.tools.edit.support.Point point : shell ) {
                    bb.addPoint(point.getX(), point.getY(), newGeom.getShell());
                }

                List<PrimitiveShape> holes = geom.getHoles();
                for( PrimitiveShape primitiveShape : holes ) {
                    PrimitiveShape newHole = newGeom.newHole();
                    for( Point point2 : primitiveShape ) {
                        bb.addPoint(point2.getX(), point2.getY(), newHole);
                    }
                }
                geom = newGeom;
View Full Code Here

     * @return
     */
    private void copyFeature( EditBlackboard editBlackboard, EditGeom geom ) {
        EditGeom newGeom = editBlackboard.newGeom(geom.getFeatureIDRef().get(), geom.getShapeType());
        for( PrimitiveShape shape : geom ) {
            PrimitiveShape newShape;
            if (shape == geom.getShell()) {
                newShape = newGeom.getShell();
            } else {
                newShape = newGeom.newHole();
            }
View Full Code Here

    public void run( IProgressMonitor monitor ) throws Exception {
      if( toAdd == null ){
            toAdd = toCoordinate(point, useSnapping);
      }
        PrimitiveShape shape = shapeProvider.get(monitor);
        boolean collapseVertices = board.isCollapseVertices();
        try {
            board.setCollapseVertices(false);
            board.addCoordinate(toAdd, shape);
            addedCoord = toAdd;
            index=shape.getNumPoints()-1;
        } finally {
            board.setCollapseVertices(collapseVertices);
        }
        if (handler.getContext().getMapDisplay() != null && showAnimation) {
            IAnimation animation = new AddVertexAnimation(point.getX(), point.getY());
View Full Code Here

    }

    public void run( IProgressMonitor monitor ) throws Exception {
        board.startBatchingEvents();
        PrimitiveShape primitiveShape = shape.get(new SubProgressMonitor(monitor, 1));
        board.insertCoordinate( toAdd, index, primitiveShape);
        oldSelection=new Selection(board.getSelection());
        oldSelection.disconnect();
        board.selectionClear();
        board.selectionAdd(point);
View Full Code Here

TOP

Related Classes of org.locationtech.udig.tools.edit.support.PrimitiveShape

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.