Changeset 32658 in osm for applications/editors/josm


Ignore:
Timestamp:
2016-07-15T15:25:10+02:00 (8 years ago)
Author:
floscher
Message:

[mapillary] Fix some more minor issues

Location:
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryDownloader.java

    r32652 r32658  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.plugins.mapillary.io.download;
    3 
    4 import static org.openstreetmap.josm.tools.I18n.tr;
    53
    64import java.util.ArrayList;
     
    3836    private String label;
    3937
    40     private DOWNLOAD_MODE(String prefId, String label) {
     38    DOWNLOAD_MODE(String prefId, String label) {
    4139      this.prefId = prefId;
    4240      this.label = label;
     
    6361      return getDefault();
    6462    }
     63
    6564    public static DOWNLOAD_MODE fromLabel(String label) {
    6665      if (MANUAL_ONLY.getLabel().equals(label)) {
     
    197196   */
    198197  public static void automaticDownload() {
    199     MapillaryLayer layer = MapillaryLayer.getInstance();
    200     if (Main.getLayerManager().getEditLayer() == null)
    201       return;
     198    if (Main.getLayerManager().getEditLayer() == null) {
     199      return;
     200    }
    202201    if (isAreaTooBig()) {
    203202      tooBigErrorDialog();
    204203      return;
    205204    }
    206     if (getMode() != DOWNLOAD_MODE.OSM_AREA)
     205    if (getMode() != DOWNLOAD_MODE.OSM_AREA) {
    207206      throw new IllegalStateException("Must be in automatic mode.");
    208     for (Bounds bounds : Main.getLayerManager().getEditLayer().data
    209         .getDataSourceBounds()) {
    210       if (!layer.getData().getBounds().contains(bounds)) {
    211         layer.getData().getBounds().add(bounds);
     207    }
     208    for (Bounds bounds : Main.getLayerManager().getEditLayer().data.getDataSourceBounds()) {
     209      if (!MapillaryLayer.getInstance().getData().getBounds().contains(bounds)) {
     210        MapillaryLayer.getInstance().getData().getBounds().add(bounds);
    212211        MapillaryDownloader.getImages(bounds.getMin(), bounds.getMax());
    213212      }
     
    236235          .showMessageDialog(
    237236              Main.parent,
    238               tr("The downloaded OSM area is too big. Download mode has been changed to semiautomatic until the layer is restarted."));
     237              I18n.tr("The downloaded OSM area is too big. Download mode has been changed to semiautomatic until the layer is restarted."));
    239238    } else {
    240239      SwingUtilities.invokeLater( new Runnable() {
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/SelectMode.java

    r32589 r32658  
    3333 */
    3434public class SelectMode extends AbstractMode {
    35   private Point start;
    3635  private MapillaryAbstractImage closest;
    3736  private MapillaryAbstractImage lastClicked;
     
    6766      }
    6867    }
    69     this.start = e.getPoint();
    7068    this.lastClicked = this.closest;
    7169    this.closest = closest;
     
    109107        for (MapillaryAbstractImage img : data.getMultiSelectedImages()) {
    110108          if (Main.pref.getBoolean("mapillary.developer") || !(img instanceof MapillaryImage)) {
    111             img.turn(Math.toDegrees(Math.atan2((e.getX() - highlightImgPoint.getX()), -(e.getY() - highlightImgPoint.getY()))) - highlightImg.getTempCa());
     109            img.turn(Math.toDegrees(Math.atan2(e.getX() - highlightImgPoint.getX(), -e.getY() + highlightImgPoint.getY())) - highlightImg.getTempCa());
    112110          }
    113111        }
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/PluginState.java

    r32575 r32658  
    111111      dlg.setVisible(true);
    112112    } else {
    113       SwingUtilities.invokeLater( new Runnable() {
     113      SwingUtilities.invokeLater(new Runnable() {
    114114        @Override
    115115        public void run() {
    116116          finishedUploadDialog();
    117117        }
    118       } );
     118      });
    119119    }
    120120  }
     121
    121122  public static void notLoggedInToMapillaryDialog() {
    122123    if (Main.main == null) {
Note: See TracChangeset for help on using the changeset viewer.