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
  • Field Details

  • Constructor Details

    • ChangeRelationMemberRoleCommand

      public ChangeRelationMemberRoleCommand(Relation relation, int position, String newRole)
      Constructs a new ChangeRelationMemberRoleCommand.
      Parameters:
      relation - The relation to be changed. Must not be null, and belong to a data set
      position - Member position
      newRole - New role
    • ChangeRelationMemberRoleCommand

      public ChangeRelationMemberRoleCommand(DataSet dataSet, Relation relation, int position, String newRole)
      Constructs a new ChangeRelationMemberRoleCommand.
      Parameters:
      dataSet - The data set the role is in. Must not be null
      relation - The relation to be changed
      position - Member position
      newRole - New role
      Since:
      12355
  • Method Details

    • executeCommand

      public boolean executeCommand()
      Description copied from class: Command
      Executes 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:
      executeCommand in class Command
      Returns:
      true
    • undoCommand

      public void undoCommand()
      Description copied from class: Command
      Undoes 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:
      undoCommand in class Command
    • fillModifiedData

      Description copied from class: Command
      Fill in the changed data this command operates on. Add to the lists, don't clear them.
      Specified by:
      fillModifiedData in class Command
      Parameters:
      modified - The modified primitives
      deleted - The deleted primitives
      added - The added primitives
    • getDescriptionText

      Description copied from interface: PseudoCommand
      Provides a description text representing this command.
      Returns:
      description text representing this command
    • getDescriptionIcon

      Description copied from interface: PseudoCommand
      Provides a descriptive icon of this command.
      Returns:
      descriptive icon of this command
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Command
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Command