Changeset 1309 in josm for trunk/src/org
- Timestamp:
- 2009-01-20T13:55:33+01:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
r1297 r1309 172 172 if(n.eastNorth.north() < miny) miny = n.eastNorth.north(); 173 173 } 174 174 175 175 if ((minx > maxEN.east()) || 176 176 (miny > maxEN.north()) || … … 471 471 // draw multipolygon relations including their ways 472 472 // other relations are only drawn when selected 473 473 474 474 // we are in the "draw selected" phase 475 475 // TODO: is it necessary to check for r.selected? … … 486 486 return; 487 487 } 488 488 489 489 if (drawMultipolygon && r.keys != null && "multipolygon".equals(r.keys.get("type"))) 490 490 { … … 492 492 return; 493 493 } 494 494 495 495 if (drawRestriction && r.keys != null && "restriction".equals(r.keys.get("type"))) 496 496 { … … 498 498 return; 499 499 } 500 500 501 501 if(r.selected) 502 502 drawSelectedRelation(r); 503 503 } 504 504 505 505 506 506 // this current experimental implementation will only work for standard restrictions: 507 507 // from(Way) / via(Node) / to(Way) … … 509 509 if(restrictionDebug) 510 510 System.out.println("Restriction: " + r.keys.get("name") + " restriction " + r.keys.get("restriction")); 511 511 512 512 r.clearErrors(); 513 513 … … 521 521 if(restrictionDebug) 522 522 System.out.println("member " + m.member + " selected " + r.selected); 523 524 if(m.member == null) 523 524 if(m.member == null) 525 525 r.putError(tr("Empty member in relation."), true); 526 526 else if(m.member.deleted) … … 529 529 else if(m.member.incomplete) 530 530 { 531 // TODO: What to do with incomplete members? 532 //incomplete = true; 533 r.putError(tr("incomplete member {0}" + " with role {1}", m.member, m.role), true); 531 return; 534 532 } 535 533 else … … 550 548 else if("from".equals(m.role)) { 551 549 if(fromWay != null) 552 r.putError(tr(" more than one from way found - ignored."), true);550 r.putError(tr("More than one \"from\" way found."), true); 553 551 else { 554 552 fromWay = w; … … 556 554 } else if("to".equals(m.role)) { 557 555 if(toWay != null) 558 r.putError(tr(" more than one to way found - ignored."), true);556 r.putError(tr("More than one \"to\" way found."), true); 559 557 else { 560 558 toWay = w; … … 562 560 } 563 561 else 564 r.putError(tr(" unknown role {0} - ignored", m.role), true);562 r.putError(tr("Unknown role {0}.", m.role), true); 565 563 } 566 564 else if(m.member instanceof Node) … … 569 567 if("via".equals(m.role)) 570 568 if(via != null) 571 System.out.println(" more than one via found - ignored");569 System.out.println("More than one \"via\" found."); 572 570 else { 573 571 via = n; 574 572 } 575 573 else 576 r.putError(tr(" unknown role {0} - ignored", m.role), true);574 r.putError(tr("Unknown role ''{0}''.", m.role), true); 577 575 } 578 576 else 579 r.putError(tr(" unknown instanceof member - ignored"), true);580 } 581 } 582 577 r.putError(tr("Unknown member type for ''{0}''.", m.member.getName()), true); 578 } 579 } 580 583 581 if (fromWay == null) { 584 r.putError(tr(" no from way found"), true);582 r.putError(tr("No \"from\" way found."), true); 585 583 return; 586 584 } 587 585 if (toWay == null) { 588 r.putError(tr(" no to way found"), true);586 r.putError(tr("No \"to\" way found."), true); 589 587 return; 590 588 } 591 589 if (via == null) { 592 r.putError(tr(" no via node found"), true);590 r.putError(tr("No \"via\" node found."), true); 593 591 return; 594 592 } … … 596 594 // check if "from" way starts or ends at via 597 595 if(fromWay.nodes.get(0) != via && fromWay.nodes.get(fromWay.nodes.size()-1) != via) { 598 r.putError(tr(" from way doesn't start or end at a via node"), true);596 r.putError(tr("The \"from\" way doesn't start or end at a \"via\" node."), true); 599 597 return; 600 598 } … … 606 604 607 605 // find the "direct" nodes before the via node 608 Node fromNode = null; 606 Node fromNode = null; 609 607 try 610 608 { … … 617 615 } 618 616 } catch (IndexOutOfBoundsException ioobe) { 619 System.out.println("from must contain at least 2 nodes");617 r.putError(tr("The \"{0}\" way must contain at least 2 nodes.", "from"), true); 620 618 } 621 619 … … 634 632 } 635 633 } catch (IndexOutOfBoundsException ioobe) { 636 System.out.println("to must contain at least 2 nodes");637 } 638 634 r.putError(tr("The \"{0}\" way must contain at least 2 nodes.", "to"), true); 635 } 636 639 637 Point pFrom = nc.getPoint(fromNode.eastNorth); 640 638 Point pVia = nc.getPoint(via.eastNorth); 641 639 642 640 if(restrictionDebug) { 643 641 Point pTo = nc.getPoint(toNode.eastNorth); … … 660 658 double dx = (pFrom.x >= pVia.x) ? (pFrom.x - pVia.x) : (pVia.x - pFrom.x); 661 659 double dy = (pFrom.y >= pVia.y) ? (pFrom.y - pVia.y) : (pVia.y - pFrom.y); 662 660 663 661 double fromAngle; 664 662 if(dx == 0.0) { … … 671 669 double vx = distanceFromVia * Math.cos(fromAngle); 672 670 double vy = distanceFromVia * Math.sin(fromAngle); 673 671 674 672 if(pFrom.x < pVia.x) vx = -vx; 675 673 if(pFrom.y < pVia.y) vy = -vy; … … 677 675 if(restrictionDebug) 678 676 System.out.println("vx " + vx + " vy " + vy); 679 677 680 678 // go a few pixels away from the way (in a right angle) 681 679 // (calculate the vx2/vy2 vector with the specified length and the direction 90degrees away from the first segment of the "from" way) … … 725 723 iconAngle = 270-fromAngleDeg; 726 724 } 727 725 728 726 IconElemStyle nodeStyle = (IconElemStyle)getPrimitiveStyle(r); 729 727 730 728 if (nodeStyle == null) { 731 r.putError(tr("Style for restriction {0} not found ", r.keys.get("restriction")), true);732 return; 733 } 734 735 // rotate icon with direction last node in from to 729 r.putError(tr("Style for restriction {0} not found.", r.keys.get("restriction")), true); 730 return; 731 } 732 733 // rotate icon with direction last node in from to 736 734 if(restrictionDebug) 737 735 System.out.println("Deg1 " + fromAngleDeg + " Deg2 " + (fromAngleDeg + 180) + " Icon " + iconAngle); … … 761 759 for (RelationMember m : r.members) 762 760 { 763 if(m.member == null) 761 if(m.member == null) 764 762 r.putError(tr("Empty member in relation."), true); 765 763 else if(m.member.deleted) … … 869 867 --contains; 870 868 } 871 if(contains == 0) return 1; 872 if(contains == p.npoints) return 0; 873 return 2; 869 if(contains == 0) return 1; 870 if(contains == p.npoints) return 0; 871 return 2; 874 872 } 875 873 public void addInner(Polygon p) … … 1037 1035 { 1038 1036 Polygon polygon = getPolygon(w); 1039 1037 1040 1038 // set the opacity (alpha) level of the filled polygon 1041 1039 g.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), fillAlpha)); … … 1186 1184 boolean profiler = Main.pref.getBoolean("mappaint.profiler",false); 1187 1185 profilerOmitDraw = Main.pref.getBoolean("mappaint.profiler.omitdraw",false); 1188 1186 1189 1187 useStyleCache = Main.pref.getBoolean("mappaint.cache",true); 1190 1188 fillAreas = Main.pref.getInteger("mappaint.fillareas", 100000); … … 1196 1194 LatLon ll2 = nc.getLatLon(100,0); 1197 1195 dist = ll1.greatCircleDistance(ll2); 1198 1196 1199 1197 long profilerStart = java.lang.System.currentTimeMillis(); 1200 1198 long profilerLast = profilerStart; … … 1221 1219 minEN = nc.getEastNorth(0,nc.getHeight()-1); 1222 1220 maxEN = nc.getEastNorth(nc.getWidth()-1,0); 1223 1221 1224 1222 1225 1223 selectedCall = false; -
trunk/src/org/openstreetmap/josm/data/projection/Epsg4326.java
r1169 r1309 24 24 } 25 25 26 public String toCode() { 27 return "EPSG:4326"; 28 } 29 26 30 public String getCacheDirectoryName() { 27 31 return "epsg4326"; -
trunk/src/org/openstreetmap/josm/data/projection/Lambert.java
r1212 r1309 122 122 } else if (layoutZone != currentZone) { 123 123 if ((currentZone < layoutZone && Math.abs(zoneLimits[currentZone] - lt) > cMaxOverlappingZones) 124 124 || (currentZone > layoutZone && Math.abs(zoneLimits[layoutZone] - lt) > cMaxOverlappingZones)) { 125 125 JOptionPane.showMessageDialog(Main.parent, 126 127 128 129 + "Undo your last action, Save your work\n"130 + "and Start a new layer on the new zone."));126 tr("IMPORTANT : data positioned far away from\n" 127 + "the current Lambert zone limits.\n" 128 + "Do not upload any data after this message.\n" 129 + "Undo your last action, save your work\n" 130 + "and start a new layer on the new zone.")); 131 131 layoutZone = -1; 132 132 dontDisplayErrors = true; … … 157 157 @Override public String toString() { 158 158 return tr("Lambert Zone (France)"); 159 } 160 161 public String toCode() { 162 return "EPSG::"+(27571+currentZone); 159 163 } 160 164 -
trunk/src/org/openstreetmap/josm/data/projection/LambertEST.java
r1230 r1309 97 97 } 98 98 99 public String toCode() { 100 return "EPSG:3301"; 101 } 102 99 103 public String getCacheDirectoryName() { 100 104 return "lambertest"; -
trunk/src/org/openstreetmap/josm/data/projection/Mercator.java
r1261 r1309 37 37 } 38 38 39 public String toCode() { 40 return "EPSG:3785"; /* TODO: Check if that is correct */ 41 } 42 39 43 public String getCacheDirectoryName() { 40 44 return "mercator"; -
trunk/src/org/openstreetmap/josm/data/projection/Projection.java
r1230 r1309 58 58 59 59 /** 60 * Return projection code. 61 */ 62 String toCode(); 63 64 /** 60 65 * Get a filename compatible string (for the cache directory) 61 66 */ -
trunk/src/org/openstreetmap/josm/gui/layer/GeoImageLayer.java
r1300 r1309 501 501 502 502 while (true) { 503 int answer = JOptionPane.showConfirmDialog(Main.parent, p, tr("Sync ronize Time with GPS Unit"), JOptionPane.OK_CANCEL_OPTION);503 int answer = JOptionPane.showConfirmDialog(Main.parent, p, tr("Synchronize Time with GPS Unit"), JOptionPane.OK_CANCEL_OPTION); 504 504 if (answer != JOptionPane.OK_OPTION || gpsText.getText().equals("")) 505 505 return;
Note:
See TracChangeset
for help on using the changeset viewer.