public class AddPrimitivesCommand extends Command
Command.OldNodeState
Modifier and Type | Field and Description |
---|---|
private List<OsmPrimitive> |
createdPrimitives |
private Collection<OsmPrimitive> |
createdPrimitivesToSelect |
private List<PrimitiveData> |
data |
private Collection<PrimitiveData> |
toSelect |
Constructor and Description |
---|
AddPrimitivesCommand(List<PrimitiveData> data)
Constructs a new
AddPrimitivesCommand to add data to the current edit layer. |
AddPrimitivesCommand(List<PrimitiveData> data,
List<PrimitiveData> toSelect)
Constructs a new
AddPrimitivesCommand to add data to the current edit layer. |
AddPrimitivesCommand(List<PrimitiveData> data,
List<PrimitiveData> toSelect,
OsmDataLayer layer)
Constructs a new
AddPrimitivesCommand to add data to the given layer. |
Modifier and Type | Method and Description |
---|---|
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<? extends OsmPrimitive> |
getParticipatingPrimitives()
Return the primitives that take part in this command.
|
int |
hashCode() |
private void |
init(List<PrimitiveData> data,
List<PrimitiveData> toSelect) |
void |
undoCommand()
Undoes the command.
|
checkAndConfirmOutlyingOperation, getLayer, getOrig, invalidBecauselayerRemoved
getChildren
private List<PrimitiveData> data
private Collection<PrimitiveData> toSelect
private List<OsmPrimitive> createdPrimitives
private Collection<OsmPrimitive> createdPrimitivesToSelect
public AddPrimitivesCommand(List<PrimitiveData> data)
AddPrimitivesCommand
to add data to the current edit layer.data
- The OSM primitives data to add. Must not be null
public AddPrimitivesCommand(List<PrimitiveData> data, List<PrimitiveData> toSelect)
AddPrimitivesCommand
to add data to the current edit layer.data
- The OSM primitives to add. Must not be null
toSelect
- The OSM primitives to select at the end. Can be null
public AddPrimitivesCommand(List<PrimitiveData> data, List<PrimitiveData> toSelect, OsmDataLayer layer)
AddPrimitivesCommand
to add data to the given layer.data
- The OSM primitives data to add. Must not be null
toSelect
- The OSM primitives to select at the end. Can be null
layer
- The target data layer. Must not be null
private void init(List<PrimitiveData> data, List<PrimitiveData> toSelect)
public boolean executeCommand()
Command
executeCommand
in class Command
public void undoCommand()
Command
undoCommand
in class Command
public String getDescriptionText()
PseudoCommand
getDescriptionText
in class PseudoCommand
public Icon getDescriptionIcon()
PseudoCommand
getDescriptionIcon
in class PseudoCommand
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 Collection<? extends OsmPrimitive> getParticipatingPrimitives()
Command
getParticipatingPrimitives
in class Command