Changeset 2569 in josm for trunk/src/org/openstreetmap/josm/gui/io/UploadLayerTask.java
- Timestamp:
- 2009-12-04T15:53:55+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/io/UploadLayerTask.java
r2512 r2569 44 44 private Collection<OsmPrimitive> toUpload; 45 45 private HashSet<OsmPrimitive> processedPrimitives; 46 private UploadStrategySpecification strategy; 46 47 47 48 /** 48 * 49 * Creates the upload task 50 * 51 * @param strategy the upload strategy specification 49 52 * @param layer the layer. Must not be null. 50 53 * @param monitor a progress monitor. If monitor is null, uses {@see NullProgressMonitor#INSTANCE} … … 52 55 * @param closeChangesetAfterUpload true, if the changeset should be closed after the upload 53 56 * @throws IllegalArgumentException thrown, if layer is null 57 * @throws IllegalArgumentException thrown if strategy is null 54 58 */ 55 public UploadLayerTask( OsmDataLayer layer, ProgressMonitor monitor, Changeset changeset, boolean closeChangesetAfterUpload) {59 public UploadLayerTask(UploadStrategySpecification strategy, OsmDataLayer layer, ProgressMonitor monitor, Changeset changeset, boolean closeChangesetAfterUpload) { 56 60 if (layer == null) 57 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", layer)); 61 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer")); 62 if (strategy == null) 63 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "strategy")); 58 64 if (monitor == null) { 59 65 monitor = NullProgressMonitor.INSTANCE; … … 62 68 this.monitor = monitor; 63 69 this.changeset = changeset; 70 this.strategy = strategy; 64 71 this.closeChangesetAfterUpload = closeChangesetAfterUpload; 65 72 processedPrimitives = new HashSet<OsmPrimitive>(); … … 103 110 @Override 104 111 public void run() { 105 monitor. subTask(tr("Preparing primitives to upload ..."));112 monitor.indeterminateSubTask(tr("Preparing primitives to upload ...")); 106 113 APIDataSet ds = new APIDataSet(layer.data); 107 114 try { … … 120 127 ProgressMonitor m = monitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false); 121 128 if (isCancelled()) return; 122 writer.uploadOsm( layer.data.getVersion(), toUpload, changeset, m);129 writer.uploadOsm(strategy, toUpload, changeset, m); 123 130 processedPrimitives.addAll(writer.getProcessedPrimitives()); 124 131 break;
Note:
See TracChangeset
for help on using the changeset viewer.