|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.josm.command.PseudoCommand
org.openstreetmap.josm.command.Command
org.openstreetmap.josm.command.TransformNodesCommand
public abstract class TransformNodesCommand
Abstract class with common services for nodes rotation and scaling commands.
Nested Class Summary | |
---|---|
static class |
TransformNodesCommand.OldState
Small helper for holding the interesting part of the old data state of the nodes. |
Field Summary | |
---|---|
protected java.util.Collection<Node> |
nodes
The nodes to transform. |
protected java.util.Map<Node,TransformNodesCommand.OldState> |
oldStates
List of all old states of the nodes. |
Constructor Summary | |
---|---|
TransformNodesCommand(java.util.Collection<OsmPrimitive> objects)
Creates a TransformNodesObject. |
Method Summary | |
---|---|
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. |
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. |
Methods inherited from class org.openstreetmap.josm.command.Command |
---|
checkAndConfirmOutlyingOperation, getLayer, getOrig, invalidBecauselayerRemoved |
Methods inherited from class org.openstreetmap.josm.command.PseudoCommand |
---|
getChildren |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Collection<Node> nodes
protected java.util.Map<Node,TransformNodesCommand.OldState> oldStates
Constructor Detail |
---|
public TransformNodesCommand(java.util.Collection<OsmPrimitive> objects)
Method Detail |
---|
protected 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 class Command
public java.lang.String getDescriptionText()
PseudoCommand
getDescriptionText
in class PseudoCommand
public javax.swing.Icon getDescriptionIcon()
PseudoCommand
getDescriptionIcon
in class PseudoCommand
public java.util.Collection<Node> getTransformedNodes()
public EastNorth getNodesCenter()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |