public abstract class TransformNodesCommand extends Command
Command.OldNodeState
Modifier and Type | Field and Description |
---|---|
protected java.util.Collection<Node> |
nodes
The nodes to transform.
|
protected java.util.Map<Node,Command.OldNodeState> |
oldStates
List of all old states of the nodes.
|
IS_INCOMPLETE, IS_OK, IS_OUTSIDE
Constructor and Description |
---|
TransformNodesCommand(java.util.Collection<? extends OsmPrimitive> objects)
Creates a TransformNodesObject.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
boolean |
executeCommand()
Finally apply the transformation of the nodes.
|
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.
|
void |
flagNodesAsModified()
Flag all nodes as modified.
|
javax.swing.Icon |
getDescriptionIcon()
Provides a descriptive icon of this command.
|
java.lang.String |
getDescriptionText()
Provides a description text representing this command.
|
EastNorth |
getNodesCenter()
Get the center of the nodes under modification.
|
java.util.Collection<? extends OsmPrimitive> |
getParticipatingPrimitives()
Return the primitives that take part in this command.
|
java.util.Collection<Node> |
getTransformedNodes()
Get the nodes with the current transformation applied.
|
abstract void |
handleEvent(EastNorth currentEN)
Handling of a mouse event (e.g.
|
int |
hashCode() |
protected void |
storeOldState()
Stores the state of the nodes before the command.
|
protected abstract void |
transformNodes()
Implementation for the nodes transformation.
|
void |
undoCommand()
Restore the state of the nodes from the backup.
|
checkOutlyingOrIncompleteOperation, ensurePrimitivesAreInDataset, getAffectedDataSet, getOrig
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getChildren
protected final java.util.Map<Node,Command.OldNodeState> oldStates
public TransformNodesCommand(java.util.Collection<? extends OsmPrimitive> objects)
objects
- objects to fetch nodes from. Must neither be null nor empty. Items must belong to a data setjava.lang.NullPointerException
- if objects is null or contain null itemjava.util.NoSuchElementException
- if objects is emptyprotected final void storeOldState()
public abstract void handleEvent(EastNorth currentEN)
currentEN
- the current world position of the mouseprotected abstract void transformNodes()
public boolean executeCommand()
executeCommand
in class Command
public void flagNodesAsModified()
public void undoCommand()
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 Command
modified
- The modified primitivesdeleted
- The deleted primitivesadded
- The added primitivespublic java.util.Collection<? extends OsmPrimitive> getParticipatingPrimitives()
Command
getParticipatingPrimitives
in interface PseudoCommand
getParticipatingPrimitives
in class Command
public java.lang.String getDescriptionText()
PseudoCommand
public javax.swing.Icon getDescriptionIcon()
PseudoCommand
public java.util.Collection<Node> getTransformedNodes()
public EastNorth getNodesCenter()
Geometry.getCentroid(java.util.List)