Class ChangePropertyKeyCommand

    • Field Detail

      • objects

        private final java.util.List<? extends OsmPrimitive> objects
        All primitives, that are affected with this command.
      • key

        private final java.lang.String key
        The key that is subject to change.
      • newKey

        private final java.lang.String newKey
        The mew key.
    • Constructor Detail

      • ChangePropertyKeyCommand

        public ChangePropertyKeyCommand​(OsmPrimitive object,
                                        java.lang.String key,
                                        java.lang.String newKey)
        Constructs a new ChangePropertyKeyCommand.
        Parameters:
        object - the object subject to change replacement. Must not be null, and belong to a data set
        key - The key to replace
        newKey - the new value of the key
        Since:
        6329
      • ChangePropertyKeyCommand

        public ChangePropertyKeyCommand​(java.util.Collection<? extends OsmPrimitive> objects,
                                        java.lang.String key,
                                        java.lang.String newKey)
        Constructs a new ChangePropertyKeyCommand.
        Parameters:
        objects - all objects subject to change replacement. Must not be null or empty, and objects must belong to a data set
        key - The key to replace
        newKey - the new value of the key
        Throws:
        java.lang.NullPointerException - if objects is null or contain null item
        java.util.NoSuchElementException - if objects is empty
      • ChangePropertyKeyCommand

        public ChangePropertyKeyCommand​(DataSet ds,
                                        java.util.Collection<? extends OsmPrimitive> objects,
                                        java.lang.String key,
                                        java.lang.String newKey)
        Constructs a new ChangePropertyKeyCommand.
        Parameters:
        ds - The target data set. Must not be null
        objects - all objects subject to change replacement.
        key - The key to replace
        newKey - the new value of the key
        Since:
        12726
    • Method Detail

      • 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
      • fillModifiedData

        public void fillModifiedData​(java.util.Collection<OsmPrimitive> modified,
                                     java.util.Collection<OsmPrimitive> deleted,
                                     java.util.Collection<OsmPrimitive> added)
        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

        public java.lang.String getDescriptionText()
        Description copied from interface: PseudoCommand
        Provides a description text representing this command.
        Returns:
        description text representing this command
      • getDescriptionIcon

        public javax.swing.Icon getDescriptionIcon()
        Description copied from interface: PseudoCommand
        Provides a descriptive icon of this command.
        Returns:
        descriptive icon of this command
      • getChildren

        public java.util.Collection<PseudoCommandgetChildren()
        Description copied from interface: PseudoCommand
        Returns the subcommands of this command. Override for subclasses that have child commands.
        Returns:
        the subcommands, null if there are no child commands
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class Command