Changeset 12641 in josm for trunk/src/org/openstreetmap/josm/actions/mapmode
- Timestamp:
- 2017-08-25T03:01:22+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions/mapmode
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
r12636 r12641 157 157 // if c is null, an error occurred or the user aborted. Don't do anything in that case. 158 158 if (c != null) { 159 Main .main.undoRedo.add(c);159 MainApplication.undoRedo.add(c); 160 160 //FIXME: This should not be required, DeleteCommand should update the selection, otherwise undo/redo won't work. 161 161 lm.getEditDataSet().setSelected(); … … 304 304 Command c = buildDeleteCommands(e, e.getModifiersEx(), false); 305 305 if (c != null) { 306 Main .main.undoRedo.add(c);306 MainApplication.undoRedo.add(c); 307 307 } 308 308 … … 355 355 if (cmd != null) { 356 356 // cmd can be null if the user cancels dialogs DialogCommand displays 357 Main .main.undoRedo.add(cmd);357 MainApplication.undoRedo.add(cmd); 358 358 for (Relation relation : toDelete) { 359 359 if (layer.data.getSelectedRelations().contains(relation)) { -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r12639 r12641 617 617 Command c = new SequenceCommand(title, cmds); 618 618 619 Main .main.undoRedo.add(c);619 MainApplication.undoRedo.add(c); 620 620 if (!wayIsFinished) { 621 621 lastUsedNode = n; … … 1334 1334 @Override 1335 1335 public void actionPerformed(ActionEvent e) { 1336 Main .main.undoRedo.undo();1337 Command lastCmd = Main .main.undoRedo.getLastCommand();1336 MainApplication.undoRedo.undo(); 1337 Command lastCmd = MainApplication.undoRedo.getLastCommand(); 1338 1338 if (lastCmd == null) return; 1339 1339 Node n = null; -
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r12636 r12641 496 496 moveCommand2 = new MoveCommand(movingNodeList.get(1), movement2.getX(), movement2.getY()); 497 497 Command c = new SequenceCommand(tr("Extrude Way"), moveCommand, moveCommand2); 498 Main .main.undoRedo.add(c);498 MainApplication.undoRedo.add(c); 499 499 } else { 500 500 // reuse existing move commands … … 511 511 //make a new move command 512 512 moveCommand = new MoveCommand(new ArrayList<OsmPrimitive>(movingNodeList), bestMovement); 513 Main .main.undoRedo.add(moveCommand);513 MainApplication.undoRedo.add(moveCommand); 514 514 } else { 515 515 //reuse existing move command … … 594 594 SequenceCommand cmds = new SequenceCommand(tr("Add a new node to an existing way"), 595 595 new AddCommand(n), new ChangeCommand(ws.way, wnew)); 596 Main .main.undoRedo.add(cmds);596 MainApplication.undoRedo.add(cmds); 597 597 } 598 598 } … … 624 624 cmds.add(new AddCommand(wnew)); 625 625 Command c = new SequenceCommand(tr("Extrude Way"), cmds); 626 Main .main.undoRedo.add(c);626 MainApplication.undoRedo.add(c); 627 627 getLayerManager().getEditDataSet().setSelected(wnew); 628 628 } … … 712 712 } 713 713 Command c = new SequenceCommand(tr("Extrude Way"), cmds); 714 Main .main.undoRedo.add(c);714 MainApplication.undoRedo.add(c); 715 715 joinNodesIfCollapsed(changedNodes); 716 716 } … … 724 724 Command mergeCmd = MergeNodesAction.mergeNodes(MainApplication.getLayerManager().getEditLayer(), changedNodes, targetNode, locNode); 725 725 if (mergeCmd != null) { 726 Main .main.undoRedo.add(mergeCmd);726 MainApplication.undoRedo.add(mergeCmd); 727 727 } else { 728 728 // undo extruding command itself 729 Main .main.undoRedo.undo();729 MainApplication.undoRedo.undo(); 730 730 } 731 731 } -
trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java
r12630 r12641 473 473 virtualSegments.size(), virtualSegments.size()); 474 474 475 Main .main.undoRedo.add(new SequenceCommand(text, virtualCmds));475 MainApplication.undoRedo.add(new SequenceCommand(text, virtualCmds)); 476 476 477 477 } else if (alt && !ctrl && candidateNode != null) { … … 490 490 final Command deleteCmd = DeleteCommand.delete(getLayerManager().getEditLayer(), Collections.singleton(targetWay), true); 491 491 if (deleteCmd != null) { 492 Main .main.undoRedo.add(deleteCmd);492 MainApplication.undoRedo.add(deleteCmd); 493 493 } 494 494 } else { 495 Main .main.undoRedo.add(new ChangeCommand(targetWay, newWay));495 MainApplication.undoRedo.add(new ChangeCommand(targetWay, newWay)); 496 496 } 497 497 } else if (candidateNode.isTagged()) { … … 502 502 final Command deleteCmd = DeleteCommand.delete(getLayerManager().getEditLayer(), Collections.singleton(candidateNode), true); 503 503 if (deleteCmd != null) { 504 Main .main.undoRedo.add(deleteCmd);504 MainApplication.undoRedo.add(deleteCmd); 505 505 } 506 506 } … … 512 512 EastNorth cursorEN = mv.getEastNorth(mousePos.x, mousePos.y); 513 513 514 Main .main.undoRedo.add(new MoveCommand(candidateNode, cursorEN.east() - nodeEN.east(), cursorEN.north() - nodeEN.north()));514 MainApplication.undoRedo.add(new MoveCommand(candidateNode, cursorEN.east() - nodeEN.east(), cursorEN.north() - nodeEN.north())); 515 515 } 516 516 } -
trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWays.java
r12463 r12641 11 11 import java.util.Set; 12 12 13 import org.openstreetmap.josm.Main;14 13 import org.openstreetmap.josm.command.AddCommand; 15 14 import org.openstreetmap.josm.command.Command; … … 19 18 import org.openstreetmap.josm.data.osm.NodeGraph; 20 19 import org.openstreetmap.josm.data.osm.Way; 20 import org.openstreetmap.josm.gui.MainApplication; 21 21 import org.openstreetmap.josm.tools.Geometry; 22 22 … … 182 182 */ 183 183 public void commit() { 184 Main .main.undoRedo.add(new SequenceCommand("Make parallel way(s)", makeAddWayAndNodesCommandList()));184 MainApplication.undoRedo.add(new SequenceCommand("Make parallel way(s)", makeAddWayAndNodesCommandList())); 185 185 } 186 186 -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r12636 r12641 711 711 } else { 712 712 c = new MoveCommand(selection, startEN, currentEN); 713 Main .main.undoRedo.add(c);713 MainApplication.undoRedo.add(c); 714 714 } 715 715 for (Node n : affectedNodes) { … … 744 744 ((RotateCommand) c).handleEvent(currentEN); 745 745 } else { 746 Main .main.undoRedo.add(new RotateCommand(selection, currentEN));746 MainApplication.undoRedo.add(new RotateCommand(selection, currentEN)); 747 747 } 748 748 } else if (mode == Mode.SCALE) { … … 750 750 ((ScaleCommand) c).handleEvent(currentEN); 751 751 } else { 752 Main .main.undoRedo.add(new ScaleCommand(selection, currentEN));752 MainApplication.undoRedo.add(new ScaleCommand(selection, currentEN)); 753 753 } 754 754 } … … 799 799 */ 800 800 private static Command getLastCommandInDataset(DataSet ds) { 801 Command lastCommand = Main .main.undoRedo.getLastCommand();801 Command lastCommand = MainApplication.undoRedo.getLastCommand(); 802 802 if (lastCommand instanceof SequenceCommand) { 803 803 lastCommand = ((SequenceCommand) lastCommand).getLastCommand(); … … 825 825 ed.showDialog(); 826 826 if (ed.getValue() != 1) { 827 Main .main.undoRedo.undo();827 MainApplication.undoRedo.undo(); 828 828 } 829 829 } … … 848 848 849 849 if (ed.getValue() != 1) { 850 Main .main.undoRedo.undo();850 MainApplication.undoRedo.undo(); 851 851 } 852 852 } else { … … 1247 1247 "Add and move a virtual new node to {0} ways", virtualWays.size(), 1248 1248 virtualWays.size()); 1249 Main .main.undoRedo.add(new SequenceCommand(text, virtualCmds));1249 MainApplication.undoRedo.add(new SequenceCommand(text, virtualCmds)); 1250 1250 getLayerManager().getEditDataSet().setSelected(Collections.singleton((OsmPrimitive) virtualNode)); 1251 1251 clear();
Note:
See TracChangeset
for help on using the changeset viewer.