Changeset 1722 in josm for trunk/src/org/openstreetmap/josm/command
- Timestamp:
- 2009-07-03T12:33:32+02:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/command
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/MoveCommand.java
r1640 r1722 48 48 public static class OldState { 49 49 LatLon latlon; 50 EastNorth eastNorth;51 50 boolean modified; 52 51 } … … 70 69 for (Node n : this.objects) { 71 70 OldState os = new OldState(); 72 os.eastNorth = n.getEastNorth();73 71 os.latlon = n.getCoor(); 74 72 os.modified = n.modified; … … 105 103 for (Node n : objects) { 106 104 OldState os = it.next(); 107 n.set EastNorth(os.eastNorth);105 n.setCoor(os.latlon); 108 106 n.modified = os.modified; 109 107 } -
trunk/src/org/openstreetmap/josm/command/RotateCommand.java
r1640 r1722 14 14 15 15 import org.openstreetmap.josm.data.coor.EastNorth; 16 import org.openstreetmap.josm.data.coor.LatLon; 16 17 import org.openstreetmap.josm.data.osm.Node; 17 18 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 37 38 38 39 /** 40 * Small helper for holding the interesting part of the old data state of the 41 * objects. 42 */ 43 public static class OldState { 44 LatLon latlon; 45 EastNorth eastNorth; 46 boolean modified; 47 } 48 49 /** 39 50 * angle of rotation starting click to pivot 40 51 */ … … 49 60 * List of all old states of the objects. 50 61 */ 51 private Map<Node, MoveCommand.OldState> oldState = new HashMap<Node, MoveCommand.OldState>();62 private Map<Node, OldState> oldState = new HashMap<Node, OldState>(); 52 63 53 64 /** … … 63 74 64 75 for (Node n : this.objects) { 65 MoveCommand.OldState os = new MoveCommand.OldState(); 76 OldState os = new OldState(); 77 os.latlon = n.getCoor(); 66 78 os.eastNorth = n.getEastNorth(); 67 os.latlon = n.getCoor();68 79 os.modified = n.modified; 69 80 oldState.put(n, os); … … 102 113 double nx = sinPhi * x + cosPhi * y + pivot.east(); 103 114 double ny = -cosPhi * x + sinPhi * y + pivot.north(); 104 n.setEastNorth(n x, ny);115 n.setEastNorth(new EastNorth(nx, ny)); 105 116 if (setModified) 106 117 n.modified = true; … … 115 126 @Override public void undoCommand() { 116 127 for (Node n : objects) { 117 MoveCommand.OldState os = oldState.get(n);118 n.set EastNorth(os.eastNorth);128 OldState os = oldState.get(n); 129 n.setCoor(os.latlon); 119 130 n.modified = os.modified; 120 131 }
Note: See TracChangeset
for help on using the changeset viewer.