Changeset 748 in josm for trunk


Ignore:
Timestamp:
2008-08-06T08:49:51+02:00 (16 years ago)
Author:
stoecker
Message:

some cleanups

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java

    r655 r748  
    5454                // Get average position of all nodes
    5555                Node avn = new Node(new LatLon(0,0));
     56                avn.eastNorth = new EastNorth(0,0);
    5657                for (Node n : nodes) {
    5758                        avn.eastNorth = new EastNorth(avn.eastNorth.east()+n.eastNorth.east(), avn.eastNorth.north()+n.eastNorth.north());
    58                         avn.coor = Main.proj.eastNorth2latlon(avn.eastNorth);
    5959                }
    6060                avn.eastNorth = new EastNorth(avn.eastNorth.east()/nodes.size(), avn.eastNorth.north()/nodes.size());
  • trunk/src/org/openstreetmap/josm/command/RotateCommand.java

    r630 r748  
    6363                this.objects = AllNodesVisitor.getAllNodes(objects);
    6464                pivot = new Node(new LatLon(0,0));
    65                        
     65                pivot.eastNorth = new EastNorth(0,0);
     66
    6667                for (Node n : this.objects) {
    6768                        MoveCommand.OldState os = new MoveCommand.OldState();
     
    7172                        oldState.put(n, os);
    7273                        pivot.eastNorth = new EastNorth(pivot.eastNorth.east()+os.eastNorth.east(), pivot.eastNorth.north()+os.eastNorth.north());
    73                         pivot.coor = Main.proj.eastNorth2latlon(pivot.eastNorth);
    7474                }
    7575                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);
    7777
    7878                rotationAngle = Math.PI/2;
     
    8989                startAngle = Math.atan2(start.east()-pivot.eastNorth.east(), start.north()-pivot.eastNorth.north());
    9090                double endAngle = Math.atan2(end.east()-pivot.eastNorth.east(), end.north()-pivot.eastNorth.north());
    91                 rotationAngle += startAngle - endAngle;         
     91                rotationAngle += startAngle - endAngle;
    9292                rotateNodes(false);
    9393        }
    94        
     94
    9595        /**
    9696         * Helper for actually rotationg the nodes.
  • trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java

    r655 r748  
    1313import org.openstreetmap.josm.data.coor.LatLon;
    1414
    15 public class WayPoint extends WithAttributes implements Comparable{
    16        
     15public class WayPoint extends WithAttributes implements Comparable<WayPoint>
     16{
    1717        public final LatLon latlon;
    1818        public final EastNorth eastNorth;
     
    2323
    2424        public WayPoint(LatLon ll) {
    25                 latlon = ll; 
     25                latlon = ll;
    2626                eastNorth = Main.proj.latlon2eastNorth(ll);
    2727        }
     
    4949        }
    5050
    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        }
    5855}
Note: See TracChangeset for help on using the changeset viewer.