Package org.openstreetmap.josm.command
Class ChangeMembersCommand
- java.lang.Object
-
- org.openstreetmap.josm.command.Command
-
- org.openstreetmap.josm.command.ChangeMembersCommand
-
- All Implemented Interfaces:
PseudoCommand
public class ChangeMembersCommand extends Command
Command that changes the members of a relation. The same can be done with ChangeCommand, but this is more efficient.- Since:
- 17199
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.command.Command
Command.OldNodeState
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<RelationMember>cmdMembersprivate Relationrelation-
Fields inherited from class org.openstreetmap.josm.command.Command
IS_INCOMPLETE, IS_OK, IS_OUTSIDE
-
-
Constructor Summary
Constructors Constructor Description ChangeMembersCommand(DataSet data, Relation relation, java.util.List<RelationMember> newMembers)Constructs a newChangeMembersCommandin the context of a given data set.ChangeMembersCommand(Relation relation, java.util.List<RelationMember> newMembers)Constructs a newChangeMembersCommandin the context ofrdata set.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)booleanexecuteCommand()Executes the command on the dataset.voidfillModifiedData(java.util.Collection<OsmPrimitive> modified, java.util.Collection<OsmPrimitive> deleted, java.util.Collection<OsmPrimitive> added)Fill in the changed data this command operates on.java.lang.StringgetDescriptionText()Provides a description text representing this command.inthashCode()-
Methods inherited from class org.openstreetmap.josm.command.Command
checkOutlyingOrIncompleteOperation, ensurePrimitivesAreInDataset, getAffectedDataSet, getOrig, getParticipatingPrimitives, undoCommand
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openstreetmap.josm.command.PseudoCommand
getChildren, getDescriptionIcon
-
-
-
-
Field Detail
-
cmdMembers
private final java.util.List<RelationMember> cmdMembers
-
-
Constructor Detail
-
ChangeMembersCommand
public ChangeMembersCommand(DataSet data, Relation relation, java.util.List<RelationMember> newMembers)
Constructs a newChangeMembersCommandin the context of a given data set.- Parameters:
data- the data set. Must not be null.relation- the relationnewMembers- the new member list, must not be empty
-
ChangeMembersCommand
public ChangeMembersCommand(Relation relation, java.util.List<RelationMember> newMembers)
Constructs a newChangeMembersCommandin the context ofrdata set.- Parameters:
relation- the relation. It must belong to a data setnewMembers- the new member list, must not be empty
-
-
Method Detail
-
executeCommand
public boolean executeCommand()
Description copied from class:CommandExecutes the command on the dataset. This implementation will remember all primitives returned by fillModifiedData for restoring them on undo.The layer should be invalidated after execution so that it can be re-painted.
- Overrides:
executeCommandin classCommand- Returns:
- true
-
getDescriptionText
public java.lang.String getDescriptionText()
Description copied from interface:PseudoCommandProvides a description text representing this command.- Returns:
- description text representing this command
-
fillModifiedData
public void fillModifiedData(java.util.Collection<OsmPrimitive> modified, java.util.Collection<OsmPrimitive> deleted, java.util.Collection<OsmPrimitive> added)
Description copied from class:CommandFill in the changed data this command operates on. Add to the lists, don't clear them.- Specified by:
fillModifiedDatain classCommand- Parameters:
modified- The modified primitivesdeleted- The deleted primitivesadded- The added primitives
-
-