Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java	(revision 31816)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java	(revision 31826)
@@ -50,4 +50,32 @@
 
   /**
+   * Adds an MapillaryImage to the object, and then repaints mapView.
+   *
+   * @param image
+   *          The image to be added.
+   */
+  public synchronized void add(MapillaryAbstractImage image) {
+    add(image, true);
+  }
+
+  /**
+   * Adds a MapillaryImage to the object, but doesn't repaint mapView. This is
+   * needed for concurrency.
+   *
+   * @param image
+   *          The image to be added.
+   * @param update
+   *          Whether the map must be updated or not.
+   */
+  public synchronized void add(MapillaryAbstractImage image, boolean update) {
+    if (!this.images.contains(image)) {
+      this.images.add(image);
+    }
+    if (update)
+      dataUpdated();
+    fireImagesAdded();
+  }
+
+  /**
    * Adds a set of MapillaryImages to the object, and then repaints mapView.
    *
@@ -60,11 +88,61 @@
 
   /**
-   * Adds an MapillaryImage to the object, and then repaints mapView.
-   *
-   * @param image
-   *          The image to be added.
-   */
-  public synchronized void add(MapillaryAbstractImage image) {
-    add(image, true);
+   * Adds a set of {link MapillaryAbstractImage} objects to this object.
+   *
+   * @param images
+   *          The set of images to be added.
+   * @param update
+   *          Whether the map must be updated or not.
+   */
+  public synchronized void add(List<MapillaryAbstractImage> images, boolean update) {
+    for (MapillaryAbstractImage image : images) {
+      add(image, update);
+    }
+  }
+
+  /**
+   * Adds a new listener.
+   *
+   * @param lis
+   *          Listener to be added.
+   */
+  public void addListener(MapillaryDataListener lis) {
+    this.listeners.add(lis);
+  }
+
+  /**
+   * Adds a {@link MapillaryImage} object to the list of selected images, (when
+   * ctrl + click)
+   *
+   * @param image
+   *          The {@link MapillaryImage} object to be added.
+   */
+  public void addMultiSelectedImage(MapillaryAbstractImage image) {
+    if (!this.multiSelectedImages.contains(image)) {
+      if (this.getSelectedImage() != null)
+        this.multiSelectedImages.add(image);
+      else
+        this.setSelectedImage(image);
+    }
+    if (Main.main != null)
+      Main.map.mapView.repaint();
+  }
+
+  /**
+   * Adds a set of {@code MapillaryAbstractImage} objects to the list of
+   * selected images.
+   *
+   * @param images
+   *          A List object containing the set of images to be added.
+   */
+  public void addMultiSelectedImage(List<MapillaryAbstractImage> images) {
+    for (MapillaryAbstractImage image : images)
+      if (!this.multiSelectedImages.contains(image)) {
+        if (this.getSelectedImage() != null)
+          this.multiSelectedImages.add(image);
+        else
+          this.setSelectedImage(image);
+      }
+    Main.map.mapView.repaint();
   }
 
@@ -103,14 +181,4 @@
 
   /**
-   * Adds a new listener.
-   *
-   * @param lis
-   *          Listener to be added.
-   */
-  public void addListener(MapillaryDataListener lis) {
-    this.listeners.add(lis);
-  }
-
-  /**
    * Removes a listener.
    *
@@ -123,19 +191,4 @@
 
   /**
-   * Adds a set of {link MapillaryAbstractImage} objects to this object.
-   *
-   * @param images
-   *          The set of images to be added.
-   * @param update
-   *          Whether the map must be updated or not.
-   */
-  public synchronized void add(List<MapillaryAbstractImage> images,
-      boolean update) {
-    for (MapillaryAbstractImage image : images) {
-      add(image, update);
-    }
-  }
-
-  /**
    * Highlights the image under the cursor.
    *
@@ -154,22 +207,4 @@
   public MapillaryAbstractImage getHighlightedImage() {
     return this.highlightedImage;
-  }
-
-  /**
-   * Adds a MapillaryImage to the object, but doesn't repaint mapView. This is
-   * needed for concurrency.
-   *
-   * @param image
-   *          The image to be added.
-   * @param update
-   *          Whether the map must be updated or not.
-   */
-  public synchronized void add(MapillaryAbstractImage image, boolean update) {
-    if (!this.images.contains(image)) {
-      this.images.add(image);
-    }
-    if (update)
-      dataUpdated();
-    fireImagesAdded();
   }
 
@@ -343,40 +378,4 @@
 
   /**
-   * Adds a {@link MapillaryImage} object to the list of selected images, (when
-   * ctrl + click)
-   *
-   * @param image
-   *          The {@link MapillaryImage} object to be added.
-   */
-  public void addMultiSelectedImage(MapillaryAbstractImage image) {
-    if (!this.multiSelectedImages.contains(image)) {
-      if (this.getSelectedImage() != null)
-        this.multiSelectedImages.add(image);
-      else
-        this.setSelectedImage(image);
-    }
-    if (Main.main != null)
-      Main.map.mapView.repaint();
-  }
-
-  /**
-   * Adds a set of {@code MapillaryAbstractImage} objects to the list of
-   * selected images.
-   *
-   * @param images
-   *          A List object containing the set of images to be added.
-   */
-  public void addMultiSelectedImage(List<MapillaryAbstractImage> images) {
-    for (MapillaryAbstractImage image : images)
-      if (!this.multiSelectedImages.contains(image)) {
-        if (this.getSelectedImage() != null)
-          this.multiSelectedImages.add(image);
-        else
-          this.setSelectedImage(image);
-      }
-    Main.map.mapView.repaint();
-  }
-
-  /**
    * Returns a List containing all {@code MapillaryAbstractImage} objects
    * selected with ctrl + click.
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillarySequence.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillarySequence.java	(revision 31816)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillarySequence.java	(revision 31826)
@@ -43,26 +43,4 @@
 
   /**
-   * Returns all {@link MapillaryAbstractImage} objects contained by this
-   * object.
-   *
-   * @return A {@link List} object containing all the
-   *         {@link MapillaryAbstractImage} objects that are part of the
-   *         sequence.
-   */
-  public List<MapillaryAbstractImage> getImages() {
-    return this.images;
-  }
-
-  /**
-   * Returns the Epoch time when the sequence was captured.
-   *
-   * @return A long containing the Epoch time when the sequence was captured.
-   *
-   */
-  public long getCreatedAt() {
-    return this.createdAt;
-  }
-
-  /**
    * Adds a new {@link MapillaryAbstractImage} object to the database.
    *
@@ -72,15 +50,4 @@
   public synchronized void add(MapillaryAbstractImage image) {
     this.images.add(image);
-  }
-
-  /**
-   * Returns the unique identifier of the sequence.
-   *
-   * @return A {@code String} containing the unique identifier of the sequence.
-   *         null means that the sequence has been created locally for imported
-   *         images.
-   */
-  public String getKey() {
-    return this.key;
   }
 
@@ -97,11 +64,34 @@
 
   /**
-   * Removes a {@link MapillaryAbstractImage} object from the database.
+   * Returns the Epoch time when the sequence was captured.
    *
-   * @param image
-   *          The {@link MapillaryAbstractImage} object to be removed.
+   * @return A long containing the Epoch time when the sequence was captured.
+   *
    */
-  public void remove(MapillaryAbstractImage image) {
-    this.images.remove(image);
+  public long getCreatedAt() {
+    return this.createdAt;
+  }
+
+  /**
+   * Returns all {@link MapillaryAbstractImage} objects contained by this
+   * object.
+   *
+   * @return A {@link List} object containing all the
+   *         {@link MapillaryAbstractImage} objects that are part of the
+   *         sequence.
+   */
+  public List<MapillaryAbstractImage> getImages() {
+    return this.images;
+  }
+
+  /**
+   * Returns the unique identifier of the sequence.
+   *
+   * @return A {@code String} containing the unique identifier of the sequence.
+   *         null means that the sequence has been created locally for imported
+   *         images.
+   */
+  public String getKey() {
+    return this.key;
   }
 
@@ -147,3 +137,13 @@
     return this.images.get(i - 1);
   }
+
+  /**
+   * Removes a {@link MapillaryAbstractImage} object from the database.
+   *
+   * @param image
+   *          The {@link MapillaryAbstractImage} object to be removed.
+   */
+  public void remove(MapillaryAbstractImage image) {
+    this.images.remove(image);
+  }
 }
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryDownloader.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryDownloader.java	(revision 31816)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryDownloader.java	(revision 31826)
@@ -62,62 +62,4 @@
   }
 
