Package org.openstreetmap.josm.command
Class AbstractNodesCommand<C extends Collection<Node>>
- java.lang.Object
-
- org.openstreetmap.josm.command.Command
-
- org.openstreetmap.josm.command.AbstractNodesCommand<C>
-
- Type Parameters:
C
- type of nodes collection used for this command
- All Implemented Interfaces:
PseudoCommand
- Direct Known Subclasses:
ChangeNodesCommand
,RemoveNodesCommand
public abstract class AbstractNodesCommand<C extends Collection<Node>> extends Command
Abstracts superclass ofChangeNodesCommand
/RemoveNodesCommand
.- Since:
- 15013
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.command.Command
Command.OldNodeState
-
-
Field Summary
Fields Modifier and Type Field Description protected C
cmdNodes
protected Way
way
-
Fields inherited from class org.openstreetmap.josm.command.Command
IS_INCOMPLETE, IS_OK, IS_OUTSIDE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractNodesCommand(DataSet ds, Way way, C cmdNodes)
Constructs a newAbstractNodesCommand
.protected
AbstractNodesCommand(Way way, C cmdNodes)
Constructs a newAbstractNodesCommand
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method 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.int
hashCode()
protected abstract void
modifyWay()
-
Methods inherited from class org.openstreetmap.josm.command.Command
checkOutlyingOrIncompleteOperation, ensurePrimitivesAreInDataset, getAffectedDataSet, getOrig, getParticipatingPrimitives, undoCommand
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openstreetmap.josm.command.PseudoCommand
getChildren, getDescriptionText
-
-
-
-
Constructor Detail
-
AbstractNodesCommand
protected AbstractNodesCommand(Way way, C cmdNodes)
Constructs a newAbstractNodesCommand
.- Parameters:
way
- The way to modifycmdNodes
- The collection of nodes for this command
-
AbstractNodesCommand
protected AbstractNodesCommand(DataSet ds, Way way, C cmdNodes)
Constructs a newAbstractNodesCommand
.- Parameters:
ds
- The target data set. Must not benull
way
- The way to modifycmdNodes
- The collection of nodes for this command
-
-
Method Detail
-
modifyWay
protected abstract void modifyWay()
-
executeCommand
public boolean executeCommand()
Description copied from class:Command
Executes the command on the dataset. This implementation will remember all primitives returned by fillModifiedData for restoring them on undo.The layer should be invalidated after execution so that it can be re-painted.
- Overrides:
executeCommand
in classCommand
- Returns:
- true
-
fillModifiedData
public void fillModifiedData(Collection<OsmPrimitive> modified, Collection<OsmPrimitive> deleted, Collection<OsmPrimitive> added)
Description copied from class:Command
Fill in the changed data this command operates on. Add to the lists, don't clear them.- Specified by:
fillModifiedData
in classCommand
- Parameters:
modified
- The modified primitivesdeleted
- The deleted primitivesadded
- The added primitives
-
getDescriptionIcon
public Icon getDescriptionIcon()
Description copied from interface:PseudoCommand
Provides a descriptive icon of this command.- Returns:
- descriptive icon of this command
-
-