|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.josm.command.PseudoCommand
org.openstreetmap.josm.command.Command
public abstract class Command
Classes implementing Command modify a dataset in a specific way. A command is
one atomic action on a specific dataset, such as move or delete.
The command remembers the OsmDataLayer
it is operating on.
Nested Class Summary | |
---|---|
private static class |
Command.CloneVisitor
|
Field Summary | |
---|---|
private java.util.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 Summary | |
---|---|
Command()
|
|
Command(OsmDataLayer layer)
Creates a new command in the context of a specific data layer |
Method Summary | |
---|---|
static boolean |
checkAndConfirmOutlyingOperation(java.lang.String operation,
java.lang.String dialogTitle,
java.lang.String outsideDialogMessage,
java.lang.String incompleteDialogMessage,
java.awt.geom.Area area,
java.util.Collection<? extends OsmPrimitive> primitives,
java.util.Collection<? extends OsmPrimitive> ignore)
Check whether user is about to operate on data outside of the download area. |
boolean |
executeCommand()
Executes the command on the dataset. |
abstract 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. |
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. |
java.util.Collection<? extends OsmPrimitive> |
getParticipatingPrimitives()
Return the primitives that take part in this command. |
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. |
private static boolean |
isOutlying(OsmPrimitive osm,
java.awt.geom.Area area)
|
void |
undoCommand()
Undoes the command. |
Methods inherited from class org.openstreetmap.josm.command.PseudoCommand |
---|
getChildren, getDescriptionIcon, getDescriptionText |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.Map<OsmPrimitive,PrimitiveData> cloneMap
private OsmDataLayer layer
Constructor Detail |
---|
public Command()
public Command(OsmDataLayer layer) throws java.lang.IllegalArgumentException
layer
- the data layer. Must not be null.
java.lang.IllegalArgumentException
- thrown if layer is nullMethod Detail |
---|
public boolean executeCommand()
public void undoCommand()
public boolean invalidBecauselayerRemoved(Layer oldLayer)
oldLayer
- the old layer
public PrimitiveData getOrig(OsmPrimitive osm)
protected OsmDataLayer getLayer()
public abstract void fillModifiedData(java.util.Collection<OsmPrimitive> modified, java.util.Collection<OsmPrimitive> deleted, java.util.Collection<OsmPrimitive> added)
modified
- The modified primitivesdeleted
- The deleted primitivesadded
- The added primitivespublic java.util.Collection<? extends OsmPrimitive> getParticipatingPrimitives()
getParticipatingPrimitives
in class PseudoCommand
public static boolean checkAndConfirmOutlyingOperation(java.lang.String operation, java.lang.String dialogTitle, java.lang.String outsideDialogMessage, java.lang.String incompleteDialogMessage, java.awt.geom.Area area, java.util.Collection<? extends OsmPrimitive> primitives, java.util.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 incompletearea
- the area used to determine whether data is outlyingprimitives
- the primitives to operate onignore
- null
or a primitive to be ignored
private static boolean isOutlying(OsmPrimitive osm, java.awt.geom.Area area)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |