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

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

fix forgotten @since xxx

  • Property svn:eol-style set to native
File size: 2.0 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.HashSet;
7import java.util.List;
8import java.util.Set;
9
10import org.openstreetmap.josm.data.osm.DataSet;
11import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
12import org.openstreetmap.josm.data.osm.Node;
13import org.openstreetmap.josm.data.osm.Way;
14
15/**
16 * Command that removes a set of nodes from a way.
17 * The same can be done with ChangeNodesCommand, but this is more
18 * efficient. (Needed for the tool to disconnect nodes from ways.)
19 *
20 * @author Giuseppe Bilotta
21 */
22public class RemoveNodesCommand extends AbstractNodesCommand<Set<Node>> {
23
24 /**
25 * Constructs a new {@code RemoveNodesCommand}.
26 * @param way The way to modify. Must not be null, and belong to a data set
27 * @param rmNodes The list of nodes to remove
28 * @deprecated Use {@link #RemoveNodesCommand(Way, Set)}
29 */
30 @Deprecated
31 public RemoveNodesCommand(Way way, List<Node> rmNodes) {
32 super(way.getDataSet(), way, new HashSet<>(rmNodes));
33 }
34
35 /**
36 * Constructs a new {@code RemoveNodesCommand}.
37 * @param way The way to modify. Must not be null, and belong to a data set
38 * @param rmNodes The set of nodes to remove
39 * @since 15013
40 */
41 public RemoveNodesCommand(Way way, Set<Node> rmNodes) {
42 super(way.getDataSet(), way, rmNodes);
43 }
44
45 /**
46 * Constructs a new {@code RemoveNodesCommand}.
47 * @param ds The target data set. Must not be {@code null}
48 * @param way The way to modify. Must not be null, and belong to a data set
49 * @param rmNodes The list of nodes to remove
50 * @since 15013
51 */
52 public RemoveNodesCommand(DataSet ds, Way way, Set<Node> rmNodes) {
53 super(ds, way, rmNodes);
54 }
55
56 @Override
57 protected void modifyWay() {
58 way.removeNodes(cmdNodes);
59 }
60
61 @Override
62 public String getDescriptionText() {
63 return tr("Removed nodes from {0}", way.getDisplayName(DefaultNameFormatter.getInstance()));
64 }
65}
Note: See TracBrowser for help on using the repository browser.