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

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


            AnimationUpdater.runTimer(handler.getContext().getMapDisplay(), new MessageBubble(e.x, e.y,
                    Messages.AddVertexWhileCreatingBehaviour_illegal+"\n"+reasonForFaliure, PreferenceUtil.instance().getMessageDisplayDelay())); //$NON-NLS-1$
            return null;
        }
       
        Point valueOf = Point.valueOf(e.x, e.y);
        EditBlackboard editBlackboard = handler.getEditBlackboard(handler.getEditLayer());
        Point destination = handler.getEditBlackboard(handler.getEditLayer()).overVertex(valueOf, PreferenceUtil.instance().getVertexRadius());
        if( destination==null )
            destination=valueOf;
       
        AddVertexCommand addVertexCommand = new AddVertexCommand(handler, editBlackboard, destination);
        try {
View Full Code Here


    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;
       
        if( showMouseOver && tracker.getCurrentPoint()!=null ){
            MinFinder finder=new MinFinder(tracker.getCurrentPoint());
            graphics.setColor(PreferenceUtil.instance().getDrawVertexFillColor());
            if( start!=null && end!=null && finder.dist(start)<radius ){
                graphics.fill(new Rectangle(start.getX()-radius, start.getY()-radius, radius*2, radius*2 ));
                graphics.fill(new Rectangle(end.getX()-radius, end.getY()-radius, radius*2, radius*2 ));
            }
            if( start!=null && end !=null && finder.dist(end)<radius ){
                graphics.fill(new Rectangle(start.getX()-radius, start.getY()-radius, radius*2, radius*2 ));
                graphics.fill(new Rectangle(end.getX()-radius, end.getY()-radius, radius*2, radius*2 ));
            }
        }

        graphics.setColor(PreferenceUtil.instance().getDrawVertexLineColor());
        graphics.draw(new Rectangle(start.getX()-radius, start.getY()-radius, radius*2, radius*2 ));
        graphics.draw(new Rectangle(end.getX()-radius, end.getY()-radius, radius*2, radius*2 ));
       
           
    }
View Full Code Here

    }
   
    public void run( IProgressMonitor monitor ) throws Exception {
        graphics.setColor(PreferenceUtil.instance().getFeedbackColor());
        int radius = PreferenceUtil.instance().getSnappingRadius();
        Point point = tracker.get();
        int y = point.getY()-radius;
        int x = point.getX()-radius;
        graphics.drawOval(x, y, radius*2, radius*2);
        lastArea = new Rectangle(x-4, y-4, radius*2+8, radius*2+8);
    }
View Full Code Here

        lastArea = new Rectangle(x-4, y-4, radius*2+8, radius*2+8);
    }

    public Rectangle getValidArea() {
        int radius = PreferenceUtil.instance().getSnappingRadius();
        Point point = tracker.get();
        int y = point.getY()-radius;
        int x = point.getX()-radius;
        Rectangle rectangle = new Rectangle(x-4, y-4, radius*2+8, radius*2+8);
        if( lastArea!=null )
            return rectangle.union(lastArea);
        else
            return rectangle;
View Full Code Here

            Map<PrimitiveShape, Integer> deletes = new HashMap<PrimitiveShape, Integer>();
           
            for( EditGeom geom : allAffectedGeoms ) {
                for( PrimitiveShape shape : geom ) {
                    for( int i = 0; i < shape.getNumPoints(); i++ ) {
                        Point shapePoint = shape.getPoint(i);
                        if (points.contains(shapePoint)) {
                            Bag bag = new Bag();
                            bag.p = shapePoint;
                            bag.coords = shape.getCoordsAt(i);
                            bag.shape = shape;
View Full Code Here

        rect.height=radius*2;
        boolean selected;
        for( Iterator<Point> iter=new EditGeomPointIterator(shape.getEditGeom()); iter.hasNext();) {
            graphics.setStroke(ViewportGraphics.LINE_SOLID, 1);

            Point p=iter.next();
            if( (p.getX()<0||p.getX()>display.getWidth())
                    && (p.getY()<0 || p.getY()>display.getHeight()) )
                continue;
           
            rect.x=p.getX()-radius;
            rect.y=p.getY()-radius;
           
            if( overPoint && p==shape.getPoint(0) ){
                drawOverPoint(rect, isSelected(p));
            }else{
                setZoomedRect(rect, p, 0);                   
View Full Code Here

     *
     * @param rect
     */
    private void drawOverPoint( Rectangle rect, boolean selected ) {
        if( overPoint ){
            Point point = shape.getPoint(0);
            rect.x=point.getX()-radius;
            rect.y=point.getY()-radius;
           
            setZoomedRect(rect, point, radiusDelta);
            if( selected )
                graphics.setColor(selectionFill.get());
            else
View Full Code Here

        this.location=Point.valueOf(event.x, event.y);

        if( shape==null || shape.getNumPoints()==0 )
            return;
       
        Point firstPoint = shape.getPoint(0);
        overPoint=isOverPoint(firstPoint);
        if( overPoint!=oldIsOver )
            handler.repaint();
    }
View Full Code Here

        this.shape = handler.getCurrentShape();
        handler.setCurrentShape(null);
        List<UndoableMapCommand> commands = new ArrayList<UndoableMapCommand>();

        //check that start point is same as end point
        Point startPoint = shape.getPoint(0);
        if (!startPoint.equals(shape.getPoint(shape.getNumPoints() - 1))) {
            addedEndVertex = true;
            shape.getEditBlackboard().addPoint(startPoint.getX(), startPoint.getY(), shape);
        }
        GeometryOperationAnimation indicator = new GeometryOperationAnimation(
                PrimitiveShapeIterator.getPathIterator(shape).toShape(), new IsBusyStateProvider(
                        handler));
        try {
View Full Code Here

TOP

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

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.