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

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


                handler.getCurrentShape().contains(Point.valueOf(e.x, e.y), true) );
    }

    private boolean allVerticesSelectedAndWithinGeom( EditToolHandler handler ) {
        PrimitiveShape currentShape = handler.getCurrentShape();
        Selection selection = handler.getCurrentGeom().getEditBlackboard().getSelection();

        Point dragStarted = handler.getMouseTracker().getDragStarted();
        if( dragStarted==null )
            return false;
        for( Point point : currentShape ) {
            if( ! selection.contains(point) )
                return false;
        }
       
        return currentShape.contains(dragStarted, true);
       
View Full Code Here


            geoms= editBlackboard.getGeoms(point.getX(),point.getY());
        else{
            EditPlugin.trace(EditPlugin.SELECTION, "VertexSelectorBehaviour: Not over vertex (" //$NON-NLS-1$
                    +e.x+","+e.y+")", null); //$NON-NLS-1$ //$NON-NLS-2$
        }
        Selection selection = editBlackboard.getSelection();
        List<UndoableMapCommand> commands=new ArrayList<UndoableMapCommand>();
        if( e.isShiftDown() ){
            if( geoms!=null && geoms.contains(handler.getCurrentGeom())
                    && !editBlackboard.getSelection().contains(point) ){
                commands.add( new SelectVertexCommand(editBlackboard, point, Type.ADD ) );
            }
        } else if (e.isControlDown()) {
            if (geoms != null && geoms.contains(handler.getCurrentGeom())) {
                if( selection.contains(point) )
                    commands.add( new SelectVertexCommand(editBlackboard, point, Type.REMOVE) );
                else{
                    commands.add( new SelectVertexCommand(editBlackboard, point, Type.ADD) );                   
                }
            }
        }else{
            if( selection.size()!=1 || !selection.contains(point) )
                commands.addnew SelectVertexCommand(editBlackboard, point, Type.SET) );
        }
        if( geoms!=null && geoms.contains(handler.getCurrentGeom()) ){
            if( handler.getCurrentState()==EditState.NONE){
                commands.add( new SetEditStateCommand( handler, EditState.MODIFYING ) );
View Full Code Here

        else{
            EditPlugin.trace(EditPlugin.SELECTION, "VertexSelectorBehaviour: Not over vertex (" //$NON-NLS-1$
                    +e.x+","+e.y+")", null); //$NON-NLS-1$ //$NON-NLS-2$
            return null;
        }
        Selection selection = editBlackboard.getSelection();
        List<UndoableMapCommand> commands=new ArrayList<UndoableMapCommand>();

        if( !selection.contains(point) )
            commands.addnew SelectVertexCommand(editBlackboard, point, Type.SET) );

        if( geoms!=null && geoms.contains(handler.getCurrentGeom()) ){
            if( handler.getCurrentState()==EditState.NONE){
                commands.add( new SetEditStateCommand( handler, EditState.MODIFYING ) );
View Full Code Here

    }

    public void run( IProgressMonitor monitor ) throws Exception {
        EditBlackboard blackboard = handler.getEditBlackboard(handler.getEditLayer());
        blackboard.startBatchingEvents();
        Selection selection = blackboard.getSelection();
        undoData = new ArrayList<Bag>();
        EditState oldState = handler.getCurrentState();
        try {
            handler.setCurrentState(EditState.BUSY);
            DeleteVertexAnimation deleteVertexAnimation=null;
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);
        board.fireBatchedEvents();
        if ( getMap()!=null )
View Full Code Here

        this( editBlackboard2, Collections.singleton(point), type);
    }

    public void run( IProgressMonitor monitor ) throws Exception {
        editBlackboard.startBatchingEvents();
        oldPoints= new Selection(editBlackboard.getSelection());
        oldPoints.disconnect();
        if( type==Type.ADD)
            editBlackboard.selectionAddAll(points);
        else if( type==Type.SET ){
                editBlackboard.selectionClear();
View Full Code Here

    public String getName() {
        return Messages.SelectPointCommand_name;
    }

    public void rollback( IProgressMonitor monitor ) throws Exception {
        Selection selection = editBlackboard.getSelection();
        synchronized (selection) {
            editBlackboard.selectionClear();
            editBlackboard.selectionAddAll(oldPoints);
        }
    }
View Full Code Here

TOP

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

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.