Changeset 1881 in josm for trunk/src/org/openstreetmap/josm/io
- Timestamp:
- 2009-08-02T18:02:44+02:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
r1811 r1881 63 63 private DataSet outputDataSet; 64 64 65 private boolean cancelled = false; 66 65 67 /** 66 68 * constructor … … 230 232 * 231 233 */ 232 public MultiFetchServerObjectReader append(Collection<OsmPrimitive> primitives) { 234 public MultiFetchServerObjectReader append(Collection<? extends OsmPrimitive> primitives) { 233 235 if (primitives == null) return this; 234 236 for (OsmPrimitive primitive : primitives) { … … 363 365 for (long id : pkg) { 364 366 try { 367 progressMonitor.setCustomText(tr("Fetching {0} with id {1} from ''{2}''", type.getLocalizedDisplayNameSingular(), id, OsmApi.getOsmApi().getBaseUrl())); 365 368 singleGetId(type, id, progressMonitor); 366 369 } catch(OsmApiException e) { … … 394 397 */ 395 398 protected void fetchPrimitives(Set<Long> ids, OsmPrimitiveType type, ProgressMonitor progressMonitor) throws OsmTransferException{ 399 progressMonitor.setCustomText(tr("Fetching a package of {0} from ''{1}''", type.getLocalizedDisplayNameSingular(), OsmApi.getOsmApi().getBaseUrl())); 396 400 Set<Long> toFetch = new HashSet<Long>(ids); 397 401 toFetch.addAll(ids); 398 while(! toFetch.isEmpty()) { 402 while(! toFetch.isEmpty() && !isCanceled()) { 399 403 Set<Long> pkg = extractIdPackage(toFetch); 400 404 try { … … 435 439 try { 436 440 missingPrimitives = new HashSet<Long>(); 437 441 if (isCanceled())return null; 438 442 fetchPrimitives(nodes,OsmPrimitiveType.NODE, progressMonitor); 443 if (isCanceled())return null; 439 444 fetchPrimitives(ways,OsmPrimitiveType.WAY, progressMonitor); 445 if (isCanceled())return null; 440 446 fetchPrimitives(relations,OsmPrimitiveType.RELATION, progressMonitor); 441 447 return outputDataSet; -
trunk/src/org/openstreetmap/josm/io/OsmConnection.java
r1811 r1881 145 145 con.addRequestProperty("Authorization", "Basic "+Base64.encode(bytes)); 146 146 } 147 148 /** 149 * Replies true if this connection is canceled 150 * 151 * @return true if this connection is canceled 152 * @return 153 */ 154 public boolean isCanceled() { 155 return cancel; 156 } 147 157 } -
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r1814 r1881 329 329 for (Entry<OsmPrimitiveData, Collection<Long>> e : ways.entrySet()) { 330 330 Way w = new Way(e.getKey().id); 331 boolean failed= false;331 boolean incomplete = false; 332 332 for (long id : e.getValue()) { 333 333 Node n = findNode(id); 334 334 if (n == null) { 335 failed = true; 336 break; 335 n = new Node(id); 336 n.incomplete = true; 337 incomplete = true; 337 338 } 338 339 w.nodes.add(n); 339 340 } 340 if ( failed) {341 logger.warning(tr("marked way {0} incomplete because referred nodes aremissing in the loaded data", e.getKey().id));341 if (incomplete) { 342 logger.warning(tr("marked way {0} with {1} nodes incomplete because at least one node was missing in the loaded data and is therefore incomplete too", e.getKey().id, w.nodes.size())); 342 343 e.getKey().copyTo(w); 343 344 w.incomplete = true; 344 w.nodes.clear();345 345 ds.addPrimitive(w); 346 346 } else {
Note:
See TracChangeset
for help on using the changeset viewer.