Changeset 12689 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2017-08-28T19:09:01+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java
r12663 r12689 93 93 if (targetNode != null) { 94 94 Node targetLocationNode = selectTargetLocationNode(selectedNodes); 95 Command cmd = mergeNodes( getLayerManager().getEditLayer(),selectedNodes, targetNode, targetLocationNode);95 Command cmd = mergeNodes(selectedNodes, targetNode, targetLocationNode); 96 96 if (cmd != null) { 97 97 MainApplication.undoRedo.add(cmd); … … 272 272 273 273 if (target != null) { 274 Command cmd = mergeNodes( layer,nodes, target, targetLocationNode);274 Command cmd = mergeNodes(nodes, target, targetLocationNode); 275 275 if (cmd != null) { 276 276 MainApplication.undoRedo.add(cmd); … … 281 281 282 282 /** 283 * Merges the nodes in {@code nodes} at the specified node's location. Uses the dataset 284 * managed by {@code layer} as reference. 285 * 286 * @param layer layer the reference data layer. Must not be null. 283 * Merges the nodes in {@code nodes} at the specified node's location. 284 * 285 * @param layer unused 287 286 * @param nodes the collection of nodes. Ignored if null. 288 287 * @param targetLocationNode this node's location will be used for the targetNode. 289 288 * @return The command necessary to run in order to perform action, or {@code null} if there is nothing to do 290 289 * @throws IllegalArgumentException if {@code layer} is null 291 */ 290 * @deprecated use {@link #mergeNodes(Collection, Node)} instead 291 */ 292 @Deprecated 292 293 public static Command mergeNodes(OsmDataLayer layer, Collection<Node> nodes, Node targetLocationNode) { 294 return mergeNodes(nodes, targetLocationNode); 295 } 296 297 /** 298 * Merges the nodes in {@code nodes} at the specified node's location. 299 * 300 * @param nodes the collection of nodes. Ignored if null. 301 * @param targetLocationNode this node's location will be used for the targetNode. 302 * @return The command necessary to run in order to perform action, or {@code null} if there is nothing to do 303 * @throws IllegalArgumentException if {@code layer} is null 304 * @since 12689 305 */ 306 public static Command mergeNodes(Collection<Node> nodes, Node targetLocationNode) { 293 307 if (nodes == null) { 294 308 return null; … … 296 310 Set<Node> allNodes = new HashSet<>(nodes); 297 311 allNodes.add(targetLocationNode); 298 return mergeNodes(layer, nodes, selectTargetNode(allNodes), targetLocationNode); 299 } 300 301 /** 302 * Merges the nodes in <code>nodes</code> onto one of the nodes. Uses the dataset 303 * managed by <code>layer</code> as reference. 304 * 305 * @param layer layer the reference data layer. Must not be null. 312 return mergeNodes(nodes, selectTargetNode(allNodes), targetLocationNode); 313 } 314 315 /** 316 * Merges the nodes in <code>nodes</code> onto one of the nodes. 317 * 306 318 * @param nodes the collection of nodes. Ignored if null. 307 319 * @param targetNode the target node the collection of nodes is merged to. Must not be null. … … 310 322 * @throws IllegalArgumentException if layer is null 311 323 */ 312 public static Command mergeNodes(OsmDataLayer layer, Collection<Node> nodes, Node targetNode, Node targetLocationNode) { 313 CheckParameterUtil.ensureParameterNotNull(layer, "layer"); 324 public static Command mergeNodes(Collection<Node> nodes, Node targetNode, Node targetLocationNode) { 314 325 CheckParameterUtil.ensureParameterNotNull(targetNode, "targetNode"); 315 326 if (nodes == null) { -
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r12643 r12689 722 722 Node targetNode = MergeNodesAction.selectTargetNode(changedNodes); 723 723 Node locNode = MergeNodesAction.selectTargetLocationNode(changedNodes); 724 Command mergeCmd = MergeNodesAction.mergeNodes( MainApplication.getLayerManager().getEditLayer(),changedNodes, targetNode, locNode);724 Command mergeCmd = MergeNodesAction.mergeNodes(changedNodes, targetNode, locNode); 725 725 if (mergeCmd != null) { 726 726 MainApplication.undoRedo.add(mergeCmd); -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
r12636 r12689 34 34 import org.openstreetmap.josm.data.validation.Test; 35 35 import org.openstreetmap.josm.data.validation.TestError; 36 import org.openstreetmap.josm.gui.MainApplication;37 36 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 38 37 import org.openstreetmap.josm.tools.MultiMap; … … 334 333 335 334 if (Command.checkOutlyingOrIncompleteOperation(nodes, Collections.singleton(target)) == Command.IS_OK) 336 return MergeNodesAction.mergeNodes( MainApplication.getLayerManager().getEditLayer(),nodes, target);335 return MergeNodesAction.mergeNodes(nodes, target); 337 336 } 338 337
Note:
See TracChangeset
for help on using the changeset viewer.