public class AddCommand extends Command
ChangeCommand
for comments on relation back references.Command.OldNodeState
Modifier and Type | Field and Description |
---|---|
private OsmPrimitive |
osm
The primitive to add to the dataset.
|
Constructor and Description |
---|
AddCommand(OsmDataLayer layer,
OsmPrimitive osm)
Creates the command and specify the element to add in the context of the given data layer.
|
AddCommand(OsmPrimitive osm)
Creates the command and specify the element to add in the context of the current edit layer, if any.
|
Modifier and Type | Method and Description |
---|---|
protected static void |
checkNodeStyles(OsmPrimitive osm) |
boolean |
equals(Object obj) |
boolean |
executeCommand()
Executes the command on the dataset.
|
void |
fillModifiedData(Collection<OsmPrimitive> modified,
Collection<OsmPrimitive> deleted,
Collection<OsmPrimitive> added)
Fill in the changed data this command operates on.
|
Icon |
getDescriptionIcon()
Provides a descriptive icon of this command.
|
String |
getDescriptionText()
Provides a description text representing this command.
|
Collection<OsmPrimitive> |
getParticipatingPrimitives()
Return the primitives that take part in this command.
|
int |
hashCode() |
void |
undoCommand()
Undoes the command.
|
checkAndConfirmOutlyingOperation, getLayer, getOrig, invalidBecauselayerRemoved
getChildren
private final OsmPrimitive osm
public AddCommand(OsmPrimitive osm)
osm
- The primitive to addpublic AddCommand(OsmDataLayer layer, OsmPrimitive osm)
layer
- The data layer. Must not be null
osm
- The primitive to addprotected static final void checkNodeStyles(OsmPrimitive osm)
public boolean executeCommand()
Command
executeCommand
in class Command
public void undoCommand()
Command
undoCommand
in class Command
public void fillModifiedData(Collection<OsmPrimitive> modified, Collection<OsmPrimitive> deleted, Collection<OsmPrimitive> added)
Command
fillModifiedData
in class Command
modified
- The modified primitivesdeleted
- The deleted primitivesadded
- The added primitivespublic String getDescriptionText()
PseudoCommand
getDescriptionText
in class PseudoCommand
public Icon getDescriptionIcon()
PseudoCommand
getDescriptionIcon
in class PseudoCommand
public Collection<OsmPrimitive> getParticipatingPrimitives()
Command
getParticipatingPrimitives
in class Command