Changeset 1640 in josm
- Timestamp:
- 2009-06-06T14:30:21+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java
r1636 r1640 89 89 90 90 Node n = new Node(Main.proj.eastNorth2latlon(result)); 91 if (n. coor.isOutSideWorld()) {91 if (n.getCoor().isOutSideWorld()) { 92 92 JOptionPane.showMessageDialog(Main.parent, tr("Some of the nodes are (almost) in the line")); 93 93 return null; … … 163 163 } else { 164 164 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(); 166 166 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()); 168 168 } 169 169 nodes = new LinkedList<Node>(); … … 191 191 n1 = n0; 192 192 n0 = n; 193 EastNorth cc = circumcenter(n0. eastNorth, n1.eastNorth, n2.eastNorth);193 EastNorth cc = circumcenter(n0.getEastNorth(), n1.getEastNorth(), n2.getEastNorth()); 194 194 if (cc == null) 195 195 return; … … 209 209 if (radius == 0) { 210 210 for (Node n : nodes) { 211 radius += distance(center, n. eastNorth);211 radius += distance(center, n.getEastNorth()); 212 212 } 213 213 radius = radius / nodes.size(); … … 220 220 if (regular) { // Make a regular polygon 221 221 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)) 225 225 angle *= -1; 226 226 … … 228 228 for (Node n : nodes) { 229 229 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())); 231 231 pc.angle += angle; 232 232 } 233 233 } else { // Move each node to that distance from the centre. 234 234 for (Node n : nodes) { 235 pc = new PolarCoor(n. eastNorth, center, 0);235 pc = new PolarCoor(n.getEastNorth(), center, 0); 236 236 pc.radius = radius; 237 237 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())); 239 239 } 240 240 } -
trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java
r1212 r1640 71 71 itnodes.remove(n); 72 72 for (Node m : itnodes) { 73 double dist = Math.sqrt(n. eastNorth.distance(m.eastNorth));73 double dist = Math.sqrt(n.getEastNorth().distance(m.getEastNorth())); 74 74 if (dist > distance) { 75 75 nodea = n; … … 85 85 86 86 // 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(); 91 91 92 92 // A list of commands to do … … 96 96 for (Node n : nodes) { 97 97 // 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(); 100 100 101 101 if (ax == bx) { … … 110 110 double c1 = ay - (ax * m1); 111 111 double m2 = (-1) / m1; 112 double c2 = n. eastNorth.north() - (n.eastNorth.east() * m2);112 double c2 = n.getEastNorth().north() - (n.getEastNorth().east() * m2); 113 113 114 114 nx = (c2 - c1) / (m1 - m2); … … 117 117 118 118 // 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() )); 120 120 } 121 121 -
trunk/src/org/openstreetmap/josm/actions/CreateCircleAction.java
r1245 r1640 105 105 // let's get some shorter names 106 106 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(); 109 109 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(); 112 112 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(); 115 115 116 116 // calculate the center (xc/yc) -
trunk/src/org/openstreetmap/josm/actions/DistributeAction.java
r1380 r1640 70 70 itnodes.remove(n); 71 71 for (Node m : itnodes) { 72 double dist = Math.sqrt(n. eastNorth.distance(m.eastNorth));72 double dist = Math.sqrt(n.getEastNorth().distance(m.getEastNorth())); 73 73 if (dist > distance) { 74 74 nodea = n; … … 84 84 85 85 // 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(); 90 90 91 91 // A list of commands to do … … 104 104 distance = 0.0; 105 105 for (Node n : nodes) { 106 double dist = Math.sqrt(nodeb. eastNorth.distance(n.eastNorth));106 double dist = Math.sqrt(nodeb.getEastNorth().distance(n.getEastNorth())); 107 107 if (dist > distance) { 108 108 s = n; … … 112 112 113 113 // 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; 116 116 117 117 cmds.add(new MoveCommand(s, dx, dy)); -
trunk/src/org/openstreetmap/josm/actions/JoinNodeWayAction.java
r1218 r1640 37 37 38 38 List<WaySegment> wss = Main.map.mapView.getNearestWaySegments( 39 Main.map.mapView.getPoint(node. eastNorth));39 Main.map.mapView.getPoint(node.getEastNorth())); 40 40 HashMap<Way, List<Integer>> insertPoints = new HashMap<Way, List<Integer>>(); 41 41 for (WaySegment ws : wss) { -
trunk/src/org/openstreetmap/josm/actions/MoveAction.java
r1169 r1640 99 99 100 100 for (Node n : affectedNodes) { 101 if (n. coor.isOutSideWorld()) {101 if (n.getCoor().isOutSideWorld()) { 102 102 // Revert move 103 103 ((MoveCommand) c).moveAgain(-distx, -disty); -
trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
r1415 r1640 81 81 int i2 = (i1+1) % (way.nodes.size()-1); 82 82 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())); 85 85 double delta = Math.abs(angle2 - angle1); 86 86 while(delta > Math.PI) delta -= Math.PI; … … 117 117 // When selection contains two nodes, use the nodes to compute a direction 118 118 // 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())); 120 120 use_dirnodes = true; 121 121 } … … 131 131 EastNorth en[] = new EastNorth[sides]; 132 132 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()); 134 134 } 135 135 … … 142 142 double weights[] = new double[sides]; 143 143 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()); 146 146 } 147 147 … … 232 232 233 233 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(); 237 237 cmds.add(new MoveCommand(n, dx, dy)); 238 238 } -
trunk/src/org/openstreetmap/josm/actions/PasteAction.java
r1636 r1640 43 43 double maxEast = -1E100, minEast = 1E100, maxNorth = -1E100, minNorth = 1E100; 44 44 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(); 47 47 if (east > maxEast) { maxEast = east; } 48 48 if (east < minEast) { minEast = east; } … … 70 70 nnew.id = 0; 71 71 if (Main.main.editLayer() == source) { 72 nnew.setEastNorth(nnew. eastNorth.add(offsetEast, offsetNorth));72 nnew.setEastNorth(nnew.getEastNorth().add(offsetEast, offsetNorth)); 73 73 } 74 74 map.put(n, nnew); -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r1636 r1640 332 332 // no node found in clicked area 333 333 n = new Node(Main.map.mapView.getLatLon(e.getX(), e.getY())); 334 if (n. coor.isOutSideWorld()) {334 if (n.getCoor().isOutSideWorld()) { 335 335 JOptionPane.showMessageDialog(Main.parent, 336 336 tr("Cannot add a node outside of the world.")); … … 647 647 // user clicked on node 648 648 if (selection.isEmpty()) return; 649 currentMouseEastNorth = currentMouseNode. eastNorth;649 currentMouseEastNorth = currentMouseNode.getEastNorth(); 650 650 mouseOnExistingNode = currentMouseNode; 651 651 } else { … … 690 690 // find out the distance, in metres, between the base point and the mouse cursor 691 691 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)); 694 694 if (previousNode != null) { 695 angle = hdg - Math.toDegrees(previousNode. coor.heading(currentBaseNode.coor));695 angle = hdg - Math.toDegrees(previousNode.getCoor().heading(currentBaseNode.getCoor())); 696 696 if (angle < 0) angle += 360; 697 697 } … … 772 772 Iterator<Pair<Node,Node>> i = segs.iterator(); 773 773 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(); 776 776 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(); 779 779 780 780 double u=det(B.east() - A.east(), B.north() - A.north(), C.east() - D.east(), C.north() - D.north()); … … 800 800 // fall through to default action. 801 801 // (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) { 803 803 n.setEastNorth(intersection); 804 804 return; … … 806 806 807 807 default: 808 EastNorth P = n. eastNorth;808 EastNorth P = n.getEastNorth(); 809 809 seg = segs.iterator().next(); 810 A = seg.a. eastNorth;811 B = seg.b. eastNorth;810 A = seg.a.getEastNorth(); 811 B = seg.b.getEastNorth(); 812 812 double a = P.distanceSq(B); 813 813 double b = P.distanceSq(A); … … 840 840 g2.setStroke(new BasicStroke(3, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)); 841 841 GeneralPath b = new GeneralPath(); 842 Point p1=mv.getPoint(currentBaseNode. eastNorth);842 Point p1=mv.getPoint(currentBaseNode.getEastNorth()); 843 843 Point p2=mv.getPoint(currentMouseEastNorth); 844 844 -
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r1422 r1640 155 155 Node n2 = selectedSegment.way.nodes.get(selectedSegment.lowerIndex + 1); 156 156 157 EastNorth en1 = n1. eastNorth;158 EastNorth en2 = n2. eastNorth;157 EastNorth en1 = n1.getEastNorth(); 158 EastNorth en2 = n2.getEastNorth(); 159 159 EastNorth en3 = mv.getEastNorth(mousePos.x, mousePos.y); 160 160 … … 234 234 Node n1 = selectedSegment.way.nodes.get(selectedSegment.lowerIndex); 235 235 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); 237 237 Node n3 = new Node(Main.proj.eastNorth2latlon(en3)); 238 EastNorth en4 = n1. eastNorth.add(xoff, yoff);238 EastNorth en4 = n1.getEastNorth().add(xoff, yoff); 239 239 Node n4 = new Node(Main.proj.eastNorth2latlon(en4)); 240 240 Way wnew = new Way(selectedSegment.way); -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r1634 r1640 224 224 225 225 for (Node n : affectedNodes) { 226 if (n. coor.isOutSideWorld()) {226 if (n.getCoor().isOutSideWorld()) { 227 227 // Revert move 228 228 ((MoveCommand) c).moveAgain(-dx, -dy); … … 280 280 { 281 281 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()); 284 284 if(SimplePaintVisitor.isLargeSegment(p1, p2, Main.pref.getInteger("mappaint.node.virtual-space", 70))) 285 285 { -
trunk/src/org/openstreetmap/josm/command/DeleteCommand.java
r1499 r1640 340 340 if (osm instanceof Node && osm.id != 0) { 341 341 Node n = (Node) osm; 342 if (!a.contains(n. coor)) {342 if (!a.contains(n.getCoor())) { 343 343 JPanel msg = new JPanel(new GridBagLayout()); 344 344 msg.add(new JLabel( -
trunk/src/org/openstreetmap/josm/command/MoveCommand.java
r1636 r1640 70 70 for (Node n : this.objects) { 71 71 OldState os = new OldState(); 72 os.eastNorth = n. eastNorth;73 os.latlon = n. coor;72 os.eastNorth = n.getEastNorth(); 73 os.latlon = n.getCoor(); 74 74 os.modified = n.modified; 75 75 oldState.add(os); … … 87 87 public void moveAgain(double x, double y) { 88 88 for (Node n : objects) { 89 n.setEastNorth(n. eastNorth.add(x, y));89 n.setEastNorth(n.getEastNorth().add(x, y)); 90 90 } 91 91 this.x += x; … … 95 95 @Override public boolean executeCommand() { 96 96 for (Node n : objects) { 97 n.setEastNorth(n. eastNorth.add(x, y));97 n.setEastNorth(n.getEastNorth().add(x, y)); 98 98 n.modified = true; 99 99 } -
trunk/src/org/openstreetmap/josm/command/RotateCommand.java
r1636 r1640 64 64 for (Node n : this.objects) { 65 65 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(); 68 68 os.modified = n.modified; 69 69 oldState.put(n, os); -
trunk/src/org/openstreetmap/josm/data/conflict/PositionConflict.java
r1636 r1640 10 10 11 11 @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()); 13 13 } 14 14 15 15 @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; 17 17 } 18 18 … … 23 23 @Override public void apply(OsmPrimitive target, OsmPrimitive other) { 24 24 if (target instanceof Node) { 25 ((Node)target).setEastNorth(((Node)other). eastNorth);25 ((Node)target).setEastNorth(((Node)other).getEastNorth()); 26 26 int newversion = Math.max(target.version, other.version); 27 27 // set version on "other" as well in case user decides to keep local -
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r1636 r1640 20 20 public LatLon coor; 21 21 public volatile EastNorth eastNorth; 22 23 public void setCoor(LatLon coor) {22 23 public final void setCoor(LatLon coor) { 24 24 this.coor = coor; 25 this.eastNorth = Main.proj.latlon2eastNorth(coor); 25 this.eastNorth = Main.proj.latlon2eastNorth(coor); 26 26 } 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) { 29 33 this.eastNorth = eastNorth; 30 34 this.coor = Main.proj.eastNorth2latlon(eastNorth); 31 35 } 32 33 public void setEastNorth(double east, double north) {36 37 public final void setEastNorth(double east, double north) { 34 38 this.setEastNorth(new EastNorth(east, north)); 35 39 } 36 40 41 public final EastNorth getEastNorth() { 42 return eastNorth; 43 } 44 37 45 private static CoordinateFormat mCord; 38 46 … … 107 115 return name; 108 116 } 117 109 118 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/BoundingXYVisitor.java
r1523 r1640 22 22 23 23 public void visit(Node n) { 24 visit(n. eastNorth);24 visit(n.getEastNorth()); 25 25 } 26 26 -
trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
r1635 r1640 134 134 public void visit(Node n) { 135 135 /* 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())) 140 140 { 141 141 n.mappaintVisibleCode = viewid; … … 180 180 for (Node n : w.nodes) 181 181 { 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(); 186 186 } 187 187 … … 650 650 } 651 651 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()); 654 654 655 655 //if(restrictionDebug) { … … 887 887 for (Node n : w.nodes) 888 888 { 889 p = nc.getPoint(n. eastNorth);889 p = nc.getPoint(n.getEastNorth()); 890 890 poly.addPoint(p.x,p.y); 891 891 } … … 941 941 for (Node n : wInner.nodes) 942 942 { 943 Point pInner = nc.getPoint(n. eastNorth);943 Point pInner = nc.getPoint(n.getEastNorth()); 944 944 polygon.addPoint(pInner.x,pInner.y); 945 945 } 946 946 if(!wInner.isClosed()) 947 947 { 948 Point pInner = nc.getPoint(wInner.nodes.get(0). eastNorth);948 Point pInner = nc.getPoint(wInner.nodes.get(0).getEastNorth()); 949 949 polygon.addPoint(pInner.x,pInner.y); 950 950 } … … 1065 1065 for (Node n : w.nodes) 1066 1066 { 1067 Point p = nc.getPoint(n. eastNorth);1067 Point p = nc.getPoint(n.getEastNorth()); 1068 1068 polygon.addPoint(p.x,p.y); 1069 1069 } … … 1088 1088 1089 1089 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()); 1091 1091 if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth()) || (p.y > nc.getHeight())) return; 1092 1092 … … 1130 1130 displaySegments(col, width, dashed, dashedColor); 1131 1131 } 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()); 1134 1134 1135 1135 if (!isSegmentVisible(p1, p2)) { … … 1209 1209 public void drawNode(Node n, Color color, int size, int radius, boolean fill) { 1210 1210 if (isZoomOk(null) && size > 1) { 1211 Point p = nc.getPoint(n. eastNorth);1211 Point p = nc.getPoint(n.getEastNorth()); 1212 1212 if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth()) 1213 1213 || (p.y > nc.getHeight())) … … 1456 1456 */ 1457 1457 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()); 1460 1460 drawOrderNumber(p1, p2, orderNumber); 1461 1461 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/MergeVisitor.java
r1567 r1640 163 163 164 164 private static boolean realMatch(Node n1, Node n2) { 165 return n1. coor.equalsEpsilon(n2.coor);165 return n1.getCoor().equalsEpsilon(n2.getCoor()); 166 166 } 167 167 -
trunk/src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java
r1523 r1640 271 271 Iterator<Node> it = w.nodes.iterator(); 272 272 if (it.hasNext()) { 273 Point lastP = nc.getPoint(it.next(). eastNorth);273 Point lastP = nc.getPoint(it.next().getEastNorth()); 274 274 while(it.hasNext()) 275 275 { 276 Point p = nc.getPoint(it.next(). eastNorth);276 Point p = nc.getPoint(it.next().getEastNorth()); 277 277 if(isSegmentVisible(lastP, p) && isLargeSegment(lastP, p, virtualNodeSpace)) 278 278 { … … 321 321 Iterator<Node> it = w.nodes.iterator(); 322 322 if (it.hasNext()) { 323 Point lastP = nc.getPoint(it.next(). eastNorth);323 Point lastP = nc.getPoint(it.next().getEastNorth()); 324 324 for (int orderNumber = 1; it.hasNext(); orderNumber++) { 325 Point p = nc.getPoint(it.next(). eastNorth);325 Point p = nc.getPoint(it.next().getEastNorth()); 326 326 drawSegment(lastP, p, wayColor, 327 327 showOnlyHeadArrowOnly ? !it.hasNext() : showThisDirectionArrow); … … 352 352 353 353 if (m.member instanceof Node) { 354 Point p = nc.getPoint(((Node) m.member). eastNorth);354 Point p = nc.getPoint(((Node) m.member).getEastNorth()); 355 355 if (p.x < 0 || p.y < 0 356 356 || p.x > nc.getWidth() || p.y > nc.getHeight()) continue; … … 363 363 for (Node n : ((Way) m.member).nodes) { 364 364 if (n.incomplete || n.deleted) continue; 365 Point p = nc.getPoint(n. eastNorth);365 Point p = nc.getPoint(n.getEastNorth()); 366 366 if (first) { 367 367 path.moveTo(p.x, p.y); … … 410 410 public void drawNode(Node n, Color color, int size, int radius, boolean fill) { 411 411 if (size > 1) { 412 Point p = nc.getPoint(n. eastNorth);412 Point p = nc.getPoint(n.getEastNorth()); 413 413 if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth()) 414 414 || (p.y > nc.getHeight())) -
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r1503 r1640 158 158 if (n.deleted || n.incomplete) 159 159 continue; 160 Point sp = getPoint(n. eastNorth);160 Point sp = getPoint(n.getEastNorth()); 161 161 double dist = p.distanceSq(sp); 162 162 if (dist < minDistanceSq) { … … 193 193 } 194 194 195 Point A = getPoint(lastN. eastNorth);196 Point B = getPoint(n. eastNorth);195 Point A = getPoint(lastN.getEastNorth()); 196 Point B = getPoint(n.getEastNorth()); 197 197 double c = A.distanceSq(B); 198 198 double a = p.distanceSq(B); … … 302 302 continue; 303 303 } 304 Point A = getPoint(lastN. eastNorth);305 Point B = getPoint(n. eastNorth);304 Point A = getPoint(lastN.getEastNorth()); 305 Point B = getPoint(n.getEastNorth()); 306 306 double c = A.distanceSq(B); 307 307 double a = p.distanceSq(B); … … 317 317 for (Node n : getData().nodes) { 318 318 if (!n.deleted && !n.incomplete 319 && getPoint(n. eastNorth).distanceSq(p) < snapDistance) {319 && getPoint(n.getEastNorth()).distanceSq(p) < snapDistance) { 320 320 nearest.add(n); 321 321 } … … 336 336 for (Node n : getData().nodes) { 337 337 if (!n.deleted && !n.incomplete 338 && getPoint(n. eastNorth).distanceSq(p) < snapDistance) {338 && getPoint(n.getEastNorth()).distanceSq(p) < snapDistance) { 339 339 nearest.add(n); 340 340 } -
trunk/src/org/openstreetmap/josm/gui/SelectionManager.java
r1169 r1640 280 280 // nodes 281 281 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()))) 283 283 selection.add(n); 284 284 } … … 290 290 if (alt) { 291 291 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()))) { 293 293 selection.add(w); 294 294 break; … … 298 298 boolean allIn = true; 299 299 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()))) { 301 301 allIn = false; 302 302 break; -
trunk/src/org/openstreetmap/josm/gui/conflict/nodes/NodeListTableCellRenderer.java
r1631 r1640 65 65 sb.append(" ("); 66 66 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())); 69 69 sb.append(","); 70 sb.append(COORD_FORMATTER.format(node. coor.lon()));70 sb.append(COORD_FORMATTER.format(node.getCoor().lon())); 71 71 } else { 72 72 sb.append("?,?"); -
trunk/src/org/openstreetmap/josm/gui/conflict/relation/RelationMemberTableCellRenderer.java
r1631 r1640 82 82 Node n = (Node)primitive; 83 83 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())); 86 86 sb.append(","); 87 sb.append(COORD_FORMATTER.format(n. coor.lon()));87 sb.append(COORD_FORMATTER.format(n.getCoor().lon())); 88 88 } else { 89 89 sb.append("?,?"); -
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java
r1622 r1640 202 202 Visitor conflictPainter = new AbstractVisitor(){ 203 203 public void visit(Node n) { 204 Point p = nc.getPoint(n. eastNorth);204 Point p = nc.getPoint(n.getEastNorth()); 205 205 g.drawRect(p.x-1, p.y-1, 2, 2); 206 206 } 207 207 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()); 210 210 g.drawLine(p1.x, p1.y, p2.x, p2.y); 211 211 } -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r1558 r1640 427 427 doneNodes.add(n); 428 428 } 429 WayPoint wpt = new WayPoint(n. coor);429 WayPoint wpt = new WayPoint(n.getCoor()); 430 430 if (!n.isTimestampEmpty()) 431 431 { … … 441 441 for (Node n : data.nodes) { 442 442 if (n.incomplete || n.deleted || doneNodes.contains(n)) continue; 443 WayPoint wpt = new WayPoint(n. coor);443 WayPoint wpt = new WayPoint(n.getCoor()); 444 444 if (!n.isTimestampEmpty()) { 445 445 wpt.attr.put("time", DateUtils.fromDate(n.getTimestamp())); -
trunk/src/org/openstreetmap/josm/io/OsmWriter.java
r1604 r1640 98 98 if (n.incomplete) return; 99 99 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()+"'"); 101 101 if (!withBody) { 102 102 out.println("/>");
Note:
See TracChangeset
for help on using the changeset viewer.