public class ChangeCommand extends Command
Command.OldNodeState| Modifier and Type | Field and Description |
|---|---|
private OsmPrimitive |
newOsm |
private OsmPrimitive |
osm |
| Constructor and Description |
|---|
ChangeCommand(OsmDataLayer layer,
OsmPrimitive osm,
OsmPrimitive newOsm)
Constructs a new
ChangeCommand in the context of a given data layer. |
ChangeCommand(OsmPrimitive osm,
OsmPrimitive newOsm)
Constructs a new
ChangeCommand in the context of the current edit layer, if any. |
| 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.
|
javax.swing.Icon |
getDescriptionIcon()
Provides a descriptive icon of this command.
|
java.lang.String |
getDescriptionText()
Provides a description text representing this command.
|
private void |
sanityChecks() |
checkAndConfirmOutlyingOperation, getLayer, getOrig, getParticipatingPrimitives, invalidBecauselayerRemoved, undoCommandgetChildrenprivate final OsmPrimitive osm
private final OsmPrimitive newOsm
public ChangeCommand(OsmPrimitive osm, OsmPrimitive newOsm)
ChangeCommand in the context of the current edit layer, if any.osm - The existing primitive to modifynewOsm - The new primitivepublic ChangeCommand(OsmDataLayer layer, OsmPrimitive osm, OsmPrimitive newOsm)
ChangeCommand in the context of a given data layer.layer - The data layerosm - The existing primitive to modifynewOsm - The new primitiveprivate void sanityChecks()
public 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 PseudoCommand