Package org.openstreetmap.josm.data.coor

Examples of org.openstreetmap.josm.data.coor.EastNorth.east()


            tmp = EN.rotate_cc(pivot, tmp, headingAll);
            final double dx = tmp.east()  - n.getEastNorth().east();
            final double dy = tmp.north() - n.getEastNorth().north();
            if (headingNodes.contains(n)) { // The heading nodes should not have changed
                final double EPSILON = 1E-6;
                if (Math.abs(dx) > Math.abs(EPSILON * tmp.east()) ||
                        Math.abs(dy) > Math.abs(EPSILON * tmp.east()))
                    throw new AssertionError();
            }
            else {
                OrthogonalizeAction.rememberMovements.put(n, new EastNorth(dx, dy));
View Full Code Here


            final double dx = tmp.east()  - n.getEastNorth().east();
            final double dy = tmp.north() - n.getEastNorth().north();
            if (headingNodes.contains(n)) { // The heading nodes should not have changed
                final double EPSILON = 1E-6;
                if (Math.abs(dx) > Math.abs(EPSILON * tmp.east()) ||
                        Math.abs(dy) > Math.abs(EPSILON * tmp.east()))
                    throw new AssertionError();
            }
            else {
                OrthogonalizeAction.rememberMovements.put(n, new EastNorth(dx, dy));
                commands.add(new MoveCommand(n, dx, dy));
View Full Code Here

                for (OsmPrimitive p : sel) {
                    if (! (p instanceof Node)) throw new InvalidUserInputException();
                    Node n = (Node) p;
                    if (rememberMovements.containsKey(n)) {
                        EastNorth tmp = rememberMovements.get(n);
                        commands.add(new MoveCommand(n, - tmp.east(), - tmp.north()));
                        rememberMovements.remove(n);
                    }
                }
                if (!commands.isEmpty()) {
                    Main.main.undoRedo.add(new SequenceCommand(tr("Orthogonalize / Undo"), commands));
View Full Code Here

            if (mousePosMove == null)
                startMovement(e);
            EastNorth center = nc.getCenter();
            EastNorth mouseCenter = nc.getEastNorth(e.getX(), e.getY());
            nc.zoomTo(new EastNorth(
                    mousePosMove.east() + center.east() - mouseCenter.east(),
                    mousePosMove.north() + center.north() - mouseCenter.north()));
        } else {
            endMovement();
        }
    }
View Full Code Here

                if (mousePosMove == null) {
                    startMovement(e);
                }
                EastNorth center = nc.getCenter();
                EastNorth mouseCenter = nc.getEastNorth(e.getX(), e.getY());
                nc.zoomTo(new EastNorth(mousePosMove.east() + center.east() - mouseCenter.east(), mousePosMove.north()
                        + center.north() - mouseCenter.north()));
            } else {
                endMovement();
            }
        }
View Full Code Here

            } else {
                EastNorth center = nc.getCenter();
                EastNorth newcenter = nc.getEastNorth(nc.getWidth()/2+nc.getWidth()/5, nc.getHeight()/2+nc.getHeight()/5);
                switch(action) {
                case "left":
                    nc.zoomTo(new EastNorth(2*center.east()-newcenter.east(), center.north()));
                    break;
                case "right":
                    nc.zoomTo(new EastNorth(newcenter.east(), center.north()));
                    break;
                case "up":
View Full Code Here

                switch(action) {
                case "left":
                    nc.zoomTo(new EastNorth(2*center.east()-newcenter.east(), center.north()));
                    break;
                case "right":
                    nc.zoomTo(new EastNorth(newcenter.east(), center.north()));
                    break;
                case "up":
                    nc.zoomTo(new EastNorth(center.east(), 2*center.north()-newcenter.north()));
                    break;
                case "down":
View Full Code Here

                radius = distance(center, inside.get(0).getEastNorth());
            } else if(inside.size() == 2 && outside.isEmpty()) {
                // 2 nodes inside, define diameter
                EastNorth en0 = inside.get(0).getEastNorth();
                EastNorth en1 = inside.get(1).getEastNorth();
                center = new EastNorth((en0.east() + en1.east()) / 2, (en0.north() + en1.north()) / 2);
                radius = distance(en0, en1) / 2;
            }
           
            fixNodes.addAll(inside);
            fixNodes.addAll(collectNodesWithExternReferers(ways));
View Full Code Here

        int nc = nodes.size();
        double area = 0;
        for(int i = 0; i < nc; i++) {
            EastNorth p1 = nodes.get(i).getEastNorth();
            EastNorth p2 = nodes.get((i+1) % nc).getEastNorth();
            area += p1.east()*p2.north() - p2.east()*p1.north();
        }
        if(area < 0)
            Collections.reverse(nodes);
        return nodes;
    }
View Full Code Here

                        // Get a "typical" distance in east/north units that
                        // corresponds to a couple of pixels. Shouldn't be too
                        // large, to keep it within projection bounds and
                        // not too small to avoid rounding errors.
                        double dist = 0.01 * proj.getDefaultZoomInPPD();
                        LatLon ll1 = proj.eastNorth2latlon(new EastNorth(center.east() - dist, center.north()));
                        LatLon ll2 = proj.eastNorth2latlon(new EastNorth(center.east() + dist, center.north()));
                        double meterPerEasting = ll1.greatCircleDistance(ll2) / dist / 2;
                        double scale = meterPerPixel / meterPerEasting; // unit: easting per pixel
                        viewport = new ViewportData(center, scale);
                    } catch (NumberFormatException ex) {
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.