public class ChangePropertyCommand extends Command
Command.OldNodeState| Modifier and Type | Field and Description |
|---|---|
private java.util.List<OsmPrimitive> |
objects
All primitives that are affected with this command.
|
private java.util.AbstractMap<java.lang.String,java.lang.String> |
tags
Key and value pairs.
|
| Constructor and Description |
|---|
ChangePropertyCommand(java.util.Collection<? extends OsmPrimitive> objects,
java.util.AbstractMap<java.lang.String,java.lang.String> tags)
Creates a command to change multiple tags of multiple objects
|
ChangePropertyCommand(java.util.Collection<? extends OsmPrimitive> objects,
java.lang.String key,
java.lang.String value)
Creates a command to change one tag of multiple objects
|
ChangePropertyCommand(OsmPrimitive object,
java.lang.String key,
java.lang.String value)
Creates a command to change one tag of one object
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
executeCommand()
Executes the command on the dataset.
|
void |
fillModifiedData(java.util.Collection<OsmPrimitive> modified,
java.util.Collection<OsmPrimitive> deleted,
java.util.Collection<OsmPrimitive> added)
Fill in the changed data this command operates on.
|
java.util.Collection<PseudoCommand> |
getChildren()
Returns the subcommands of this command.
|
javax.swing.Icon |
getDescriptionIcon()
Provides a descriptive icon of this command.
|
java.lang.String |
getDescriptionText()
Provides a description text representing this command.
|
java.util.Map<java.lang.String,java.lang.String> |
getTags()
Returns the tags to set (key/value pairs).
|
private void |
init(java.util.Collection<? extends OsmPrimitive> objects)
Initialize the instance by finding what objects will be modified
|
checkAndConfirmOutlyingOperation, getLayer, getOrig, getParticipatingPrimitives, invalidBecauselayerRemoved, undoCommandprivate final java.util.List<OsmPrimitive> objects
private final java.util.AbstractMap<java.lang.String,java.lang.String> tags
null, delete all key references with the given
key. Otherwise, change the tags of all objects to the given value or create keys of
those objects that do not have the key yet.public ChangePropertyCommand(java.util.Collection<? extends OsmPrimitive> objects, java.util.AbstractMap<java.lang.String,java.lang.String> tags)
objects - the objects to modifytags - the tags to setpublic ChangePropertyCommand(java.util.Collection<? extends OsmPrimitive> objects, java.lang.String key, java.lang.String value)
objects - the objects to modifykey - the key of the tag to setvalue - the value of the key to setpublic ChangePropertyCommand(OsmPrimitive object, java.lang.String key, java.lang.String value)
object - the object to modifykey - the key of the tag to setvalue - the value of the key to setprivate void init(java.util.Collection<? extends OsmPrimitive> objects)
objects - the objects to (possibly) modifypublic boolean executeCommand()
CommandexecuteCommand in class Commandpublic void fillModifiedData(java.util.Collection<OsmPrimitive> modified, java.util.Collection<OsmPrimitive> deleted, java.util.Collection<OsmPrimitive> added)
CommandfillModifiedData in class Commandmodified - The modified primitivesdeleted - The deleted primitivesadded - The added primitivespublic java.lang.String getDescriptionText()
PseudoCommandgetDescriptionText in class PseudoCommandpublic javax.swing.Icon getDescriptionIcon()
PseudoCommandgetDescriptionIcon in class PseudoCommandpublic java.util.Collection<PseudoCommand> getChildren()
PseudoCommandgetChildren in class PseudoCommandpublic java.util.Map<java.lang.String,java.lang.String> getTags()