source: josm/trunk/src/org/openstreetmap/josm/command/RemoveNodesCommand.java

Last change on this file was 15390, checked in by Don-vip, 5 years ago

remove deprecated code

  • Property svn:eol-style set to native
File size: 1.6 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.command;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import java.util.Set;
7
8import org.openstreetmap.josm.data.osm.DataSet;
9import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
10import org.openstreetmap.josm.data.osm.Node;
11import org.openstreetmap.josm.data.osm.Way;
12
13/**
14 * Command that removes a set of nodes from a way.
15 * The same can be done with ChangeNodesCommand, but this is more
16 * efficient. (Needed for the tool to disconnect nodes from ways.)
17 *
18 * @author Giuseppe Bilotta
19 */
20public class RemoveNodesCommand extends AbstractNodesCommand<Set<Node>> {
21
22 /**
23 * Constructs a new {@code RemoveNodesCommand}.
24 * @param way The way to modify. Must not be null, and belong to a data set
25 * @param rmNodes The set of nodes to remove
26 * @since 15013
27 */
28 public RemoveNodesCommand(Way way, Set<Node> rmNodes) {
29 super(way.getDataSet(), way, rmNodes);
30 }
31
32 /**
33 * Constructs a new {@code RemoveNodesCommand}.
34 * @param ds The target data set. Must not be {@code null}
35 * @param way The way to modify. Must not be null, and belong to a data set
36 * @param rmNodes The list of nodes to remove
37 * @since 15013
38 */
39 public RemoveNodesCommand(DataSet ds, Way way, Set<Node> rmNodes) {
40 super(ds, way, rmNodes);
41 }
42
43 @Override
44 protected void modifyWay() {
45 way.removeNodes(cmdNodes);
46 }
47
48 @Override
49 public String getDescriptionText() {
50 return tr("Removed nodes from {0}", way.getDisplayName(DefaultNameFormatter.getInstance()));
51 }
52}
Note: See TracBrowser for help on using the repository browser.