- Timestamp:
- 2008-08-06T08:49:51+02:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java
r655 r748 54 54 // Get average position of all nodes 55 55 Node avn = new Node(new LatLon(0,0)); 56 avn.eastNorth = new EastNorth(0,0); 56 57 for (Node n : nodes) { 57 58 avn.eastNorth = new EastNorth(avn.eastNorth.east()+n.eastNorth.east(), avn.eastNorth.north()+n.eastNorth.north()); 58 avn.coor = Main.proj.eastNorth2latlon(avn.eastNorth);59 59 } 60 60 avn.eastNorth = new EastNorth(avn.eastNorth.east()/nodes.size(), avn.eastNorth.north()/nodes.size()); -
trunk/src/org/openstreetmap/josm/command/RotateCommand.java
r630 r748 63 63 this.objects = AllNodesVisitor.getAllNodes(objects); 64 64 pivot = new Node(new LatLon(0,0)); 65 65 pivot.eastNorth = new EastNorth(0,0); 66 66 67 for (Node n : this.objects) { 67 68 MoveCommand.OldState os = new MoveCommand.OldState(); … … 71 72 oldState.put(n, os); 72 73 pivot.eastNorth = new EastNorth(pivot.eastNorth.east()+os.eastNorth.east(), pivot.eastNorth.north()+os.eastNorth.north()); 73 pivot.coor = Main.proj.eastNorth2latlon(pivot.eastNorth);74 74 } 75 75 pivot.eastNorth = new EastNorth(pivot.eastNorth.east()/this.objects.size(), pivot.eastNorth.north()/this.objects.size()); 76 pivot.coor = Main.proj.eastNorth2latlon(pivot.eastNorth); 76 pivot.coor = Main.proj.eastNorth2latlon(pivot.eastNorth); 77 77 78 78 rotationAngle = Math.PI/2; … … 89 89 startAngle = Math.atan2(start.east()-pivot.eastNorth.east(), start.north()-pivot.eastNorth.north()); 90 90 double endAngle = Math.atan2(end.east()-pivot.eastNorth.east(), end.north()-pivot.eastNorth.north()); 91 rotationAngle += startAngle - endAngle; 91 rotationAngle += startAngle - endAngle; 92 92 rotateNodes(false); 93 93 } 94 94 95 95 /** 96 96 * Helper for actually rotationg the nodes. -
trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java
r655 r748 13 13 import org.openstreetmap.josm.data.coor.LatLon; 14 14 15 public class WayPoint extends WithAttributes implements Comparable {16 15 public class WayPoint extends WithAttributes implements Comparable<WayPoint> 16 { 17 17 public final LatLon latlon; 18 18 public final EastNorth eastNorth; … … 23 23 24 24 public WayPoint(LatLon ll) { 25 latlon = ll; 25 latlon = ll; 26 26 eastNorth = Main.proj.latlon2eastNorth(ll); 27 27 } … … 49 49 } 50 50 51 public int compareTo(Object other){ 52 if(other instanceof WayPoint){ 53 WayPoint w = (WayPoint)other; 54 return (int)time - (int)w.time; 55 } 56 return 0; 57 } 51 public int compareTo(WayPoint w) 52 { 53 return Double.compare(time, w.time); 54 } 58 55 }
Note:
See TracChangeset
for help on using the changeset viewer.