|
||||||||||
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.MoveCommand
public class MoveCommand
MoveCommand moves a set of OsmPrimitives along the map. It can be moved again to collect several MoveCommands into one command.
Nested Class Summary | |
---|---|
static class |
MoveCommand.OldState
Small helper for holding the interesting part of the old data state of the objects. |
Field Summary | |
---|---|
private double |
backupX
|
private double |
backupY
|
private java.util.Collection<Node> |
nodes
The objects that should be moved. |
private java.util.List<MoveCommand.OldState> |
oldState
List of all old states of the objects. |
private EastNorth |
startEN
Starting position, base command point, current (mouse-drag) position = startEN + (x,y) = |
private double |
x
x difference movement. |
private double |
y
y difference movement. |
Constructor Summary | |
---|---|
MoveCommand(java.util.Collection<OsmPrimitive> objects,
double x,
double y)
Create a MoveCommand and assign the initial object set and movement vector. |
|
MoveCommand(java.util.Collection<OsmPrimitive> objects,
EastNorth offset)
|
|
MoveCommand(java.util.Collection<OsmPrimitive> objects,
EastNorth start,
EastNorth end)
|
|
MoveCommand(Node node,
LatLon position)
|
|
MoveCommand(OsmPrimitive osm,
double x,
double y)
|
|
MoveCommand(OsmPrimitive p,
EastNorth start,
EastNorth end)
|
Method Summary | |
---|---|
void |
applyVectorTo(EastNorth currentEN)
Change the displacement vector to have endpoint @param currentEN starting point is startEN |
void |
changeStartPoint(EastNorth newDraggedStartPoint)
Changes base point of movement |
boolean |
executeCommand()
Executes the command on the dataset. |
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. |
javax.swing.Icon |
getDescriptionIcon()
Provides a descriptive icon of this command. |
java.lang.String |
getDescriptionText()
Provides a description text representing this command. |
java.util.Collection<Node> |
getParticipatingPrimitives()
Return the primitives that take part in this command. |
void |
moveAgain(double x,
double y)
Move the same set of objects again by the specified vector. |
void |
moveAgainTo(double x,
double y)
|
void |
resetToCheckpoint()
Restore old displacement in case of some problems |
void |
saveCheckpoint()
Save curent displacement to restore in case of some problems |
void |
undoCommand()
Undoes the command. |
private void |
updateCoordinates()
|
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 |
---|
private java.util.Collection<Node> nodes
private EastNorth startEN
private double x
private double y
private double backupX
private double backupY
private java.util.List<MoveCommand.OldState> oldState
Constructor Detail |
---|
public MoveCommand(OsmPrimitive osm, double x, double y)
public MoveCommand(Node node, LatLon position)
public MoveCommand(java.util.Collection<OsmPrimitive> objects, EastNorth offset)
public MoveCommand(java.util.Collection<OsmPrimitive> objects, double x, double y)
public MoveCommand(java.util.Collection<OsmPrimitive> objects, EastNorth start, EastNorth end)
public MoveCommand(OsmPrimitive p, EastNorth start, EastNorth end)
Method Detail |
---|
public void moveAgain(double x, double y)
public void moveAgainTo(double x, double y)
public void applyVectorTo(EastNorth currentEN)
public void changeStartPoint(EastNorth newDraggedStartPoint)
newDraggedStartPoint
- - new starting point after movement (where user clicks to start new drag)public void saveCheckpoint()
public void resetToCheckpoint()
private void updateCoordinates()
public boolean executeCommand()
Command
executeCommand
in class Command
public void undoCommand()
Command
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.lang.String getDescriptionText()
PseudoCommand
getDescriptionText
in class PseudoCommand
public javax.swing.Icon getDescriptionIcon()
PseudoCommand
getDescriptionIcon
in class PseudoCommand
public java.util.Collection<Node> getParticipatingPrimitives()
Command
getParticipatingPrimitives
in class Command
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |