Package org.openstreetmap.josm.command
Class ChangeRelationMemberRoleCommand
java.lang.Object
org.openstreetmap.josm.command.Command
org.openstreetmap.josm.command.ChangeRelationMemberRoleCommand
- All Implemented Interfaces:
PseudoCommand
Command that changes the role of a relation member
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openstreetmap.josm.command.Command
Command.OldNodeState -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate Booleanprivate Stringprivate final intprivate final RelationFields inherited from class org.openstreetmap.josm.command.Command
IS_INCOMPLETE, IS_OK, IS_OUTSIDE -
Constructor Summary
ConstructorsConstructorDescriptionChangeRelationMemberRoleCommand(DataSet dataSet, Relation relation, int position, String newRole) Constructs a newChangeRelationMemberRoleCommand.ChangeRelationMemberRoleCommand(Relation relation, int position, String newRole) Constructs a newChangeRelationMemberRoleCommand. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanExecutes the command on the dataset.voidfillModifiedData(Collection<OsmPrimitive> modified, Collection<OsmPrimitive> deleted, Collection<OsmPrimitive> added) Fill in the changed data this command operates on.Provides a descriptive icon of this command.Provides a description text representing this command.inthashCode()voidUndoes the command.Methods inherited from class org.openstreetmap.josm.command.Command
checkOutlyingOrIncompleteOperation, ensurePrimitivesAreInDataset, getAffectedDataSet, getOrig, getParticipatingPrimitivesMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openstreetmap.josm.command.PseudoCommand
getChildren
-
Field Details
-
relation
-
position
-
newRole
-
oldRole
-
oldModified
-
-
Constructor Details
-
ChangeRelationMemberRoleCommand
Constructs a newChangeRelationMemberRoleCommand.- Parameters:
relation- The relation to be changed. Must not be null, and belong to a data setposition- Member positionnewRole- New role
-
ChangeRelationMemberRoleCommand
public ChangeRelationMemberRoleCommand(DataSet dataSet, Relation relation, int position, String newRole) Constructs a newChangeRelationMemberRoleCommand.- Parameters:
dataSet- The data set the role is in. Must not benullrelation- The relation to be changedposition- Member positionnewRole- New role- Since:
- 12355
-
-
Method Details
-
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
-
undoCommand
Description copied from class:CommandUndoes the command. It can be assumed that all objects are in the same state they were before. It can also be assumed that executeCommand was called exactly once before. This implementation undoes all objects stored by a former call to executeCommand.- Overrides:
undoCommandin classCommand
-
fillModifiedData
public void fillModifiedData(Collection<OsmPrimitive> modified, Collection<OsmPrimitive> deleted, 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
-
getDescriptionText
Description copied from interface:PseudoCommandProvides a description text representing this command.- Returns:
- description text representing this command
-
getDescriptionIcon
Description copied from interface:PseudoCommandProvides a descriptive icon of this command.- Returns:
- descriptive icon of this command
-
hashCode
-
equals
-