Changeset 32982 in osm for applications/editors


Ignore:
Timestamp:
2016-09-11T13:48:15+02:00 (8 years ago)
Author:
nokutu
Message:

Changed some method's names in MapillaryDownloader for clarity

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  
    116116      }
    117117      if (MapillaryDownloader.getMode() == DOWNLOAD_MODE.OSM_AREA) {
    118         MapillaryDownloader.automaticDownload();
     118        MapillaryDownloader.downloadOSMArea();
    119119      }
    120120      if (MapillaryDownloader.getMode() == DOWNLOAD_MODE.VISIBLE_AREA) {
     
    583583        Main.error(e);
    584584      }
    585       MapillaryDownloader.automaticDownload();
     585      MapillaryDownloader.downloadOSMArea();
    586586    }
    587587  }
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryDownloadViewAction.java

    r31787 r32982  
    3636  @Override
    3737  public void actionPerformed(ActionEvent arg0) {
    38     MapillaryDownloader.completeView();
     38    MapillaryDownloader.downloadVisibleArea();
    3939  }
    4040}
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryDownloader.java

    r32979 r32982  
    122122
    123123  private static void run(Runnable t) {
    124     //threads.add(t);
    125124    executor.execute(t);
    126125  }
     
    129128   * If some part of the current view has not been downloaded, it is downloaded.
    130129   */
    131   public static void completeView() {
     130  public static void downloadVisibleArea() {
    132131    if (getMode() != DOWNLOAD_MODE.VISIBLE_AREA && getMode() != DOWNLOAD_MODE.MANUAL_ONLY) {
    133132      throw new IllegalStateException("Download mode must be 'visible area' or 'manual only'");
     
    179178
    180179  /**
    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() {
    185183    if (Main.getLayerManager().getEditLayer() == null) {
    186184      return;
    187185    }
    188     if (isAreaTooBig()) {
    189       tooBigErrorDialog();
     186    if (isOSMAreaTooBig()) {
     187      showOSMAreaTooBigErrorDialog();
    190188      return;
    191189    }
     
    205203   * and you will have to download areas manually.
    206204   */
    207   private static boolean isAreaTooBig() {
     205  private static boolean isOSMAreaTooBig() {
    208206    double area = Main.getLayerManager().getEditLayer().data.getDataSourceBounds().parallelStream().map(Bounds::getArea).reduce(0.0, Double::sum);
    209207    return area > MAX_AREA;
    210208  }
    211209
    212   private static void tooBigErrorDialog() {
     210  private static void showOSMAreaTooBigErrorDialog() {
    213211    if (SwingUtilities.isEventDispatchThread()) {
    214212      MapillaryLayer.getInstance().tempSemiautomatic = true;
     
    217215        .showMessageDialog(
    218216          Main.parent,
    219           I18n.tr("The downloaded OSM area is too big. Download mode has been changed to semiautomatic until 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."));
    220218    } else {
    221       SwingUtilities.invokeLater(MapillaryDownloader::tooBigErrorDialog);
     219      SwingUtilities.invokeLater(MapillaryDownloader::showOSMAreaTooBigErrorDialog);
    222220    }
    223221  }
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/AbstractMode.java

    r32980 r32982  
    9292          && Calendar.getInstance().getTimeInMillis() - this.lastDownload >= DOWNLOAD_COOLDOWN) {
    9393          this.lastDownload = Calendar.getInstance().getTimeInMillis();
    94           MapillaryDownloader.completeView();
     94          MapillaryDownloader.downloadVisibleArea();
    9595          this.moved = false;
    9696          MapillaryData.dataUpdated();
Note: See TracChangeset for help on using the changeset viewer.