Changeset 12726 in josm for trunk/src/org/openstreetmap/josm/io
- Timestamp:
- 2017-09-04T23:45:49+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io/remotecontrol/handler
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandler.java
r12641 r12726 12 12 import org.openstreetmap.josm.command.AddCommand; 13 13 import org.openstreetmap.josm.data.coor.LatLon; 14 import org.openstreetmap.josm.data.osm.DataSet; 14 15 import org.openstreetmap.josm.data.osm.Node; 15 16 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 96 97 } 97 98 99 DataSet ds = MainApplication.getLayerManager().getEditDataSet(); 98 100 if (node == null) { 99 101 node = new Node(ll); 100 102 // Now execute the commands to add this node. 101 MainApplication.undoRedo.add(new AddCommand( node));103 MainApplication.undoRedo.add(new AddCommand(ds, node)); 102 104 } 103 105 104 MainApplication.getLayerManager().getEditDataSet().setSelected(node);106 ds.setSelected(node); 105 107 if (PermissionPrefWithDefault.CHANGE_VIEWPORT.isAllowed()) { 106 108 AutoScaleAction.autoScale("selection"); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandler.java
r12641 r12726 19 19 import org.openstreetmap.josm.command.SequenceCommand; 20 20 import org.openstreetmap.josm.data.coor.LatLon; 21 import org.openstreetmap.josm.data.osm.DataSet; 21 22 import org.openstreetmap.josm.data.osm.Node; 22 23 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 148 149 nd = new Node(ll); 149 150 // Now execute the commands to add this node. 150 commands.add(new AddCommand( nd));151 commands.add(new AddCommand(Main.main.getEditDataSet(), nd)); 151 152 addedNodes.put(ll, nd); 152 153 } … … 166 167 } 167 168 allCoordinates.clear(); 168 commands.add(new AddCommand(way)); 169 DataSet ds = MainApplication.getLayerManager().getEditDataSet(); 170 commands.add(new AddCommand(ds, way)); 169 171 MainApplication.undoRedo.add(new SequenceCommand(tr("Add way"), commands)); 170 MainApplication.getLayerManager().getEditDataSet().setSelected(way);172 ds.setSelected(way); 171 173 if (PermissionPrefWithDefault.CHANGE_VIEWPORT.isAllowed()) { 172 174 AutoScaleAction.autoScale("selection");
Note:
See TracChangeset
for help on using the changeset viewer.