public class ChangeCommand extends Command
Command.OldNodeState| Modifier and Type | Field and Description |
|---|---|
private OsmPrimitive |
newOsm |
private OsmPrimitive |
osm |
IS_INCOMPLETE, IS_OK, IS_OUTSIDE| Constructor and Description |
|---|
ChangeCommand(DataSet data,
OsmPrimitive osm,
OsmPrimitive newOsm)
Constructs a new
ChangeCommand in the context of a given data set. |
ChangeCommand(OsmPrimitive osm,
OsmPrimitive newOsm)
Constructs a new
ChangeCommand in the context of osm data set. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
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.
|
OsmPrimitive |
getNewOsmPrimitive()
Returns the new OSM primitive.
|
OsmPrimitive |
getOsmPrimitive()
Returns the original OSM primitive to modify.
|
int |
hashCode() |
private void |
sanityChecks() |
checkOutlyingOrIncompleteOperation, ensurePrimitivesAreInDataset, getAffectedDataSet, getOrig, getParticipatingPrimitives, undoCommandclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetChildrenprivate final OsmPrimitive osm
private final OsmPrimitive newOsm
public ChangeCommand(OsmPrimitive osm, OsmPrimitive newOsm)
ChangeCommand in the context of osm data set.osm - The existing primitive to modify. It must belong to a data setnewOsm - The new primitivepublic ChangeCommand(DataSet data, OsmPrimitive osm, OsmPrimitive newOsm)
ChangeCommand in the context of a given data set.data - The data setosm - The existing primitive to modifynewOsm - The new primitiveprivate void sanityChecks()
public boolean executeCommand()
CommandThe layer should be invalidated after execution so that it can be re-painted.
executeCommand 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()
PseudoCommandpublic javax.swing.Icon getDescriptionIcon()
PseudoCommandpublic final OsmPrimitive getOsmPrimitive()
public final OsmPrimitive getNewOsmPrimitive()