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.
|
checkAndConfirmOutlyingOperation, checkOutlyingOrIncompleteOperation, getAffectedDataSet, getLayer, getOrig, invalidateAffectedLayers, invalidBecauselayerRemoved
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getChildren
protected java.util.Map<Node,Command.OldNodeState> oldStates
public TransformNodesCommand(java.util.Collection<? extends OsmPrimitive> objects)
objects
- objects to fetch nodes fromprotected 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
Command.invalidateAffectedLayers()
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)