Changeset 32982 in osm for applications/editors
- Timestamp:
- 2016-09-11T13:48:15+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java
r32981 r32982 116 116 } 117 117 if (MapillaryDownloader.getMode() == DOWNLOAD_MODE.OSM_AREA) { 118 MapillaryDownloader. automaticDownload();118 MapillaryDownloader.downloadOSMArea(); 119 119 } 120 120 if (MapillaryDownloader.getMode() == DOWNLOAD_MODE.VISIBLE_AREA) { … … 583 583 Main.error(e); 584 584 } 585 MapillaryDownloader. automaticDownload();585 MapillaryDownloader.downloadOSMArea(); 586 586 } 587 587 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryDownloadViewAction.java
r31787 r32982 36 36 @Override 37 37 public void actionPerformed(ActionEvent arg0) { 38 MapillaryDownloader. completeView();38 MapillaryDownloader.downloadVisibleArea(); 39 39 } 40 40 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryDownloader.java
r32979 r32982 122 122 123 123 private static void run(Runnable t) { 124 //threads.add(t);125 124 executor.execute(t); 126 125 } … … 129 128 * If some part of the current view has not been downloaded, it is downloaded. 130 129 */ 131 public static void completeView() {130 public static void downloadVisibleArea() { 132 131 if (getMode() != DOWNLOAD_MODE.VISIBLE_AREA && getMode() != DOWNLOAD_MODE.MANUAL_ONLY) { 133 132 throw new IllegalStateException("Download mode must be 'visible area' or 'manual only'"); … … 179 178 180 179 /** 181 * Downloads all images of the area covered by the OSM data. This is only just 182 * for automatic download. 183 */ 184 public static void automaticDownload() { 180 * Downloads all images of the area covered by the OSM data. 181 */ 182 public static void downloadOSMArea() { 185 183 if (Main.getLayerManager().getEditLayer() == null) { 186 184 return; 187 185 } 188 if (is AreaTooBig()) {189 tooBigErrorDialog();186 if (isOSMAreaTooBig()) { 187 showOSMAreaTooBigErrorDialog(); 190 188 return; 191 189 } … … 205 203 * and you will have to download areas manually. 206 204 */ 207 private static boolean is AreaTooBig() {205 private static boolean isOSMAreaTooBig() { 208 206 double area = Main.getLayerManager().getEditLayer().data.getDataSourceBounds().parallelStream().map(Bounds::getArea).reduce(0.0, Double::sum); 209 207 return area > MAX_AREA; 210 208 } 211 209 212 private static void tooBigErrorDialog() {210 private static void showOSMAreaTooBigErrorDialog() { 213 211 if (SwingUtilities.isEventDispatchThread()) { 214 212 MapillaryLayer.getInstance().tempSemiautomatic = true; … … 217 215 .showMessageDialog( 218 216 Main.parent, 219 I18n.tr("The downloaded OSM area is too big. Download mode has been changed to semiautomaticuntil the layer is restarted."));217 I18n.tr("The downloaded OSM area is too big. Download mode has been changed to OSM area until the layer is restarted.")); 220 218 } else { 221 SwingUtilities.invokeLater(MapillaryDownloader:: tooBigErrorDialog);219 SwingUtilities.invokeLater(MapillaryDownloader::showOSMAreaTooBigErrorDialog); 222 220 } 223 221 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/AbstractMode.java
r32980 r32982 92 92 && Calendar.getInstance().getTimeInMillis() - this.lastDownload >= DOWNLOAD_COOLDOWN) { 93 93 this.lastDownload = Calendar.getInstance().getTimeInMillis(); 94 MapillaryDownloader. completeView();94 MapillaryDownloader.downloadVisibleArea(); 95 95 this.moved = false; 96 96 MapillaryData.dataUpdated();
Note:
See TracChangeset
for help on using the changeset viewer.