- Timestamp:
- 2009-07-03T23:15:39+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/JoinNodeWayAction.java
r1640 r1725 37 37 38 38 List<WaySegment> wss = Main.map.mapView.getNearestWaySegments( 39 Main.map.mapView.getPoint(node .getEastNorth()));39 Main.map.mapView.getPoint(node)); 40 40 HashMap<Way, List<Integer>> insertPoints = new HashMap<Way, List<Integer>>(); 41 41 for (WaySegment ws : wss) { -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r1722 r1725 798 798 // fall through to default action. 799 799 // (for semi-parallel lines, intersection might be miles away!) 800 if (Main.map.mapView.getPoint(n .getEastNorth()).distance(Main.map.mapView.getPoint(intersection)) < snapToIntersectionThreshold) {800 if (Main.map.mapView.getPoint(n).distance(Main.map.mapView.getPoint(intersection)) < snapToIntersectionThreshold) { 801 801 n.setEastNorth(intersection); 802 802 return; … … 838 838 g2.setStroke(new BasicStroke(3, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)); 839 839 GeneralPath b = new GeneralPath(); 840 Point p1=mv.getPoint(currentBaseNode .getEastNorth());840 Point p1=mv.getPoint(currentBaseNode); 841 841 Point p2=mv.getPoint(currentMouseEastNorth); 842 842 -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r1712 r1725 282 282 { 283 283 Way w = (Way)osm; 284 Point p1 = c.getPoint(w.nodes.get(nearestWS.lowerIndex) .getEastNorth());285 Point p2 = c.getPoint(w.nodes.get(nearestWS.lowerIndex+1) .getEastNorth());284 Point p1 = c.getPoint(w.nodes.get(nearestWS.lowerIndex)); 285 Point p2 = c.getPoint(w.nodes.get(nearestWS.lowerIndex+1)); 286 286 if(SimplePaintVisitor.isLargeSegment(p1, p2, Main.pref.getInteger("mappaint.node.virtual-space", 70))) 287 287 { -
trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
r1722 r1725 650 650 } 651 651 652 Point pFrom = nc.getPoint(fromNode .getEastNorth());653 Point pVia = nc.getPoint(viaNode .getEastNorth());652 Point pFrom = nc.getPoint(fromNode); 653 Point pVia = nc.getPoint(viaNode); 654 654 655 655 //if(restrictionDebug) { … … 663 663 // toNode = toWay.nodes.get(toWay.nodes.size()-2); 664 664 // } 665 // Point pTo = nc.getPoint(toNode .eastNorth);665 // Point pTo = nc.getPoint(toNode); 666 666 667 667 // /* debug output of interesting nodes */ … … 887 887 for (Node n : w.nodes) 888 888 { 889 p = nc.getPoint(n .getEastNorth());889 p = nc.getPoint(n); 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 .getEastNorth());943 Point pInner = nc.getPoint(n); 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) .getEastNorth());948 Point pInner = nc.getPoint(wInner.nodes.get(0)); 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 .getEastNorth());1067 Point p = nc.getPoint(n); 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 .getEastNorth());1090 Point p = nc.getPoint(n); 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 .getEastNorth());1133 Point p2 = nc.getPoint(n2 .getEastNorth());1132 Point p1 = nc.getPoint(n1); 1133 Point p2 = nc.getPoint(n2); 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 .getEastNorth());1211 Point p = nc.getPoint(n); 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 .getEastNorth());1459 Point p2 = nc.getPoint(n2 .getEastNorth());1458 Point p1 = nc.getPoint(n1); 1459 Point p2 = nc.getPoint(n2); 1460 1460 drawOrderNumber(p1, p2, orderNumber); 1461 1461 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java
r1640 r1725 271 271 Iterator<Node> it = w.nodes.iterator(); 272 272 if (it.hasNext()) { 273 Point lastP = nc.getPoint(it.next() .getEastNorth());273 Point lastP = nc.getPoint(it.next()); 274 274 while(it.hasNext()) 275 275 { 276 Point p = nc.getPoint(it.next() .getEastNorth());276 Point p = nc.getPoint(it.next()); 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() .getEastNorth());323 Point lastP = nc.getPoint(it.next()); 324 324 for (int orderNumber = 1; it.hasNext(); orderNumber++) { 325 Point p = nc.getPoint(it.next() .getEastNorth());325 Point p = nc.getPoint(it.next()); 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).getEastNorth());354 Point p = nc.getPoint((Node) m.member); 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 .getEastNorth());365 Point p = nc.getPoint(n); 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 .getEastNorth());412 Point p = nc.getPoint(n); 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
r1722 r1725 18 18 import org.openstreetmap.josm.data.Bounds; 19 19 import org.openstreetmap.josm.data.ProjectionBounds; 20 import org.openstreetmap.josm.data.coor.CachedLatLon; 20 21 import org.openstreetmap.josm.data.coor.EastNorth; 21 22 import org.openstreetmap.josm.data.coor.LatLon; … … 149 150 } 150 151 152 public Point getPoint(LatLon latlon) { 153 if(latlon == null) 154 return new Point(); 155 else if(latlon instanceof CachedLatLon) 156 return getPoint(((CachedLatLon)latlon).getEastNorth()); 157 else 158 return getPoint(getProjection().latlon2eastNorth(latlon)); 159 } 160 public Point getPoint(Node n) { 161 return getPoint(n.getEastNorth()); 162 } 163 151 164 /** 152 165 * Zoom to the given coordinate. … … 179 192 } 180 193 194 public void zoomTo(LatLon newCenter) { 195 if(newCenter instanceof CachedLatLon) 196 zoomTo(((CachedLatLon)newCenter).getEastNorth(), scale); 197 else 198 zoomTo(getProjection().latlon2eastNorth(newCenter), scale); 199 } 200 181 201 public void zoomToFactor(double x, double y, double factor) { 182 202 double newScale = scale*factor; … … 228 248 if (n.deleted || n.incomplete) 229 249 continue; 230 Point sp = getPoint(n .getEastNorth());250 Point sp = getPoint(n); 231 251 double dist = p.distanceSq(sp); 232 252 if (dist < minDistanceSq) { … … 263 283 } 264 284 265 Point A = getPoint(lastN .getEastNorth());266 Point B = getPoint(n .getEastNorth());285 Point A = getPoint(lastN); 286 Point B = getPoint(n); 267 287 double c = A.distanceSq(B); 268 288 double a = p.distanceSq(B); … … 372 392 continue; 373 393 } 374 Point A = getPoint(lastN .getEastNorth());375 Point B = getPoint(n .getEastNorth());394 Point A = getPoint(lastN); 395 Point B = getPoint(n); 376 396 double c = A.distanceSq(B); 377 397 double a = p.distanceSq(B); … … 387 407 for (Node n : getData().nodes) { 388 408 if (!n.deleted && !n.incomplete 389 && getPoint(n .getEastNorth()).distanceSq(p) < snapDistance) {409 && getPoint(n).distanceSq(p) < snapDistance) { 390 410 nearest.add(n); 391 411 } … … 406 426 for (Node n : getData().nodes) { 407 427 if (!n.deleted && !n.incomplete 408 && getPoint(n .getEastNorth()).distanceSq(p) < snapDistance) {428 && getPoint(n).distanceSq(p) < snapDistance) { 409 429 nearest.add(n); 410 430 } -
trunk/src/org/openstreetmap/josm/gui/SelectionManager.java
r1640 r1725 280 280 // nodes 281 281 for (Node n : nc.getData().nodes) { 282 if (!n.deleted && !n.incomplete && r.contains(nc.getPoint(n .getEastNorth())))282 if (!n.deleted && !n.incomplete && r.contains(nc.getPoint(n))) 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 .getEastNorth()))) {292 if (!n.incomplete && r.contains(nc.getPoint(n))) { 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 .getEastNorth()))) {300 if (!n.incomplete && !r.contains(nc.getPoint(n))) { 301 301 allIn = false; 302 302 break; -
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java
r1682 r1725 190 190 Visitor conflictPainter = new AbstractVisitor(){ 191 191 public void visit(Node n) { 192 Point p = nc.getPoint(n .getEastNorth());192 Point p = nc.getPoint(n); 193 193 g.drawRect(p.x-1, p.y-1, 2, 2); 194 194 } 195 195 public void visit(Node n1, Node n2) { 196 Point p1 = nc.getPoint(n1 .getEastNorth());197 Point p2 = nc.getPoint(n2 .getEastNorth());196 Point p1 = nc.getPoint(n1); 197 Point p2 = nc.getPoint(n2); 198 198 g.drawLine(p1.x, p1.y, p2.x, p2.y); 199 199 } -
trunk/src/org/openstreetmap/josm/gui/layer/GeoImageLayer.java
r1724 r1725 404 404 if (e.pos == null) 405 405 continue; 406 Point p = Main.map.mapView.getPoint(e.pos .getEastNorth());406 Point p = Main.map.mapView.getPoint(e.pos); 407 407 Rectangle r = new Rectangle(p.x-ICON_SIZE/2, p.y-ICON_SIZE/2, ICON_SIZE, ICON_SIZE); 408 408 if (r.contains(ev.getPoint())) { … … 536 536 537 537 if (centerToggle.getModel().isSelected()) 538 Main.map.mapView.zoomTo(currentImageEntry.pos .getEastNorth());538 Main.map.mapView.zoomTo(currentImageEntry.pos); 539 539 540 540 dlg.setTitle(currentImageEntry.image + … … 612 612 } 613 613 614 Point p = mv.getPoint(e.pos .getEastNorth());614 Point p = mv.getPoint(e.pos); 615 615 Rectangle r = new Rectangle(p.x-ICON_SIZE / 2, p.y-ICON_SIZE / 2, ICON_SIZE, ICON_SIZE); 616 616 if (r.contains(mousePosition)) { … … 624 624 ImageEntry e = data.get(i); 625 625 if (e.pos != null) { 626 Point p = mv.getPoint(e.pos .getEastNorth());626 Point p = mv.getPoint(e.pos); 627 627 Rectangle r = new Rectangle(p.x-ICON_SIZE / 2, p.y-ICON_SIZE / 2, ICON_SIZE, ICON_SIZE); 628 628 g.drawImage(e.getIcon(), r.x, r.y, null);
Note:
See TracChangeset
for help on using the changeset viewer.