public class PurgeCommand extends Command
Command.OldNodeState
Modifier and Type | Field and Description |
---|---|
protected Storage<PrimitiveData> |
makeIncompleteData |
protected java.util.Map<PrimitiveId,PrimitiveData> |
makeIncompleteDataByPrimId |
protected ConflictCollection |
purgedConflicts |
protected java.util.List<OsmPrimitive> |
toPurge |
IS_INCOMPLETE, IS_OK, IS_OUTSIDE
Constructor and Description |
---|
PurgeCommand(DataSet data,
java.util.Collection<OsmPrimitive> toPurge,
java.util.Collection<OsmPrimitive> makeIncomplete)
Constructs a new
PurgeCommand (does not handle conflicts). |
Modifier and Type | Method and Description |
---|---|
static PurgeCommand |
build(java.util.Collection<OsmPrimitive> sel,
java.util.List<OsmPrimitive> toPurgeAdditionally)
Creates a new
PurgeCommand to purge selected OSM primitives. |
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.
|
java.util.Collection<? extends OsmPrimitive> |
getParticipatingPrimitives()
Return the primitives that take part in this command.
|
int |
hashCode() |
private static boolean |
hasOnlyIncompleteMembers(Relation r,
java.util.Collection<OsmPrimitive> toPurge,
java.util.Collection<? extends OsmPrimitive> moreToPurge) |
private void |
init(java.util.Collection<OsmPrimitive> toPurge,
java.util.Collection<OsmPrimitive> makeIncomplete) |
protected void |
saveIncomplete(java.util.Collection<OsmPrimitive> makeIncomplete) |
static java.util.List<OsmPrimitive> |
topoSort(java.util.Collection<OsmPrimitive> sel)
Sorts a collection of primitives such that for each object
its referrers come later in the sorted collection.
|
void |
undoCommand()
Undoes the command.
|
checkOutlyingOrIncompleteOperation, ensurePrimitivesAreInDataset, getAffectedDataSet, getOrig
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getChildren
protected java.util.List<OsmPrimitive> toPurge
protected Storage<PrimitiveData> makeIncompleteData
protected java.util.Map<PrimitiveId,PrimitiveData> makeIncompleteDataByPrimId
protected final ConflictCollection purgedConflicts
public PurgeCommand(DataSet data, java.util.Collection<OsmPrimitive> toPurge, java.util.Collection<OsmPrimitive> makeIncomplete)
PurgeCommand
(does not handle conflicts).
This command relies on a number of consistency conditions:
- makeIncomplete must be a subset of toPurge.
- Each primitive, that is in toPurge but not in makeIncomplete, must have all its referrers in toPurge.
- Each element of makeIncomplete must not be new and must have only referrers that are either a relation or included in toPurge.data
- OSM data settoPurge
- primitives to purgemakeIncomplete
- primitives to make incompleteprivate void init(java.util.Collection<OsmPrimitive> toPurge, java.util.Collection<OsmPrimitive> makeIncomplete)
protected final void saveIncomplete(java.util.Collection<OsmPrimitive> makeIncomplete)
public boolean executeCommand()
Command
The layer should be invalidated after execution so that it can be re-painted.
executeCommand
in class Command
public void undoCommand()
Command
undoCommand
in class Command
public static java.util.List<OsmPrimitive> topoSort(java.util.Collection<OsmPrimitive> sel)
sel
- collection of primitives to sortpublic java.lang.String getDescriptionText()
PseudoCommand
public javax.swing.Icon getDescriptionIcon()
PseudoCommand
public java.util.Collection<? extends OsmPrimitive> getParticipatingPrimitives()
Command
getParticipatingPrimitives
in interface PseudoCommand
getParticipatingPrimitives
in class Command
public void fillModifiedData(java.util.Collection<OsmPrimitive> modified, java.util.Collection<OsmPrimitive> deleted, java.util.Collection<OsmPrimitive> added)
Command
fillModifiedData
in class Command
modified
- The modified primitivesdeleted
- The deleted primitivesadded
- The added primitivespublic static PurgeCommand build(java.util.Collection<OsmPrimitive> sel, java.util.List<OsmPrimitive> toPurgeAdditionally)
PurgeCommand
to purge selected OSM primitives.sel
- selected OSM primitivestoPurgeAdditionally
- optional list that will be filled with primitives to be purged that have not been in the selectionprivate static boolean hasOnlyIncompleteMembers(Relation r, java.util.Collection<OsmPrimitive> toPurge, java.util.Collection<? extends OsmPrimitive> moreToPurge)