-  private static void run(Thread t) {
-    threads.add(t);
-    EXECUTOR.execute(t);
-  }
-
-  /**
-   * If some part of the current view has not been downloaded, it is downloaded.
-   */
-  public static void completeView() {
-    if (getMode() != MODES.Semiautomatic && getMode() != MODES.Manual)
-      throw new IllegalStateException("Must be in semiautomatic or manual mode");
-    Bounds view = Main.map.mapView.getRealBounds();
-    if (view.getArea() > MAX_AREA)
-      return;
-    if (isViewDownloaded(view))
-      return;
-    MapillaryLayer.getInstance().getData().bounds.add(view);
-    getImages(view);
-  }
-
-  private static boolean isViewDownloaded(Bounds view) {
-    int n = 15;
-    boolean[][] inside = new boolean[n][n];
-    for (int i = 0; i < n; i++) {
-      for (int j = 0; j < n; j++) {
-        if (isInBounds(new LatLon(view.getMinLat()
-            + (view.getMaxLat() - view.getMinLat()) * ((double) i / n),
-            view.getMinLon() + (view.getMaxLon() - view.getMinLon())
-                * ((double) j / n)))) {
-          inside[i][j] = true;
-        }
-      }
-    }
-    for (int i = 0; i < n; i++) {
-      for (int j = 0; j < n; j++) {
-        if (!inside[i][j])
-          return false;
-      }
-    }
-    return true;
-  }
-
-  /**
-   * Checks if the given {@link LatLon} object lies inside the bounds of the
-   * image.
-   *
-   * @param latlon
-   *          The coordinates to check.
-   * @return true if it lies inside the bounds; false otherwise;
-   */
-  private static boolean isInBounds(LatLon latlon) {
-    for (Bounds bounds : MapillaryLayer.getInstance().getData().bounds) {
-      if (bounds.contains(latlon))
-        return true;
-    }
-    return false;
-  }
-
   /**
    * Gets the images within the given bounds.
@@ -128,44 +70,4 @@
   public static void getImages(Bounds bounds) {
     getImages(bounds.getMin(), bounds.getMax());
-  }
-
-  /**
-   * Downloads all images of the area covered by the OSM data. This is only just
-   * for automatic download.
-   */
-  public static void automaticDownload() {
-    MapillaryLayer layer = MapillaryLayer.getInstance();
-    if (Main.map.mapView.getEditLayer() == null)
-      return;
-    if (isAreaTooBig()) {
-      tooBigErrorDialog();
-      return;
-    }
-    if (getMode() != MODES.Automatic)
-      throw new IllegalStateException("Must be in automatic mode.");
-    for (Bounds bounds : Main.map.mapView.getEditLayer().data
-        .getDataSourceBounds()) {
-      if (!layer.getData().bounds.contains(bounds)) {
-        layer.getData().bounds.add(bounds);
-        MapillaryDownloader.getImages(bounds.getMin(), bounds.getMax());
-      }
-    }
-  }
-
-  /**
-   * Checks if the area of the OSM data is too big. This means that probably
-   * lots of Mapillary images are going to be downloaded, slowing down the
-   * program too much. To solve this the automatic is stopped, an alert is shown
-   * and you will have to download areas manually.
-   */
-  private static boolean isAreaTooBig() {
-    double area = 0;
-    for (Bounds bounds : Main.map.mapView.getEditLayer().data
-        .getDataSourceBounds()) {
-      area += bounds.getArea();
-    }
-    if (area > MAX_AREA)
-      return true;
-    return false;
   }
 
