Package org.openstreetmap.josm.command

Examples of org.openstreetmap.josm.command.MoveCommand


            if (c instanceof MoveCommand && affectedNodes.equals(((MoveCommand) c).getParticipatingPrimitives())) {
                ((MoveCommand) c).saveCheckpoint();
                ((MoveCommand) c).applyVectorTo(currentEN);
            } else {
                Main.main.undoRedo.add(
                        c = new MoveCommand(selection, startEN, currentEN));
            }
            for (Node n : affectedNodes) {
                LatLon ll = n.getCoor();
                if (ll != null && ll.isOutSideWorld()) {
                    // Revert move
View Full Code Here


                Way w = virtualWay.way;
                Way wnew = new Way(w);
                wnew.addNode(virtualWay.lowerIndex + 1, virtualNode);
                virtualCmds.add(new ChangeCommand(w, wnew));
            }
            virtualCmds.add(new MoveCommand(virtualNode, startEN, currentEN));
            String text = trn("Add and move a virtual new node to way",
                    "Add and move a virtual new node to {0} ways", virtualWays.size(),
                    virtualWays.size());
            Main.main.undoRedo.add(new SequenceCommand(text, virtualCmds));
            getCurrentDataSet().setSelected(Collections.singleton((OsmPrimitive) virtualNode));
View Full Code Here

                if (joinWayToNode) {
                    for (Node node : nodesInSegment) {
                        EastNorth newPosition = Geometry.closestPointToSegment(w.getNode(segmentIndex).getEastNorth(),
                                                                            w.getNode(segmentIndex+1).getEastNorth(),
                                                                            node.getEastNorth());
                        cmds.add(new MoveCommand(node, Projections.inverseProject(newPosition)));
                    }
                }
                List<Node> nodesToAdd = new LinkedList<>();
                nodesToAdd.addAll(nodesInSegment);
                Collections.sort(nodesToAdd, new NodeDistanceToRefNodeComparator(w.getNode(segmentIndex), w.getNode(segmentIndex+1), !joinWayToNode));
View Full Code Here

        double middle = (minEast + maxEast) / 2;

        Collection<Command> cmds = new LinkedList<>();

        for (Node n : nodes) {
            cmds.add(new MoveCommand(n, 2 * (middle - n.getEastNorth().east()), 0.0));
        }

        Main.main.undoRedo.add(new SequenceCommand(tr("Mirror"), cmds));
        Main.map.repaint();
    }
View Full Code Here

        getCurrentDataSet().beginUpdate();
        if (c instanceof MoveCommand && affectedNodes.equals(((MoveCommand)c).getParticipatingPrimitives())) {
            ((MoveCommand)c).moveAgain(distx, disty);
        } else {
            Main.main.undoRedo.add(
                    c = new MoveCommand(selection, distx, disty));
        }
        getCurrentDataSet().endUpdate();

        for (Node n : affectedNodes) {
            if (n.getCoor().isOutSideWorld()) {
View Full Code Here

TOP

Related Classes of org.openstreetmap.josm.command.MoveCommand

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.