public abstract class Command extends PseudoCommand
OsmDataLayer it is operating on.| Modifier and Type | Class and Description |
|---|---|
private static class |
Command.CloneVisitor |
static class |
Command.OldNodeState
Small helper for holding the interesting part of the old data state of the objects.
|
| Modifier and Type | Field and Description |
|---|---|
private Map<OsmPrimitive,PrimitiveData> |
cloneMap
the map of OsmPrimitives in the original state to OsmPrimitives in cloned state
|
private OsmDataLayer |
layer
the layer which this command is applied to
|
| Constructor and Description |
|---|
Command()
Creates a new command in the context of the current edit layer, if any
|
Command(OsmDataLayer layer)
Creates a new command in the context of a specific data layer
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
checkAndConfirmOutlyingOperation(String operation,
String dialogTitle,
String outsideDialogMessage,
String incompleteDialogMessage,
Collection<? extends OsmPrimitive> primitives,
Collection<? extends OsmPrimitive> ignore)
Check whether user is about to operate on data outside of the download area.
|
boolean |
equals(Object obj) |
boolean |
executeCommand()
Executes the command on the dataset.
|
abstract void |
fillModifiedData(Collection<OsmPrimitive> modified,
Collection<OsmPrimitive> deleted,
Collection<OsmPrimitive> added)
Fill in the changed data this command operates on.
|
protected OsmDataLayer |
getLayer()
Replies the layer this command is (or was) applied to.
|
PrimitiveData |
getOrig(OsmPrimitive osm)
Lets other commands access the original version
of the object.
|
Collection<? extends OsmPrimitive> |
getParticipatingPrimitives()
Return the primitives that take part in this command.
|
int |
hashCode() |
boolean |
invalidBecauselayerRemoved(Layer oldLayer)
Called when a layer has been removed to have the command remove itself from
any buffer if it is not longer applicable to the dataset (e.g.
|
void |
undoCommand()
Undoes the command.
|
getChildren, getDescriptionIcon, getDescriptionTextprivate Map<OsmPrimitive,PrimitiveData> cloneMap
private final OsmDataLayer layer
public Command()
public Command(OsmDataLayer layer)
layer - the data layer. Must not be null.IllegalArgumentException - if layer is nullpublic boolean executeCommand()
public void undoCommand()
public boolean invalidBecauselayerRemoved(Layer oldLayer)
oldLayer - the old layerpublic PrimitiveData getOrig(OsmPrimitive osm)
osm - The requested OSM objectprotected OsmDataLayer getLayer()
public abstract void fillModifiedData(Collection<OsmPrimitive> modified, Collection<OsmPrimitive> deleted, Collection<OsmPrimitive> added)
modified - The modified primitivesdeleted - The deleted primitivesadded - The added primitivespublic Collection<? extends OsmPrimitive> getParticipatingPrimitives()
getParticipatingPrimitives in class PseudoCommandpublic static boolean checkAndConfirmOutlyingOperation(String operation, String dialogTitle, String outsideDialogMessage, String incompleteDialogMessage, Collection<? extends OsmPrimitive> primitives, Collection<? extends OsmPrimitive> ignore)
operation - the operation name which is used for setting some preferencesdialogTitle - the title of the dialog being displayedoutsideDialogMessage - the message text to be displayed when data is outside of the download areaincompleteDialogMessage - the message text to be displayed when data is incompleteprimitives - the primitives to operate onignore - null or a primitive to be ignored