- Timestamp:
- 2008-01-02T15:49:27+01:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/NameVisitor.java
r467 r505 50 50 */ 51 51 public void visit(Node n) { 52 name = n.get("name");53 if (name == null) {54 if (n.incomplete){55 name = "incomplete" + (n.id==0?"":" "+n.id);56 } else{57 name = (n.id==0?"":""+n.id)+" ("+latLonFormat.format(n.coor.lat())+", "+latLonFormat.format(n.coor.lon())+")";52 if (n.incomplete) { 53 name = tr("incomplete"); 54 } else { 55 name = n.get("name"); 56 if (name == null) { 57 name = n.id == 0 ? "" : ""+n.id; 58 58 } 59 name += " ("+latLonFormat.format(n.coor.lat())+", "+latLonFormat.format(n.coor.lon())+")"; 59 60 } 60 61 addId(n); … … 69 70 */ 70 71 public void visit(Way w) { 71 name = w.get("name"); 72 if (name == null) name = w.get("ref"); 73 if (name == null) { 74 String what = (w.get("highway") != null) ? "highway " : (w.get("railway") != null) ? "railway " : (w.get("waterway") != null) ? "waterway " : ""; 72 if (w.incomplete) { 73 name = tr("incomplete"); 74 } else { 75 name = w.get("name"); 76 if (name == null) name = w.get("ref"); 77 if (name == null) { 78 name = 79 (w.get("highway") != null) ? "highway" : 80 (w.get("railway") != null) ? "railway" : 81 (w.get("waterway") != null) ? "waterway" : ""; 82 } 83 75 84 int nodesNo = new HashSet<Node>(w.nodes).size(); 76 name = what + trn("{0} node", "{0} nodes", nodesNo, nodesNo);85 name += trn(" ({0} node)", " ({0} nodes)", nodesNo, nodesNo); 77 86 } 78 87 addId(w); … … 85 94 */ 86 95 public void visit(Relation e) { 87 name = e.get("type"); 88 // FIXME add names of members 89 if (name == null) 90 name = "relation"; 96 if (e.incomplete) { 97 name = tr("incomplete"); 98 } else { 99 name = e.get("type"); 100 // FIXME add names of members 101 if (name == null) 102 name = "relation"; 103 } 91 104 addId(e); 92 105 icon = ImageProvider.get("data", "relation");
Note:
See TracChangeset
for help on using the changeset viewer.