Changeset 1200 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2009-01-01T17:17:44+01:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r1169 r1200 91 91 name = get("name"); 92 92 if (name == null) 93 name = id == 0 ? "": ""+id;93 name = id == 0 ? tr("node") : ""+id; 94 94 name += " (" + coor.latToString(mCord) + ", " + coor.lonToString(mCord) + ")"; 95 95 } -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r1169 r1200 1 1 // License: GPL. Copyright 2007 by Immanuel Scholz and others 2 2 package org.openstreetmap.josm.data.osm; 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 3 5 4 6 import java.text.ParseException; 5 7 import java.text.SimpleDateFormat; 6 8 import java.util.Arrays; 9 import java.util.ArrayList; 7 10 import java.util.Collection; 8 11 import java.util.Collections; … … 34 37 */ 35 38 public Map<String, String> keys; 39 40 /** 41 * The key/value list for this primitive. 42 */ 43 public Collection<String> errors; 36 44 37 45 /** … … 314 322 } 315 323 } 324 325 public void putError(String text, Boolean isError) 326 { 327 if(errors == null) 328 errors = new ArrayList<String>(); 329 String s = isError ? tr("Error: {0}", text) : tr("Warning: {0}", text); 330 System.out.println(s); 331 errors.add(s); 332 } 333 public void clearErrors() 334 { 335 errors = null; 336 } 316 337 } -
trunk/src/org/openstreetmap/josm/data/osm/Relation.java
r1169 r1200 78 78 } else { 79 79 name = get("type"); 80 // FIXME add names of members81 80 if (name == null) 82 81 name = tr("relation"); … … 89 88 int mbno = members.size(); 90 89 name += trn("{0} member", "{0} members", mbno, mbno) + ")"; 90 if(errors != null) 91 name = "*"+name; 91 92 } 92 93 return name; -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r1190 r1200 113 113 114 114 int nodesNo = new HashSet<Node>(nodes).size(); 115 name += trn(" ({0} node)", " ({0} nodes)", nodesNo, nodesNo); 115 String nodes = trn("{0} node", "{0} nodes", nodesNo, nodesNo); 116 name += (name.length() > 0) ? " ("+nodes+")" : nodes; 116 117 } 117 118 return name; -
trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
r1197 r1200 3 3 4 4 import static org.openstreetmap.josm.tools.I18n.marktr; 5 import static org.openstreetmap.josm.tools.I18n.tr; 5 6 6 7 import java.awt.BasicStroke; … … 212 213 } 213 214 214 public Collection<Way> joinWays(Collection<Way> join )215 public Collection<Way> joinWays(Collection<Way> join, OsmPrimitive errs) 215 216 { 216 217 Collection<Way> res = new LinkedList<Way>(); … … 290 291 if(!w.isClosed()) 291 292 { 292 System.out.println("ERROR: multipolygon way is not closed." + w); 293 if(errs != null) 294 { 295 errs.putError(tr("multipolygon way ''{0}'' is not closed.", 296 w.getName()), true); 297 } 293 298 } 294 299 res.add(w); … … 296 301 297 302 return res; 303 } 304 305 public void drawSelectedRelation(Relation r) 306 { 307 for (RelationMember m : r.members) 308 { 309 if (!m.member.incomplete && !m.member.deleted 310 && !(m.member instanceof Relation)) 311 { 312 /* nodes drawn on second call */ 313 if(!(m.member instanceof Node)) 314 drawSelected(m.member, styles.get(m.member), true, true); 315 alreadyDrawn.add(m.member); 316 } 317 } 298 318 } 299 319 … … 348 368 { 349 369 if(r.selected) 350 { 351 for (RelationMember m : r.members) 352 { 353 if (!m.member.incomplete && !m.member.deleted 354 && !(m.member instanceof Relation)) 355 { 356 /* nodes drawn on second call */ 357 if(!(m.member instanceof Node)) 358 drawSelected(m.member, styles.get(m.member), true, true); 359 alreadyDrawn.add(m.member); 360 } 361 } 362 } 370 drawSelectedRelation(r); 363 371 return; 364 372 } … … 368 376 Collection<Way> innerclosed = new LinkedList<Way>(); 369 377 Collection<Way> outerclosed = new LinkedList<Way>(); 378 Boolean incomplete = false; 379 380 r.clearErrors(); 370 381 371 382 for (RelationMember m : r.members) 372 383 { 373 if (!m.member.incomplete && !m.member.deleted) 384 if(m.member.incomplete) 385 incomplete = true; 386 else if(m.member.deleted) 387 r.putError(tr("Deleted member ''{0}'' in relation.", 388 m.member.getName()), true); 389 else 374 390 { 375 391 if(m.member instanceof Way) … … 378 394 if(w.nodes.size() < 2) 379 395 { 380 System.out.println("ERROR: Way with less than two points " + w); 396 r.putError(tr("Way ''{0}'' with less than two points.", 397 w.getName()), true); 381 398 } 382 399 else if("inner".equals(m.role)) … … 386 403 else 387 404 { 388 System.out.println("ERROR: No useful role for Way " + w); 405 r.putError(tr("No useful role ''{0}'' for Way ''{1}''.", 406 m.role == null ? "" : m.role, w.getName()), true); 389 407 if(m.role == null || m.role.length() == 0) 390 408 outer.add(w); … … 396 414 { 397 415 /* nodes drawn on second call */ 398 System.out.println("ERROR: Non-Way in multipolygon " + m.member); 416 r.putError(tr("Non-Way ''{0}'' in multipolygon.", 417 m.member.getName()), true); 399 418 } 400 419 } … … 426 445 if(join.size() != 0) 427 446 { 428 for(Way w : joinWays(join ))447 for(Way w : joinWays(join, incomplete ? null : r)) 429 448 outerclosed.add(w); 430 449 } … … 439 458 if(join.size() != 0) 440 459 { 441 for(Way w : joinWays(join ))460 for(Way w : joinWays(join, incomplete ? null : r)) 442 461 innerclosed.add(w); 443 462 } … … 504 523 if(wayStyle.equals(innerStyle)) 505 524 { 506 System.out.println("WARNING: Inner waystyle equals multipolygon for way " + wInner); 525 r.putError(tr("Style for inner way ''{0}'' equals multipolygon.", 526 wInner.getName()), false); 507 527 if(!r.selected) 508 528 alreadyDrawnAreas.add(wInner); … … 528 548 && !wayStyle.equals(outerStyle)) 529 549 { 530 System.out.println("ERROR: Outer waystyle does not match multipolygon for way " + wOuter); 550 r.putError(tr("Style for outer way ''{0}'' mismatches.", 551 wOuter.getName()), true); 531 552 } 532 553 if(r.selected) … … 540 561 } 541 562 } 563 else if(r.selected) 564 drawSelectedRelation(r); 542 565 } 543 566
Note:
See TracChangeset
for help on using the changeset viewer.