public class ChangePropertyCommand extends Command
Command.OldNodeState
Modifier and Type | Field and Description |
---|---|
private List<OsmPrimitive> |
objects
All primitives that are affected with this command.
|
private Map<String,String> |
tags
Key and value pairs.
|
Constructor and Description |
---|
ChangePropertyCommand(Collection<? extends OsmPrimitive> objects,
Map<String,String> tags)
Creates a command to change multiple tags of multiple objects
|
ChangePropertyCommand(Collection<? extends OsmPrimitive> objects,
String key,
String value)
Creates a command to change one tag of multiple objects
|
ChangePropertyCommand(OsmPrimitive object,
String key,
String value)
Creates a command to change one tag of one object
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
boolean |
executeCommand()
Executes the command on the dataset.
|
void |
fillModifiedData(Collection<OsmPrimitive> modified,
Collection<OsmPrimitive> deleted,
Collection<OsmPrimitive> added)
Fill in the changed data this command operates on.
|
Collection<PseudoCommand> |
getChildren()
Returns the subcommands of this command.
|
Icon |
getDescriptionIcon()
Provides a descriptive icon of this command.
|
String |
getDescriptionText()
Provides a description text representing this command.
|
int |
getObjectsNumber()
Returns the number of objects that will effectively be modified, before the command is executed.
|
Map<String,String> |
getTags()
Returns the tags to set (key/value pairs).
|
int |
hashCode() |
private void |
init(Collection<? extends OsmPrimitive> objects)
Initialize the instance by finding what objects will be modified
|
checkAndConfirmOutlyingOperation, getLayer, getOrig, getParticipatingPrimitives, invalidBecauselayerRemoved, undoCommand
private final List<OsmPrimitive> objects
public ChangePropertyCommand(Collection<? extends OsmPrimitive> objects, Map<String,String> tags)
objects
- the objects to modifytags
- the tags to setpublic ChangePropertyCommand(Collection<? extends OsmPrimitive> objects, String key, String value)
objects
- the objects to modifykey
- the key of the tag to setvalue
- the value of the key to setpublic ChangePropertyCommand(OsmPrimitive object, String key, String value)
object
- the object to modifykey
- the key of the tag to setvalue
- the value of the key to setprivate void init(Collection<? extends OsmPrimitive> objects)
objects
- the objects to (possibly) modifypublic boolean executeCommand()
Command
executeCommand
in class Command
public void fillModifiedData(Collection<OsmPrimitive> modified, Collection<OsmPrimitive> deleted, Collection<OsmPrimitive> added)
Command
fillModifiedData
in class Command
modified
- The modified primitivesdeleted
- The deleted primitivesadded
- The added primitivespublic String getDescriptionText()
PseudoCommand
getDescriptionText
in class PseudoCommand
public Icon getDescriptionIcon()
PseudoCommand
getDescriptionIcon
in class PseudoCommand
public Collection<PseudoCommand> getChildren()
PseudoCommand
getChildren
in class PseudoCommand
public final int getObjectsNumber()
Command.getParticipatingPrimitives()
public Map<String,String> getTags()