public abstract class TransformNodesCommand extends Command
Command.OldNodeState
Modifier and Type | Field and Description |
---|---|
protected Collection<Node> |
nodes
The nodes to transform.
|
protected Map<Node,Command.OldNodeState> |
oldStates
List of all old states of the nodes.
|
Constructor and Description |
---|
TransformNodesCommand(Collection<OsmPrimitive> objects)
Creates a TransformNodesObject.
|
Modifier and Type | Method and Description |
---|---|
boolean |
executeCommand()
Finally apply the transformation of the nodes.
|
void |
fillModifiedData(Collection<OsmPrimitive> modified,
Collection<OsmPrimitive> deleted,
Collection<OsmPrimitive> added)
Fill in the changed data this command operates on.
|
void |
flagNodesAsModified()
Flag all nodes as modified.
|
Icon |
getDescriptionIcon()
Provides a descriptive icon of this command.
|
String |
getDescriptionText()
Provides a description text representing this command.
|
EastNorth |
getNodesCenter()
Get the center of the nodes under modification.
|
Collection<? extends OsmPrimitive> |
getParticipatingPrimitives()
Return the primitives that take part in this command.
|
Collection<Node> |
getTransformedNodes()
Get the nodes with the current transformation applied.
|
abstract void |
handleEvent(EastNorth currentEN)
Handling of a mouse event (e.g.
|
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.
|
checkAndConfirmOutlyingOperation, getLayer, getOrig, invalidBecauselayerRemoved
getChildren
protected Collection<Node> nodes
protected Map<Node,Command.OldNodeState> oldStates
public TransformNodesCommand(Collection<OsmPrimitive> objects)
protected 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(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
public String getDescriptionText()
PseudoCommand
getDescriptionText
in class PseudoCommand
public Icon getDescriptionIcon()
PseudoCommand
getDescriptionIcon
in class PseudoCommand
public Collection<Node> getTransformedNodes()
public EastNorth getNodesCenter()
Geometry.getCentroid(java.util.List)