|
||||||||||
| 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
org.openstreetmap.josm.command.DeleteCommand
public class DeleteCommand
A command to delete a number of primitives from the dataset.
| Field Summary | |
|---|---|
private java.util.Map<OsmPrimitive,PrimitiveData> |
clonedPrimitives
|
private java.util.Collection<? extends OsmPrimitive> |
toDelete
The primitives that get deleted. |
| Constructor Summary | |
|---|---|
DeleteCommand(java.util.Collection<? extends OsmPrimitive> data)
Constructor. |
|
DeleteCommand(OsmDataLayer layer,
java.util.Collection<? extends OsmPrimitive> data)
Constructor for a collection of data to be deleted in the context of a specific layer |
|
DeleteCommand(OsmDataLayer layer,
OsmPrimitive data)
Constructor for a single data item. |
|
DeleteCommand(OsmPrimitive data)
Constructor. |
|
| Method Summary | |
|---|---|
static boolean |
checkAndConfirmOutlyingDelete(java.awt.geom.Area area,
java.util.Collection<? extends OsmPrimitive> primitives,
java.util.Collection<? extends OsmPrimitive> ignore)
|
static boolean |
checkAndConfirmOutlyingDelete(OsmDataLayer layer,
java.util.Collection<? extends OsmPrimitive> primitives,
java.util.Collection<? extends OsmPrimitive> ignore)
|
protected static java.util.Collection<Node> |
computeNodesToDelete(OsmDataLayer layer,
java.util.Collection<OsmPrimitive> primitivesToDelete)
Replies the collection of nodes referred to by primitives in primitivesToDelete which
can be deleted too. |
private static boolean |
confirmRelationDeletion(java.util.Collection<Relation> relations)
|
static Command |
delete(OsmDataLayer layer,
java.util.Collection<? extends OsmPrimitive> selection)
|
static Command |
delete(OsmDataLayer layer,
java.util.Collection<? extends OsmPrimitive> selection,
boolean alsoDeleteNodesInWay)
Try to delete all given primitives. |
static Command |
delete(OsmDataLayer layer,
java.util.Collection<? extends OsmPrimitive> selection,
boolean alsoDeleteNodesInWay,
boolean silent)
Try to delete all given primitives. |
static Command |
deleteWaySegment(OsmDataLayer layer,
WaySegment ws)
|
static Command |
deleteWithReferences(OsmDataLayer layer,
java.util.Collection<? extends OsmPrimitive> selection)
|
static Command |
deleteWithReferences(OsmDataLayer layer,
java.util.Collection<? extends OsmPrimitive> selection,
boolean silent)
Delete the primitives and everything they reference. |
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. |
java.util.Collection<PseudoCommand> |
getChildren()
Returns the subcommands of this command. |
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. |
private java.util.Set<OsmPrimitiveType> |
getTypesToDelete()
|
void |
undoCommand()
Undoes the command. |
| Methods inherited from class org.openstreetmap.josm.command.Command |
|---|
checkAndConfirmOutlyingOperation, getLayer, getOrig, invalidBecauselayerRemoved |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final java.util.Collection<? extends OsmPrimitive> toDelete
private final java.util.Map<OsmPrimitive,PrimitiveData> clonedPrimitives
| Constructor Detail |
|---|
public DeleteCommand(java.util.Collection<? extends OsmPrimitive> data)
throws java.lang.IllegalArgumentException
data - the primitives to delete. Must neither be null nor empty.
java.lang.IllegalArgumentException - thrown if data is null or empty
public DeleteCommand(OsmPrimitive data)
throws java.lang.IllegalArgumentException
data - the primitive to delete. Must not be null.
java.lang.IllegalArgumentException - thrown if data is null
public DeleteCommand(OsmDataLayer layer,
OsmPrimitive data)
throws java.lang.IllegalArgumentException
layer - the layer context for deleting this primitive. Must not be null.data - the primitive to delete. Must not be null.
java.lang.IllegalArgumentException - thrown if data is null
java.lang.IllegalArgumentException - thrown if layer is null
public DeleteCommand(OsmDataLayer layer,
java.util.Collection<? extends OsmPrimitive> data)
throws java.lang.IllegalArgumentException
layer - the layer context for deleting these primitives. Must not be null.data - the primitives to delete. Must neither be null nor empty.
java.lang.IllegalArgumentException - thrown if layer is null
java.lang.IllegalArgumentException - thrown if data is null or empty| Method Detail |
|---|
public boolean executeCommand()
Command
executeCommand in class Commandpublic void undoCommand()
Command
undoCommand 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 Commandmodified - The modified primitivesdeleted - The deleted primitivesadded - The added primitivesprivate java.util.Set<OsmPrimitiveType> getTypesToDelete()
public java.lang.String getDescriptionText()
PseudoCommand
getDescriptionText in class PseudoCommandpublic javax.swing.Icon getDescriptionIcon()
PseudoCommand
getDescriptionIcon in class PseudoCommandpublic java.util.Collection<PseudoCommand> getChildren()
PseudoCommand
getChildren in class PseudoCommandpublic java.util.Collection<? extends OsmPrimitive> getParticipatingPrimitives()
Command
getParticipatingPrimitives in class Command
public static Command deleteWithReferences(OsmDataLayer layer,
java.util.Collection<? extends OsmPrimitive> selection,
boolean silent)
throws java.lang.IllegalArgumentException
layer - the OsmDataLayer in whose context primitives are deleted. Must not be null.selection - The list of all object to be deleted.silent - Set to true if the user should not be bugged with additional dialogs
java.lang.IllegalArgumentException - thrown if layer is null
public static Command deleteWithReferences(OsmDataLayer layer,
java.util.Collection<? extends OsmPrimitive> selection)
public static Command delete(OsmDataLayer layer,
java.util.Collection<? extends OsmPrimitive> selection)
protected static java.util.Collection<Node> computeNodesToDelete(OsmDataLayer layer,
java.util.Collection<OsmPrimitive> primitivesToDelete)
primitivesToDelete which
can be deleted too. A node can be deleted if
OsmPrimitive.isTagged()primitivesToDelete
layer - the layer in whose context primitives are deletedprimitivesToDelete - the primitives to delete
primitivesToDelete which
can be deleted too
public static Command delete(OsmDataLayer layer,
java.util.Collection<? extends OsmPrimitive> selection,
boolean alsoDeleteNodesInWay)
layer - the OsmDataLayer in whose context the primitives are deletedselection - the objects to delete.alsoDeleteNodesInWay - true if nodes should be deleted as well
public static Command delete(OsmDataLayer layer,
java.util.Collection<? extends OsmPrimitive> selection,
boolean alsoDeleteNodesInWay,
boolean silent)
layer - the OsmDataLayer in whose context the primitives are deletedselection - the objects to delete.alsoDeleteNodesInWay - true if nodes should be deleted as wellsilent - set to true if the user should not be bugged with additional questions
public static Command deleteWaySegment(OsmDataLayer layer,
WaySegment ws)
public static boolean checkAndConfirmOutlyingDelete(OsmDataLayer layer,
java.util.Collection<? extends OsmPrimitive> primitives,
java.util.Collection<? extends OsmPrimitive> ignore)
public static boolean checkAndConfirmOutlyingDelete(java.awt.geom.Area area,
java.util.Collection<? extends OsmPrimitive> primitives,
java.util.Collection<? extends OsmPrimitive> ignore)
private static boolean confirmRelationDeletion(java.util.Collection<Relation> relations)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||