@@ -190,5 +92,103 @@
   }
 
-  private static void tooBigErrorDialog() {
+  private static void run(Thread t) {
+    threads.add(t);
+    EXECUTOR.execute(t);
+  }
+
+  /**
+   * If some part of the current view has not been downloaded, it is downloaded.
+   */
+  public static void completeView() {
+    if (getMode() != MODES.Semiautomatic && getMode() != MODES.Manual)
+      throw new IllegalStateException("Must be in semiautomatic or manual mode");
+    Bounds view = Main.map.mapView.getRealBounds();
+    if (view.getArea() > MAX_AREA)
+      return;
+    if (isViewDownloaded(view))
+      return;
+    MapillaryLayer.getInstance().getData().bounds.add(view);
+    getImages(view);
+  }
+
+  private static boolean isViewDownloaded(Bounds view) {
+    int n = 15;
+    boolean[][] inside = new boolean[n][n];
+    for (int i = 0; i < n; i++) {
+      for (int j = 0; j < n; j++) {
+        if (isInBounds(new LatLon(view.getMinLat()
+            + (view.getMaxLat() - view.getMinLat()) * ((double) i / n),
+            view.getMinLon() + (view.getMaxLon() - view.getMinLon())
+                * ((double) j / n)))) {
+          inside[i][j] = true;
+        }
+      }
+    }
+    for (int i = 0; i < n; i++) {
+      for (int j = 0; j < n; j++) {
+        if (!inside[i][j])
+          return false;
+      }
+    }
+    return true;
+  }
+
+  /**
+   * Checks if the given {@link LatLon} object lies inside the bounds of the
+   * image.
+   *
+   * @param latlon
+   *          The coordinates to check.
+   * @return true if it lies inside the bounds; false otherwise;
+   */
+  private static boolean isInBounds(LatLon latlon) {
+    for (Bounds bounds : MapillaryLayer.getInstance().getData().bounds) {
+      if (bounds.contains(latlon))
+        return true;
+    }
+    return false;
+  }
+
+  /**
+   * Downloads all images of the area covered by the OSM data. This is only just
+   * for automatic download.
+   */
+  public static void automaticDownload() {
+    MapillaryLayer layer = MapillaryLayer.getInstance();
+    if (Main.map.mapView.getEditLayer() == null)
+      return;
+    if (isAreaTooBig()) {
+      tooBigErrorDialog();
+      return;
+    }
+    if (getMode() != MODES.Automatic)
+      throw new IllegalStateException("Must be in automatic mode.");
+    for (Bounds bounds : Main.map.mapView.getEditLayer().data
+        .getDataSourceBounds()) {
+      if (!layer.getData().bounds.contains(bounds)) {
+        layer.getData().bounds.add(bounds);
+        MapillaryDownloader.getImages(bounds.getMin(), bounds.getMax());
+      }
+    }
+  }
+
+  /**
+   * Checks if the area of the OSM data is too big. This means that probably
+   * lots of Mapillary images are going to be downloaded, slowing down the
+   * program too much. To solve this the automatic is stopped, an alert is shown
+   * and you will have to download areas manually.
+   */
+  private static boolean isAreaTooBig() {
+    double area = 0;
+    for (Bounds bounds : Main.map.mapView.getEditLayer().data
+        .getDataSourceBounds()) {
+      area += bounds.getArea();
+    }
+    if (area > MAX_AREA)
+      return true;
+    return false;
+  }
+
+  protected static void tooBigErrorDialog() {
     if (!SwingUtilities.isEventDispatchThread()) {
       SwingUtilities.invokeLater(new Runnable() {
