Class AddPrimitivesCommand

    • Constructor Detail

      • AddPrimitivesCommand

        public AddPrimitivesCommand​(java.util.List<PrimitiveData> data,
                                    java.util.List<PrimitiveData> toSelect,
                                    DataSet ds)
        Constructs a new AddPrimitivesCommand to add data to the given data set.
        Parameters:
        data - The OSM primitives data to add. Must not be null
        toSelect - The OSM primitives to select at the end. Can be null
        ds - The target data set. Must not be null
        Since:
        12718
      • AddPrimitivesCommand

        public AddPrimitivesCommand​(java.util.List<PrimitiveData> data,
                                    DataSet ds)
        Constructs a new AddPrimitivesCommand to add data to the given data set.
        Parameters:
        data - The OSM primitives data to add and select. Must not be null
        ds - The target data set. Must not be null
        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
      • 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
      • getDescriptionText

        public java.lang.String getDescriptionText()
        Description copied from interface: PseudoCommand
        Provides 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: 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
      • equals

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