Changeset 1640 in josm


Ignore:
Timestamp:
Jun 6, 2009 2:30:21 PM (4 years ago)
Author:
stoecker
Message:

little bit more refactoring of coordinate access - patch by jttt

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

Legend:

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

    r1636 r1640  
    8989 
    9090        Node n = new Node(Main.proj.eastNorth2latlon(result)); 
    91         if (n.coor.isOutSideWorld()) { 
     91        if (n.getCoor().isOutSideWorld()) { 
    9292            JOptionPane.showMessageDialog(Main.parent, tr("Some of the nodes are (almost) in the line")); 
    9393            return null; 
     
    163163                } else { 
    164164 
    165                     center = ((Node) nodes.toArray()[way.nodes.contains(nodes.toArray()[0]) ? 1 : 0]).eastNorth; 
     165                    center = ((Node) nodes.toArray()[way.nodes.contains(nodes.toArray()[0]) ? 1 : 0]).getEastNorth(); 
    166166                    if (nodes.size() == 2) 
    167                         radius = distance(((Node) nodes.toArray()[0]).eastNorth, ((Node) nodes.toArray()[1]).eastNorth); 
     167                        radius = distance(((Node) nodes.toArray()[0]).getEastNorth(), ((Node) nodes.toArray()[1]).getEastNorth()); 
    168168                } 
    169169                nodes = new LinkedList<Node>(); 
     
    191191                n1 = n0; 
    192192                n0 = n; 
    193                 EastNorth cc = circumcenter(n0.eastNorth, n1.eastNorth, n2.eastNorth); 
     193                EastNorth cc = circumcenter(n0.getEastNorth(), n1.getEastNorth(), n2.getEastNorth()); 
    194194                if (cc == null) 
    195195                    return; 
     
    209209        if (radius == 0) { 
    210210            for (Node n : nodes) { 
    211                 radius += distance(center, n.eastNorth); 
     211                radius += distance(center, n.getEastNorth()); 
    212212            } 
    213213            radius = radius / nodes.size(); 
     
    220220        if (regular) { // Make a regular polygon 
    221221            double angle = Math.PI * 2 / nodes.size(); 
    222             pc = new PolarCoor(((Node) nodes.toArray()[0]).eastNorth, center, 0); 
    223  
    224             if (pc.angle > (new PolarCoor(((Node) nodes.toArray()[1]).eastNorth, center, 0).angle)) 
     222            pc = new PolarCoor(((Node) nodes.toArray()[0]).getEastNorth(), center, 0); 
     223 
     224            if (pc.angle > (new PolarCoor(((Node) nodes.toArray()[1]).getEastNorth(), center, 0).angle)) 
    225225                angle *= -1; 
    226226 
     
    228228            for (Node n : nodes) { 
    229229                EastNorth no = pc.toEastNorth(); 
    230                 cmds.add(new MoveCommand(n, no.east() - n.eastNorth.east(), no.north() - n.eastNorth.north())); 
     230                cmds.add(new MoveCommand(n, no.east() - n.getEastNorth().east(), no.north() - n.getEastNorth().north())); 
    231231                pc.angle += angle; 
    232232            } 
    233233        } else { // Move each node to that distance from the centre. 
    234234            for (Node n : nodes) { 
    235                 pc = new PolarCoor(n.eastNorth, center, 0); 
     235                pc = new PolarCoor(n.getEastNorth(), center, 0); 
    236236                pc.radius = radius; 
    237237                EastNorth no = pc.toEastNorth(); 
    238                 cmds.add(new MoveCommand(n, no.east() - n.eastNorth.east(), no.north() - n.eastNorth.north())); 
     238                cmds.add(new MoveCommand(n, no.east() - n.getEastNorth().east(), no.north() - n.getEastNorth().north())); 
    239239            } 
    240240        } 
  • trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java

    r1212 r1640  
    7171            itnodes.remove(n); 
    7272            for (Node m : itnodes) { 
    73                 double dist = Math.sqrt(n.eastNorth.distance(m.eastNorth)); 
     73                double dist = Math.sqrt(n.getEastNorth().distance(m.getEastNorth())); 
    7474                if (dist > distance) { 
    7575                    nodea = n; 
     
    8585 
    8686        // Find out co-ords of A and B 
    87         double ax = nodea.eastNorth.east(); 
    88         double ay = nodea.eastNorth.north(); 
    89         double bx = nodeb.eastNorth.east(); 
    90         double by = nodeb.eastNorth.north(); 
     87        double ax = nodea.getEastNorth().east(); 
     88        double ay = nodea.getEastNorth().north(); 
     89        double bx = nodeb.getEastNorth().east(); 
     90        double by = nodeb.getEastNorth().north(); 
    9191 
    9292        // A list of commands to do 
     
    9696        for (Node n : nodes) { 
    9797            // Get existing co-ords of node to move 
    98             double nx = n.eastNorth.east(); 
    99             double ny = n.eastNorth.north(); 
     98            double nx = n.getEastNorth().east(); 
     99            double ny = n.getEastNorth().north(); 
    100100 
    101101            if (ax == bx) { 
     
    110110                double c1 = ay - (ax * m1); 
    111111                double m2 = (-1) / m1; 
    112                 double c2 = n.eastNorth.north() - (n.eastNorth.east() * m2); 
     112                double c2 = n.getEastNorth().north() - (n.getEastNorth().east() * m2); 
    113113 
    114114                nx = (c2 - c1) / (m1 - m2); 
     
    117117 
    118118            // Add the command to move the node to its new position. 
    119             cmds.add(new MoveCommand(n, nx - n.eastNorth.east(), ny - n.eastNorth.north() )); 
     119            cmds.add(new MoveCommand(n, nx - n.getEastNorth().east(), ny - n.getEastNorth().north() )); 
    120120        } 
    121121 
  • trunk/src/org/openstreetmap/josm/actions/CreateCircleAction.java

    r1245 r1640  
    105105        // let's get some shorter names 
    106106        Node   n1 = ((Node)nodes.toArray()[0]); 
    107         double x1 = n1.eastNorth.east(); 
    108         double y1 = n1.eastNorth.north(); 
     107        double x1 = n1.getEastNorth().east(); 
     108        double y1 = n1.getEastNorth().north(); 
    109109        Node   n2 = ((Node)nodes.toArray()[1]); 
    110         double x2 = n2.eastNorth.east(); 
    111         double y2 = n2.eastNorth.north(); 
     110        double x2 = n2.getEastNorth().east(); 
     111        double y2 = n2.getEastNorth().north(); 
    112112        Node   n3 = ((Node)nodes.toArray()[2]); 
    113         double x3 = n3.eastNorth.east(); 
    114         double y3 = n3.eastNorth.north(); 
     113        double x3 = n3.getEastNorth().east(); 
     114        double y3 = n3.getEastNorth().north(); 
    115115 
    116116        // calculate the center (xc/yc) 
  • trunk/src/org/openstreetmap/josm/actions/DistributeAction.java

    r1380 r1640  
    7070            itnodes.remove(n); 
    7171            for (Node m : itnodes) { 
    72                 double dist = Math.sqrt(n.eastNorth.distance(m.eastNorth)); 
     72                double dist = Math.sqrt(n.getEastNorth().distance(m.getEastNorth())); 
    7373                if (dist > distance) { 
    7474                    nodea = n; 
     
    8484 
    8585        // Find out co-ords of A and B 
    86         double ax = nodea.eastNorth.east(); 
    87         double ay = nodea.eastNorth.north(); 
    88         double bx = nodeb.eastNorth.east(); 
    89         double by = nodeb.eastNorth.north(); 
     86        double ax = nodea.getEastNorth().east(); 
     87        double ay = nodea.getEastNorth().north(); 
     88        double bx = nodeb.getEastNorth().east(); 
     89        double by = nodeb.getEastNorth().north(); 
    9090 
    9191        // A list of commands to do 
     
    104104            distance = 0.0; 
    105105            for (Node n : nodes) { 
    106                 double dist = Math.sqrt(nodeb.eastNorth.distance(n.eastNorth)); 
     106                double dist = Math.sqrt(nodeb.getEastNorth().distance(n.getEastNorth())); 
    107107                if (dist > distance) { 
    108108                    s = n; 
     
    112112 
    113113            // First move the node to A's position, then move it towards B 
    114             double dx = ax - s.eastNorth.east() + (bx-ax)*pos/num; 
    115             double dy = ay - s.eastNorth.north() + (by-ay)*pos/num; 
     114            double dx = ax - s.getEastNorth().east() + (bx-ax)*pos/num; 
     115            double dy = ay - s.getEastNorth().north() + (by-ay)*pos/num; 
    116116 
    117117            cmds.add(new MoveCommand(s, dx, dy)); 
  • trunk/src/org/openstreetmap/josm/actions/JoinNodeWayAction.java

    r1218 r1640  
    3737 
    3838        List<WaySegment> wss = Main.map.mapView.getNearestWaySegments( 
    39             Main.map.mapView.getPoint(node.eastNorth)); 
     39            Main.map.mapView.getPoint(node.getEastNorth())); 
    4040        HashMap<Way, List<Integer>> insertPoints = new HashMap<Way, List<Integer>>(); 
    4141        for (WaySegment ws : wss) { 
  • trunk/src/org/openstreetmap/josm/actions/MoveAction.java

    r1169 r1640  
    9999 
    100100        for (Node n : affectedNodes) { 
    101             if (n.coor.isOutSideWorld()) { 
     101            if (n.getCoor().isOutSideWorld()) { 
    102102                // Revert move 
    103103                ((MoveCommand) c).moveAgain(-distx, -disty); 
  • trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java

    r1415 r1640  
    8181                int i2 = (i1+1) % (way.nodes.size()-1); 
    8282                int i3 = (i1+2) % (way.nodes.size()-1); 
    83                 double angle1  =Math.abs(way.nodes.get(i1).eastNorth.heading(way.nodes.get(i2).eastNorth)); 
    84                 double angle2 = Math.abs(way.nodes.get(i2).eastNorth.heading(way.nodes.get(i3).eastNorth)); 
     83                double angle1  =Math.abs(way.nodes.get(i1).getEastNorth().heading(way.nodes.get(i2).getEastNorth())); 
     84                double angle2 = Math.abs(way.nodes.get(i2).getEastNorth().heading(way.nodes.get(i3).getEastNorth())); 
    8585                double delta = Math.abs(angle2 - angle1); 
    8686                while(delta > Math.PI) delta -= Math.PI; 
     
    117117            // When selection contains two nodes, use the nodes to compute a direction 
    118118            // to align all ways to 
    119             align_to_heading = normalize_angle(dirnodes.get(0).eastNorth.heading(dirnodes.get(1).eastNorth)); 
     119            align_to_heading = normalize_angle(dirnodes.get(0).getEastNorth().heading(dirnodes.get(1).getEastNorth())); 
    120120            use_dirnodes = true; 
    121121        } 
     
    131131            EastNorth en[] = new EastNorth[sides]; 
    132132            for (int i=0; i < sides; i++) { 
    133                 en[i] = new EastNorth(way.nodes.get(i).eastNorth.east(), way.nodes.get(i).eastNorth.north()); 
     133                en[i] = new EastNorth(way.nodes.get(i).getEastNorth().east(), way.nodes.get(i).getEastNorth().north()); 
    134134            } 
    135135 
     
    142142                double weights[] = new double[sides]; 
    143143                for (int i=0; i < sides; i++) { 
    144                     headings[i] = normalize_angle(way.nodes.get(i).eastNorth.heading(way.nodes.get(i+1).eastNorth)); 
    145                     weights[i] = way.nodes.get(i).eastNorth.distance(way.nodes.get(i+1).eastNorth); 
     144                    headings[i] = normalize_angle(way.nodes.get(i).getEastNorth().heading(way.nodes.get(i+1).getEastNorth())); 
     145                    weights[i] = way.nodes.get(i).getEastNorth().distance(way.nodes.get(i+1).getEastNorth()); 
    146146                } 
    147147 
     
    232232 
    233233                LatLon ill = Main.proj.eastNorth2latlon(intersection); 
    234                 if (!ill.equalsEpsilon(n.coor)) { 
    235                     double dx = intersection.east()-n.eastNorth.east(); 
    236                     double dy = intersection.north()-n.eastNorth.north(); 
     234                if (!ill.equalsEpsilon(n.getCoor())) { 
     235                    double dx = intersection.east()-n.getEastNorth().east(); 
     236                    double dy = intersection.north()-n.getEastNorth().north(); 
    237237                    cmds.add(new MoveCommand(n, dx, dy)); 
    238238                } 
  • trunk/src/org/openstreetmap/josm/actions/PasteAction.java

    r1636 r1640  
    4343        double maxEast = -1E100, minEast = 1E100, maxNorth = -1E100, minNorth = 1E100; 
    4444        for (Node n : pasteBuffer.nodes) { 
    45             double east = n.eastNorth.east(); 
    46             double north = n.eastNorth.north(); 
     45            double east = n.getEastNorth().east(); 
     46            double north = n.getEastNorth().north(); 
    4747            if (east > maxEast) { maxEast = east; } 
    4848            if (east < minEast) { minEast = east; } 
     
    7070            nnew.id = 0; 
    7171            if (Main.main.editLayer() == source) { 
    72                 nnew.setEastNorth(nnew.eastNorth.add(offsetEast, offsetNorth)); 
     72                nnew.setEastNorth(nnew.getEastNorth().add(offsetEast, offsetNorth)); 
    7373            } 
    7474            map.put(n, nnew); 
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r1636 r1640  
    332332            // no node found in clicked area 
    333333            n = new Node(Main.map.mapView.getLatLon(e.getX(), e.getY())); 
    334             if (n.coor.isOutSideWorld()) { 
     334            if (n.getCoor().isOutSideWorld()) { 
    335335                JOptionPane.showMessageDialog(Main.parent, 
    336336                    tr("Cannot add a node outside of the world.")); 
     
    647647            // user clicked on node 
    648648            if (selection.isEmpty()) return; 
    649             currentMouseEastNorth = currentMouseNode.eastNorth; 
     649            currentMouseEastNorth = currentMouseNode.getEastNorth(); 
    650650            mouseOnExistingNode = currentMouseNode; 
    651651        } else { 
     
    690690        // find out the distance, in metres, between the base point and the mouse cursor 
    691691        LatLon mouseLatLon = Main.proj.eastNorth2latlon(currentMouseEastNorth); 
    692         distance = currentBaseNode.coor.greatCircleDistance(mouseLatLon); 
    693         double hdg = Math.toDegrees(currentBaseNode.coor.heading(mouseLatLon)); 
     692        distance = currentBaseNode.getCoor().greatCircleDistance(mouseLatLon); 
     693        double hdg = Math.toDegrees(currentBaseNode.getCoor().heading(mouseLatLon)); 
    694694        if (previousNode != null) { 
    695             angle = hdg - Math.toDegrees(previousNode.coor.heading(currentBaseNode.coor)); 
     695            angle = hdg - Math.toDegrees(previousNode.getCoor().heading(currentBaseNode.getCoor())); 
    696696            if (angle < 0) angle += 360; 
    697697        } 
     
    772772            Iterator<Pair<Node,Node>> i = segs.iterator(); 
    773773            Pair<Node,Node> seg = i.next(); 
    774             EastNorth A = seg.a.eastNorth; 
    775             EastNorth B = seg.b.eastNorth; 
     774            EastNorth A = seg.a.getEastNorth(); 
     775            EastNorth B = seg.b.getEastNorth(); 
    776776            seg = i.next(); 
    777             EastNorth C = seg.a.eastNorth; 
    778             EastNorth D = seg.b.eastNorth; 
     777            EastNorth C = seg.a.getEastNorth(); 
     778            EastNorth D = seg.b.getEastNorth(); 
    779779 
    780780            double u=det(B.east() - A.east(), B.north() - A.north(), C.east() - D.east(), C.north() - D.north()); 
     
    800800            // fall through to default action. 
    801801            // (for semi-parallel lines, intersection might be miles away!) 
    802             if (Main.map.mapView.getPoint(n.eastNorth).distance(Main.map.mapView.getPoint(intersection)) < snapToIntersectionThreshold) { 
     802            if (Main.map.mapView.getPoint(n.getEastNorth()).distance(Main.map.mapView.getPoint(intersection)) < snapToIntersectionThreshold) { 
    803803                n.setEastNorth(intersection); 
    804804                return; 
     
    806806 
    807807        default: 
    808             EastNorth P = n.eastNorth; 
     808            EastNorth P = n.getEastNorth(); 
    809809            seg = segs.iterator().next(); 
    810             A = seg.a.eastNorth; 
    811             B = seg.b.eastNorth; 
     810            A = seg.a.getEastNorth(); 
     811            B = seg.b.getEastNorth(); 
    812812            double a = P.distanceSq(B); 
    813813            double b = P.distanceSq(A); 
     
    840840        g2.setStroke(new BasicStroke(3, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)); 
    841841        GeneralPath b = new GeneralPath(); 
    842         Point p1=mv.getPoint(currentBaseNode.eastNorth); 
     842        Point p1=mv.getPoint(currentBaseNode.getEastNorth()); 
    843843        Point p2=mv.getPoint(currentMouseEastNorth); 
    844844 
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java

    r1422 r1640  
    155155            Node n2 = selectedSegment.way.nodes.get(selectedSegment.lowerIndex + 1); 
    156156 
    157             EastNorth en1 = n1.eastNorth; 
    158             EastNorth en2 = n2.eastNorth; 
     157            EastNorth en1 = n1.getEastNorth(); 
     158            EastNorth en2 = n2.getEastNorth(); 
    159159            EastNorth en3 = mv.getEastNorth(mousePos.x, mousePos.y); 
    160160 
     
    234234            Node n1 = selectedSegment.way.nodes.get(selectedSegment.lowerIndex); 
    235235            Node n2 = selectedSegment.way.nodes.get(selectedSegment.lowerIndex+1); 
    236             EastNorth en3 = n2.eastNorth.add(xoff, yoff); 
     236            EastNorth en3 = n2.getEastNorth().add(xoff, yoff); 
    237237            Node n3 = new Node(Main.proj.eastNorth2latlon(en3)); 
    238             EastNorth en4 = n1.eastNorth.add(xoff, yoff); 
     238            EastNorth en4 = n1.getEastNorth().add(xoff, yoff); 
    239239            Node n4 = new Node(Main.proj.eastNorth2latlon(en4)); 
    240240            Way wnew = new Way(selectedSegment.way); 
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r1634 r1640  
    224224 
    225225                for (Node n : affectedNodes) { 
    226                     if (n.coor.isOutSideWorld()) { 
     226                    if (n.getCoor().isOutSideWorld()) { 
    227227                        // Revert move 
    228228                        ((MoveCommand) c).moveAgain(-dx, -dy); 
     
    280280                { 
    281281                    Way w = (Way)osm; 
    282                     Point p1 = c.getPoint(w.nodes.get(nearestWS.lowerIndex).eastNorth); 
    283                     Point p2 = c.getPoint(w.nodes.get(nearestWS.lowerIndex+1).eastNorth); 
     282                    Point p1 = c.getPoint(w.nodes.get(nearestWS.lowerIndex).getEastNorth()); 
     283                    Point p2 = c.getPoint(w.nodes.get(nearestWS.lowerIndex+1).getEastNorth()); 
    284284                    if(SimplePaintVisitor.isLargeSegment(p1, p2, Main.pref.getInteger("mappaint.node.virtual-space", 70))) 
    285285                    { 
  • trunk/src/org/openstreetmap/josm/command/DeleteCommand.java

    r1499 r1640  
    340340                if (osm instanceof Node && osm.id != 0) { 
    341341                    Node n = (Node) osm; 
    342                     if (!a.contains(n.coor)) { 
     342                    if (!a.contains(n.getCoor())) { 
    343343                        JPanel msg = new JPanel(new GridBagLayout()); 
    344344                        msg.add(new JLabel( 
  • trunk/src/org/openstreetmap/josm/command/MoveCommand.java

    r1636 r1640  
    7070        for (Node n : this.objects) { 
    7171            OldState os = new OldState(); 
    72             os.eastNorth = n.eastNorth; 
    73             os.latlon = n.coor; 
     72            os.eastNorth = n.getEastNorth(); 
     73            os.latlon = n.getCoor(); 
    7474            os.modified = n.modified; 
    7575            oldState.add(os); 
     
    8787    public void moveAgain(double x, double y) { 
    8888        for (Node n : objects) { 
    89             n.setEastNorth(n.eastNorth.add(x, y)); 
     89            n.setEastNorth(n.getEastNorth().add(x, y)); 
    9090        } 
    9191        this.x += x; 
     
    9595    @Override public boolean executeCommand() { 
    9696        for (Node n : objects) { 
    97             n.setEastNorth(n.eastNorth.add(x, y)); 
     97            n.setEastNorth(n.getEastNorth().add(x, y)); 
    9898            n.modified = true; 
    9999        } 
  • trunk/src/org/openstreetmap/josm/command/RotateCommand.java

    r1636 r1640  
    6464        for (Node n : this.objects) { 
    6565            MoveCommand.OldState os = new MoveCommand.OldState(); 
    66             os.eastNorth = n.eastNorth; 
    67             os.latlon = n.coor; 
     66            os.eastNorth = n.getEastNorth(); 
     67            os.latlon = n.getCoor(); 
    6868            os.modified = n.modified; 
    6969            oldState.put(n, os); 
  • trunk/src/org/openstreetmap/josm/data/conflict/PositionConflict.java

    r1636 r1640  
    1010 
    1111    @Override public boolean hasConflict(OsmPrimitive key, OsmPrimitive value) { 
    12         return key instanceof Node && !((Node)key).coor.equals(((Node)value).coor); 
     12        return key instanceof Node && !((Node)key).getCoor().equals(((Node)value).getCoor()); 
    1313    } 
    1414 
    1515    @Override protected String str(OsmPrimitive osm) { 
    16         return osm instanceof Node ? ((Node)osm).coor.lat()+", "+((Node)osm).coor.lon() : null; 
     16        return osm instanceof Node ? ((Node)osm).getCoor().lat()+", "+((Node)osm).getCoor().lon() : null; 
    1717    } 
    1818 
     
    2323    @Override public void apply(OsmPrimitive target, OsmPrimitive other) { 
    2424        if (target instanceof Node) { 
    25             ((Node)target).setEastNorth(((Node)other).eastNorth); 
     25            ((Node)target).setEastNorth(((Node)other).getEastNorth()); 
    2626            int newversion = Math.max(target.version, other.version); 
    2727            // set version on "other" as well in case user decides to keep local 
  • trunk/src/org/openstreetmap/josm/data/osm/Node.java

    r1636 r1640  
    2020    public LatLon coor; 
    2121    public volatile EastNorth eastNorth; 
    22          
    23     public void setCoor(LatLon coor) { 
     22 
     23    public final void setCoor(LatLon coor) { 
    2424        this.coor = coor; 
    25         this.eastNorth = Main.proj.latlon2eastNorth(coor);  
     25        this.eastNorth = Main.proj.latlon2eastNorth(coor); 
    2626    } 
    27          
    28     public void setEastNorth(EastNorth eastNorth) { 
     27 
     28    public final LatLon getCoor() { 
     29        return coor; 
     30    } 
     31 
     32    public final void setEastNorth(EastNorth eastNorth) { 
    2933       this.eastNorth = eastNorth; 
    3034       this.coor = Main.proj.eastNorth2latlon(eastNorth); 
    3135    } 
    32      
    33     public void setEastNorth(double east, double north) { 
     36 
     37    public final void setEastNorth(double east, double north) { 
    3438        this.setEastNorth(new EastNorth(east, north)); 
    3539    } 
    36      
     40 
     41    public final EastNorth getEastNorth() { 
     42        return eastNorth; 
     43    } 
     44 
    3745    private static CoordinateFormat mCord; 
    3846 
     
    107115        return name; 
    108116    } 
     117 
    109118} 
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/BoundingXYVisitor.java

    r1523 r1640  
    2222 
    2323    public void visit(Node n) { 
    24         visit(n.eastNorth); 
     24        visit(n.getEastNorth()); 
    2525    } 
    2626 
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java

    r1635 r1640  
    134134    public void visit(Node n) { 
    135135        /* check, if the node is visible at all */ 
    136         if((n.eastNorth.east()  > maxEN.east() ) || 
    137            (n.eastNorth.north() > maxEN.north()) || 
    138            (n.eastNorth.east()  < minEN.east() ) || 
    139            (n.eastNorth.north() < minEN.north())) 
     136        if((n.getEastNorth().east()  > maxEN.east() ) || 
     137           (n.getEastNorth().north() > maxEN.north()) || 
     138           (n.getEastNorth().east()  < minEN.east() ) || 
     139           (n.getEastNorth().north() < minEN.north())) 
    140140        { 
    141141            n.mappaintVisibleCode = viewid; 
     
    180180        for (Node n : w.nodes) 
    181181        { 
    182             if(n.eastNorth.east() > maxx) maxx = n.eastNorth.east(); 
    183             if(n.eastNorth.north() > maxy) maxy = n.eastNorth.north(); 
    184             if(n.eastNorth.east() < minx) minx = n.eastNorth.east(); 
    185             if(n.eastNorth.north() < miny) miny = n.eastNorth.north(); 
     182            if(n.getEastNorth().east() > maxx) maxx = n.getEastNorth().east(); 
     183            if(n.getEastNorth().north() > maxy) maxy = n.getEastNorth().north(); 
     184            if(n.getEastNorth().east() < minx) minx = n.getEastNorth().east(); 
     185            if(n.getEastNorth().north() < miny) miny = n.getEastNorth().north(); 
    186186        } 
    187187 
     
    650650        } 
    651651 
    652         Point pFrom = nc.getPoint(fromNode.eastNorth); 
    653         Point pVia = nc.getPoint(viaNode.eastNorth); 
     652        Point pFrom = nc.getPoint(fromNode.getEastNorth()); 
     653        Point pVia = nc.getPoint(viaNode.getEastNorth()); 
    654654 
    655655        //if(restrictionDebug) { 
     
    887887                        for (Node n : w.nodes) 
    888888                        { 
    889                             p = nc.getPoint(n.eastNorth); 
     889                            p = nc.getPoint(n.getEastNorth()); 
    890890                            poly.addPoint(p.x,p.y); 
    891891                        } 
     
    941941                    for (Node n : wInner.nodes) 
    942942                    { 
    943                         Point pInner = nc.getPoint(n.eastNorth); 
     943                        Point pInner = nc.getPoint(n.getEastNorth()); 
    944944                        polygon.addPoint(pInner.x,pInner.y); 
    945945                    } 
    946946                    if(!wInner.isClosed()) 
    947947                    { 
    948                         Point pInner = nc.getPoint(wInner.nodes.get(0).eastNorth); 
     948                        Point pInner = nc.getPoint(wInner.nodes.get(0).getEastNorth()); 
    949949                        polygon.addPoint(pInner.x,pInner.y); 
    950950                    } 
     
    10651065        for (Node n : w.nodes) 
    10661066        { 
    1067             Point p = nc.getPoint(n.eastNorth); 
     1067            Point p = nc.getPoint(n.getEastNorth()); 
    10681068            polygon.addPoint(p.x,p.y); 
    10691069        } 
     
    10881088 
    10891089    protected void drawNode(Node n, ImageIcon icon, boolean annotate, Boolean selected) { 
    1090         Point p = nc.getPoint(n.eastNorth); 
     1090        Point p = nc.getPoint(n.getEastNorth()); 
    10911091        if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth()) || (p.y > nc.getHeight())) return; 
    10921092 
     
    11301130            displaySegments(col, width, dashed, dashedColor); 
    11311131        } 
    1132         Point p1 = nc.getPoint(n1.eastNorth); 
    1133         Point p2 = nc.getPoint(n2.eastNorth); 
     1132        Point p1 = nc.getPoint(n1.getEastNorth()); 
     1133        Point p2 = nc.getPoint(n2.getEastNorth()); 
    11341134 
    11351135        if (!isSegmentVisible(p1, p2)) { 
     
    12091209    public void drawNode(Node n, Color color, int size, int radius, boolean fill) { 
    12101210        if (isZoomOk(null) && size > 1) { 
    1211             Point p = nc.getPoint(n.eastNorth); 
     1211            Point p = nc.getPoint(n.getEastNorth()); 
    12121212            if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth()) 
    12131213                    || (p.y > nc.getHeight())) 
     
    14561456     */ 
    14571457    protected void drawOrderNumber(Node n1, Node n2, int orderNumber) { 
    1458         Point p1 = nc.getPoint(n1.eastNorth); 
    1459         Point p2 = nc.getPoint(n2.eastNorth); 
     1458        Point p1 = nc.getPoint(n1.getEastNorth()); 
     1459        Point p2 = nc.getPoint(n2.getEastNorth()); 
    14601460        drawOrderNumber(p1, p2, orderNumber); 
    14611461    } 
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/MergeVisitor.java

    r1567 r1640  
    163163 
    164164    private static boolean realMatch(Node n1, Node n2) { 
    165         return n1.coor.equalsEpsilon(n2.coor); 
     165        return n1.getCoor().equalsEpsilon(n2.getCoor()); 
    166166    } 
    167167 
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java

    r1523 r1640  
    271271        Iterator<Node> it = w.nodes.iterator(); 
    272272        if (it.hasNext()) { 
    273             Point lastP = nc.getPoint(it.next().eastNorth); 
     273            Point lastP = nc.getPoint(it.next().getEastNorth()); 
    274274            while(it.hasNext()) 
    275275            { 
    276                 Point p = nc.getPoint(it.next().eastNorth); 
     276                Point p = nc.getPoint(it.next().getEastNorth()); 
    277277                if(isSegmentVisible(lastP, p) && isLargeSegment(lastP, p, virtualNodeSpace)) 
    278278                { 
     
    321321        Iterator<Node> it = w.nodes.iterator(); 
    322322        if (it.hasNext()) { 
    323             Point lastP = nc.getPoint(it.next().eastNorth); 
     323            Point lastP = nc.getPoint(it.next().getEastNorth()); 
    324324            for (int orderNumber = 1; it.hasNext(); orderNumber++) { 
    325                 Point p = nc.getPoint(it.next().eastNorth); 
     325                Point p = nc.getPoint(it.next().getEastNorth()); 
    326326                drawSegment(lastP, p, wayColor, 
    327327                    showOnlyHeadArrowOnly ? !it.hasNext() : showThisDirectionArrow); 
     
    352352 
    353353            if (m.member instanceof Node) { 
    354                 Point p = nc.getPoint(((Node) m.member).eastNorth); 
     354                Point p = nc.getPoint(((Node) m.member).getEastNorth()); 
    355355                if (p.x < 0 || p.y < 0 
    356356                    || p.x > nc.getWidth() || p.y > nc.getHeight()) continue; 
     
    363363                for (Node n : ((Way) m.member).nodes) { 
    364364                    if (n.incomplete || n.deleted) continue; 
    365                     Point p = nc.getPoint(n.eastNorth); 
     365                    Point p = nc.getPoint(n.getEastNorth()); 
    366366                    if (first) { 
    367367                        path.moveTo(p.x, p.y); 
     
    410410    public void drawNode(Node n, Color color, int size, int radius, boolean fill) { 
    411411        if (size > 1) { 
    412             Point p = nc.getPoint(n.eastNorth); 
     412            Point p = nc.getPoint(n.getEastNorth()); 
    413413            if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth()) 
    414414                    || (p.y > nc.getHeight())) 
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r1503 r1640  
    158158            if (n.deleted || n.incomplete) 
    159159                continue; 
    160             Point sp = getPoint(n.eastNorth); 
     160            Point sp = getPoint(n.getEastNorth()); 
    161161            double dist = p.distanceSq(sp); 
    162162            if (dist < minDistanceSq) { 
     
    193193                } 
    194194 
    195                 Point A = getPoint(lastN.eastNorth); 
    196                 Point B = getPoint(n.eastNorth); 
     195                Point A = getPoint(lastN.getEastNorth()); 
     196                Point B = getPoint(n.getEastNorth()); 
    197197                double c = A.distanceSq(B); 
    198198                double a = p.distanceSq(B); 
     
    302302                    continue; 
    303303                } 
    304                 Point A = getPoint(lastN.eastNorth); 
    305                 Point B = getPoint(n.eastNorth); 
     304                Point A = getPoint(lastN.getEastNorth()); 
     305                Point B = getPoint(n.getEastNorth()); 
    306306                double c = A.distanceSq(B); 
    307307                double a = p.distanceSq(B); 
     
    317317        for (Node n : getData().nodes) { 
    318318            if (!n.deleted && !n.incomplete 
    319                     && getPoint(n.eastNorth).distanceSq(p) < snapDistance) { 
     319                    && getPoint(n.getEastNorth()).distanceSq(p) < snapDistance) { 
    320320                nearest.add(n); 
    321321            } 
     
    336336        for (Node n : getData().nodes) { 
    337337            if (!n.deleted && !n.incomplete 
    338                     && getPoint(n.eastNorth).distanceSq(p) < snapDistance) { 
     338                    && getPoint(n.getEastNorth()).distanceSq(p) < snapDistance) { 
    339339                nearest.add(n); 
    340340            } 
  • trunk/src/org/openstreetmap/josm/gui/SelectionManager.java

    r1169 r1640  
    280280            // nodes 
    281281            for (Node n : nc.getData().nodes) { 
    282                 if (!n.deleted && !n.incomplete && r.contains(nc.getPoint(n.eastNorth))) 
     282                if (!n.deleted && !n.incomplete && r.contains(nc.getPoint(n.getEastNorth()))) 
    283283                    selection.add(n); 
    284284            } 
     
    290290                if (alt) { 
    291291                    for (Node n : w.nodes) { 
    292                         if (!n.incomplete && r.contains(nc.getPoint(n.eastNorth))) { 
     292                        if (!n.incomplete && r.contains(nc.getPoint(n.getEastNorth()))) { 
    293293                            selection.add(w); 
    294294                            break; 
     
    298298                    boolean allIn = true; 
    299299                    for (Node n : w.nodes) { 
    300                         if (!n.incomplete && !r.contains(nc.getPoint(n.eastNorth))) { 
     300                        if (!n.incomplete && !r.contains(nc.getPoint(n.getEastNorth()))) { 
    301301                            allIn = false; 
    302302                            break; 
  • trunk/src/org/openstreetmap/josm/gui/conflict/nodes/NodeListTableCellRenderer.java

    r1631 r1640  
    6565        sb.append(" ("); 
    6666 
    67         if (node.coor != null) { 
    68             sb.append(COORD_FORMATTER.format(node.coor.lat())); 
     67        if (node.getCoor() != null) { 
     68            sb.append(COORD_FORMATTER.format(node.getCoor().lat())); 
    6969            sb.append(","); 
    70             sb.append(COORD_FORMATTER.format(node.coor.lon())); 
     70            sb.append(COORD_FORMATTER.format(node.getCoor().lon())); 
    7171        } else { 
    7272            sb.append("?,?"); 
  • trunk/src/org/openstreetmap/josm/gui/conflict/relation/RelationMemberTableCellRenderer.java

    r1631 r1640  
    8282            Node n = (Node)primitive; 
    8383            sb.append(" ("); 
    84             if (n.coor != null) { 
    85                 sb.append(COORD_FORMATTER.format(n.coor.lat())); 
     84            if (n.getCoor() != null) { 
     85                sb.append(COORD_FORMATTER.format(n.getCoor().lat())); 
    8686                sb.append(","); 
    87                 sb.append(COORD_FORMATTER.format(n.coor.lon())); 
     87                sb.append(COORD_FORMATTER.format(n.getCoor().lon())); 
    8888            } else { 
    8989                sb.append("?,?"); 
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java

    r1622 r1640  
    202202        Visitor conflictPainter = new AbstractVisitor(){ 
    203203            public void visit(Node n) { 
    204                 Point p = nc.getPoint(n.eastNorth); 
     204                Point p = nc.getPoint(n.getEastNorth()); 
    205205                g.drawRect(p.x-1, p.y-1, 2, 2); 
    206206            } 
    207207            public void visit(Node n1, Node n2) { 
    208                 Point p1 = nc.getPoint(n1.eastNorth); 
    209                 Point p2 = nc.getPoint(n2.eastNorth); 
     208                Point p1 = nc.getPoint(n1.getEastNorth()); 
     209                Point p2 = nc.getPoint(n2.getEastNorth()); 
    210210                g.drawLine(p1.x, p1.y, p2.x, p2.y); 
    211211            } 
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r1558 r1640  
    427427                    doneNodes.add(n); 
    428428                } 
    429                 WayPoint wpt = new WayPoint(n.coor);                 
     429                WayPoint wpt = new WayPoint(n.getCoor());                 
    430430                if (!n.isTimestampEmpty()) 
    431431                { 
     
    441441        for (Node n : data.nodes) { 
    442442            if (n.incomplete || n.deleted || doneNodes.contains(n)) continue; 
    443             WayPoint wpt = new WayPoint(n.coor); 
     443            WayPoint wpt = new WayPoint(n.getCoor()); 
    444444            if (!n.isTimestampEmpty()) { 
    445445                wpt.attr.put("time", DateUtils.fromDate(n.getTimestamp())); 
  • trunk/src/org/openstreetmap/josm/io/OsmWriter.java

    r1604 r1640  
    9898        if (n.incomplete) return; 
    9999        addCommon(n, "node"); 
    100         out.print(" lat='"+n.coor.lat()+"' lon='"+n.coor.lon()+"'"); 
     100        out.print(" lat='"+n.getCoor().lat()+"' lon='"+n.getCoor().lon()+"'"); 
    101101        if (!withBody) { 
    102102            out.println("/>");   
Note: See TracChangeset for help on using the changeset viewer.