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 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java	(revision 31401)
@@ -58,5 +58,5 @@
    *
    * @param images
-   *        The set of images to be added.
+   *          The set of images to be added.
    */
   public synchronized void add(List<MapillaryAbstractImage> images) {
@@ -70,5 +70,5 @@
    *
    * @param image
-   *        The image to be added.
+   *          The image to be added.
    */
   public synchronized void add(MapillaryAbstractImage image) {
@@ -83,5 +83,6 @@
    * Adds a new listener.
    *
-   * @param lis Listener to be added.
+   * @param lis
+   *          Listener to be added.
    */
   public void addListener(MapillaryDataListener lis) {
@@ -92,5 +93,6 @@
    * Removes a listener.
    *
-   * @param lis Listener to be removed.
+   * @param lis
+   *          Listener to be removed.
    */
   public void removeListener(MapillaryDataListener lis) {
@@ -103,5 +105,5 @@
    *
    * @param images
-   *        The set of images to be added.
+   *          The set of images to be added.
    */
   public synchronized void addWithoutUpdate(List<MapillaryAbstractImage> images) {
@@ -115,5 +117,5 @@
    *
    * @param image
-   *        The image under the cursor.
+   *          The image under the cursor.
    */
   public void setHighlightedImage(MapillaryAbstractImage image) {
@@ -135,5 +137,5 @@
    *
    * @param image
-   *        The image to be added.
+   *          The image to be added.
    */
   public synchronized void addWithoutUpdate(MapillaryAbstractImage image) {
@@ -191,5 +193,6 @@
       tempImage = tempImage.next();
       if (tempImage.isVisible()) {
-        setSelectedImage(tempImage, Main.pref.getBoolean("mapillary.move-to-picture", true));
+        setSelectedImage(tempImage,
+            Main.pref.getBoolean("mapillary.move-to-picture", true));
         break;
       }
@@ -211,5 +214,6 @@
       tempImage = tempImage.previous();
       if (tempImage.isVisible()) {
-        setSelectedImage(tempImage, Main.pref.getBoolean("mapillary.move-to-picture", true));
+        setSelectedImage(tempImage,
+            Main.pref.getBoolean("mapillary.move-to-picture", true));
         break;
       }
@@ -221,5 +225,5 @@
    *
    * @param image
-   *        The MapillaryImage which is going to be selected
+   *          The MapillaryImage which is going to be selected
    */
   public void setSelectedImage(MapillaryAbstractImage image) {
@@ -228,11 +232,11 @@
 
   /**
-   * Selects a new image.If the user does ctrl+click, this isn't triggered.
-   * You can choose whether to center the view on the new image or not.
-   *
-   * @param image
-   *        The {@link MapillaryImage} which is going to be selected.
+   * Selects a new image.If the user does ctrl+click, this isn't triggered. You
+   * can choose whether to center the view on the new image or not.
+   *
+   * @param image
+   *          The {@link MapillaryImage} which is going to be selected.
    * @param zoom
-   *        True if the view must be centered on the image; false otherwise.
+   *          True if the view must be centered on the image; false otherwise.
    */
   public void setSelectedImage(MapillaryAbstractImage image, boolean zoom) {
@@ -251,17 +255,20 @@
         // Downloading thumbnails of surrounding pictures.
         if (mapillaryImage.next() != null) {
-          Utils.downloadPicture(mapillaryImage.next());
+          Utils.downloadPicture((MapillaryImage) mapillaryImage.next());
           if (mapillaryImage.next().next() != null)
-            Utils.downloadPicture(mapillaryImage.next().next());
+            Utils
+                .downloadPicture((MapillaryImage) mapillaryImage.next().next());
         }
         if (mapillaryImage.previous() != null) {
-          Utils.downloadPicture(mapillaryImage.previous());
+          Utils.downloadPicture((MapillaryImage) mapillaryImage.previous());
           if (mapillaryImage.previous().previous() != null)
-            Utils.downloadPicture(mapillaryImage.previous().previous());
+            Utils.downloadPicture((MapillaryImage) mapillaryImage.previous()
+                .previous());
         }
       }
     }
     if (zoom)
-      Main.map.mapView.zoomTo(MapillaryData.getInstance().getSelectedImage().getLatLon());
+      Main.map.mapView.zoomTo(MapillaryData.getInstance().getSelectedImage()
+          .getLatLon());
     if (Main.map != null)
       Main.map.mapView.repaint();
@@ -269,5 +276,6 @@
   }
 
-  private void fireSelectedImageChanged(MapillaryAbstractImage oldImage, MapillaryAbstractImage newImage) {
+  private void fireSelectedImageChanged(MapillaryAbstractImage oldImage,
+      MapillaryAbstractImage newImage) {
     if (listeners.isEmpty())
       return;
@@ -281,5 +289,5 @@
    *
    * @param image
-   *        The MapillaryImage object to be added.
+   *          The MapillaryImage object to be added.
    */
   public void addMultiSelectedImage(MapillaryAbstractImage image) {
@@ -298,5 +306,5 @@
    *
    * @param images
-   *        A List object containing the set of images to be added.
+   *          A List object containing the set of images to be added.
    */
   public void addMultiSelectedImage(List<MapillaryAbstractImage> images) {
@@ -313,5 +321,5 @@
   /**
    * Returns a List containing all {@code MapillaryAbstractImage} objects
-   * selected with ctrl + click
+   * selected with ctrl + click.
    *
    * @return A List object containing all the images selected.
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryDataListener.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryDataListener.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryDataListener.java	(revision 31401)
@@ -18,6 +18,8 @@
    * manually clicking on the icon.
    *
-   * @param oldImage Old selected {@link MapillaryAbstractImage}
-   * @param newImage New selected {@link MapillaryAbstractImage}
+   * @param oldImage
+   *          Old selected {@link MapillaryAbstractImage}
+   * @param newImage
+   *          New selected {@link MapillaryAbstractImage}
    */
   public void selectedImageChanged(MapillaryAbstractImage oldImage,
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImage.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImage.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImage.java	(revision 31401)
@@ -98,5 +98,6 @@
    * Returns the username of the person who took the picture.
    *
-   * @return A String containing the username of the person who took the picture.
+   * @return A String containing the username of the person who took the
+   *         picture.
    */
   public String getUser() {
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java	(revision 31401)
@@ -4,5 +4,4 @@
 import static org.openstreetmap.josm.tools.I18n.marktr;
 
-import org.openstreetmap.josm.plugins.mapillary.actions.MapillaryDownloadViewAction;
 import org.openstreetmap.josm.plugins.mapillary.cache.Utils;
 import org.openstreetmap.josm.plugins.mapillary.downloads.MapillaryDownloader;
@@ -52,5 +51,4 @@
 import javax.swing.Action;
 import javax.swing.Icon;
-import javax.swing.JOptionPane;
 
 import java.util.List;
@@ -71,5 +69,5 @@
       "mapillary.sequence-max-jump-distance", 100);
 
-  /** If the download is in manual mode during the rest of the session */
+  /** If the download is in semiautomatic during this object lifetime. */
   public boolean TEMP_SEMIAUTOMATIC = false;
 
@@ -82,5 +80,5 @@
 
   /** {@link MapillaryData} object that stores the database */
-  public final MapillaryData data = MapillaryData.getInstance();
+  public final MapillaryData data;
 
   /** The bounds of the areas for which the pictures have been downloaded */
@@ -99,4 +97,5 @@
   private MapillaryLayer() {
     super(tr("Mapillary Images"));
+    data = MapillaryData.getInstance();
     bounds = new ArrayList<>();
     init();
@@ -158,45 +157,4 @@
 
   /**
-   * Downloads all images of the area covered by the OSM data. This is only just
-   * for automatic download.
-   */
-  public void download() {
-    checkAreaTooBig();
-    if (!Main.pref.get("mapillary.download-mode").equals(
-        MapillaryDownloader.MODES[0])
-        || TEMP_SEMIAUTOMATIC)
-      return;
-    for (Bounds bounds : Main.map.mapView.getEditLayer().data
-        .getDataSourceBounds()) {
-      if (!this.bounds.contains(bounds)) {
-        this.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 void checkAreaTooBig() {
-    double area = 0;
-    for (Bounds bounds : Main.map.mapView.getEditLayer().data
-        .getDataSourceBounds()) {
-      area += bounds.getArea();
-    }
-    if (area > MapillaryDownloadViewAction.MAX_AREA) {
-      TEMP_SEMIAUTOMATIC = true;
-      MapillaryPlugin.setMenuEnabled(MapillaryPlugin.DOWNLOAD_VIEW_MENU, true);
-      JOptionPane
-          .showMessageDialog(
-              Main.parent,
-              tr("The downloaded OSM area is too big. Download mode has been changed to manual until the layer is restarted."));
-    }
-  }
-
-  /**
    * Returns the {@link MapillaryData} object, which acts as the database of the
    * Layer.
@@ -208,7 +166,4 @@
   }
 
-  /**
-   * Method invoked when the layer is destroyed.
-   */
   @Override
   public void destroy() {
@@ -566,5 +521,5 @@
         Main.error(e);
       }
-      MapillaryLayer.getInstance().download();
+      MapillaryDownloader.automaticDownload();
     }
   }
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryTrafficSignLayer.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryTrafficSignLayer.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryTrafficSignLayer.java	(revision 31401)
@@ -33,8 +33,10 @@
   /**
    * Returns and when needed instantiates the Mapillary traffic sign layer.
+   * 
    * @return the only instance of the traffic sign layer
    */
   public static MapillaryTrafficSignLayer getInstance() {
-    return instance == null ? (instance = new MapillaryTrafficSignLayer()) : instance;
+    return instance == null ? (instance = new MapillaryTrafficSignLayer())
+        : instance;
   }
 
@@ -48,4 +50,5 @@
   /*
    * (non-Javadoc)
+   * 
    * @see org.openstreetmap.josm.gui.layer.AbstractModifiableLayer#isModified()
    */
@@ -57,12 +60,15 @@
   /*
    * (non-Javadoc)
-   * @see org.openstreetmap.josm.gui.layer.Layer#paint(java.awt.Graphics2D, org.openstreetmap.josm.gui.MapView,
-   * org.openstreetmap.josm.data.Bounds)
+   * 
+   * @see org.openstreetmap.josm.gui.layer.Layer#paint(java.awt.Graphics2D,
+   * org.openstreetmap.josm.gui.MapView, org.openstreetmap.josm.data.Bounds)
    */
   @Override
   public void paint(Graphics2D g, MapView mv, Bounds box) {
-    g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+    g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+        RenderingHints.VALUE_ANTIALIAS_ON);
     try {
-      g.setFont(Font.createFont(Font.TRUETYPE_FONT, new File("data/fonts/traffico/traffico.ttf")).deriveFont(50.0f));
+      g.setFont(Font.createFont(Font.TRUETYPE_FONT,
+          new File("data/fonts/traffico/traffico.ttf")).deriveFont(50.0f));
     } catch (FontFormatException e) {
       e.printStackTrace();
@@ -76,5 +82,8 @@
     points[2] = mv.getPoint(new LatLon(49.01038, 8.40636));
 
-    TrafficoSignElement[][] signs = { TrafficoSign.getSign("europe", "mandatory_cycle_track"), TrafficoSign.getSign("de", "information_bus_stop"), TrafficoSign.getSign("europe", "information_pedestrian_crossing") };
+    TrafficoSignElement[][] signs = {
+        TrafficoSign.getSign("europe", "mandatory_cycle_track"),
+        TrafficoSign.getSign("de", "information_bus_stop"),
+        TrafficoSign.getSign("europe", "information_pedestrian_crossing") };
 
     for (int i = 0; i < signs.length && i < points.length; i++) {
@@ -87,10 +96,13 @@
     // Start iterating the images
     g.setColor(Color.MAGENTA);
-    for (MapillaryAbstractImage img : MapillaryLayer.getInstance().getMapillaryData().getImages()) {
+    for (MapillaryAbstractImage img : MapillaryLayer.getInstance()
+        .getMapillaryData().getImages()) {
       if (img instanceof MapillaryImage) {
-        g.fillOval(mv.getPoint(img.getLatLon()).x-3, mv.getPoint(img.getLatLon()).y-3, 6, 6);
+        g.fillOval(mv.getPoint(img.getLatLon()).x - 3,
+            mv.getPoint(img.getLatLon()).y - 3, 6, 6);
         if (((MapillaryImage) img).getSigns().size() >= 1) {
           Point imgLoc = mv.getPoint(img.getLatLon());
-          for (TrafficoSignElement e : TrafficoSign.getSign("de", ((MapillaryImage) img).getSigns().get(0))) {
+          for (TrafficoSignElement e : TrafficoSign.getSign("de",
+              ((MapillaryImage) img).getSigns().get(0))) {
             g.setColor(e.getColor());
             g.drawString("" + e.getGlyph(), imgLoc.x, imgLoc.y);
@@ -103,4 +115,5 @@
   /*
    * (non-Javadoc)
+   * 
    * @see org.openstreetmap.josm.gui.layer.Layer#getIcon()
    */
@@ -112,4 +125,5 @@
   /*
    * (non-Javadoc)
+   * 
    * @see org.openstreetmap.josm.gui.layer.Layer#getToolTipText()
    */
@@ -121,14 +135,21 @@
   /*
    * (non-Javadoc)
-   * @see org.openstreetmap.josm.gui.layer.Layer#mergeFrom(org.openstreetmap.josm.gui.layer.Layer)
+   * 
+   * @see
+   * org.openstreetmap.josm.gui.layer.Layer#mergeFrom(org.openstreetmap.josm
+   * .gui.layer.Layer)
    */
   @Override
   public void mergeFrom(Layer from) {
-    // Does nothing as this layer is not mergeable (see method isMergable(Layer))
+    // Does nothing as this layer is not mergeable (see method
+    // isMergable(Layer))
   }
 
   /*
    * (non-Javadoc)
-   * @see org.openstreetmap.josm.gui.layer.Layer#isMergable(org.openstreetmap.josm.gui.layer.Layer)
+   * 
+   * @see
+   * org.openstreetmap.josm.gui.layer.Layer#isMergable(org.openstreetmap.josm
+   * .gui.layer.Layer)
    */
   @Override
@@ -139,6 +160,8 @@
   /*
    * (non-Javadoc)
+   * 
    * @see
-   * org.openstreetmap.josm.gui.layer.Layer#visitBoundingBox(org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor)
+   * org.openstreetmap.josm.gui.layer.Layer#visitBoundingBox(org.openstreetmap
+   * .josm.data.osm.visitor.BoundingXYVisitor)
    */
   @Override
@@ -150,4 +173,5 @@
   /*
    * (non-Javadoc)
+   * 
    * @see org.openstreetmap.josm.gui.layer.Layer#getInfoComponent()
    */
@@ -160,4 +184,5 @@
   /*
    * (non-Javadoc)
+   * 
    * @see org.openstreetmap.josm.gui.layer.Layer#getMenuEntries()
    */
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryDownloadAction.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryDownloadAction.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryDownloadAction.java	(revision 31401)
@@ -12,4 +12,5 @@
 import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;
+import org.openstreetmap.josm.plugins.mapillary.downloads.MapillaryDownloader;
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.Shortcut;
@@ -41,5 +42,5 @@
     if (MapillaryLayer.INSTANCE == null) {
       if (Main.map.mapView.getEditLayer() != null)
-        MapillaryLayer.getInstance().download();
+        MapillaryDownloader.automaticDownload();
     } else {
       if (Main.map.mapView.getActiveLayer() != MapillaryLayer.getInstance())
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryExportAction.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryExportAction.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryExportAction.java	(revision 31401)
@@ -57,5 +57,4 @@
     JButton cancel = new JButton(tr("Cancel"));
     cancel.addActionListener(new CancelAction(pane));
-
 
     dialog = new MapillaryExportDialog(ok);
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportAction.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportAction.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportAction.java	(revision 31401)
@@ -153,10 +153,11 @@
       if (datetimeOriginal != null)
         MapillaryData.getInstance().add(
-            new MapillaryImportedImage(latValue, lonValue, caValue, file, datetimeOriginal.getStringValue()));
+            new MapillaryImportedImage(latValue, lonValue, caValue, file,
+                datetimeOriginal.getStringValue()));
       else
         MapillaryData.getInstance().add(
             new MapillaryImportedImage(latValue, lonValue, caValue, file));
     }
-    
+
     MapillaryLayer.getInstance().showAllPictures();
   }
@@ -219,11 +220,11 @@
     }
     switch (ref) {
-    case GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF_VALUE_NORTH:
-    case GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF_VALUE_SOUTH:
-    case GpsTagConstants.GPS_TAG_GPS_LONGITUDE_REF_VALUE_EAST:
-    case GpsTagConstants.GPS_TAG_GPS_LONGITUDE_REF_VALUE_WEST:
-      break;
-    default:
-      throw new IllegalArgumentException();
+      case GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF_VALUE_NORTH:
+      case GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF_VALUE_SOUTH:
+      case GpsTagConstants.GPS_TAG_GPS_LONGITUDE_REF_VALUE_EAST:
+      case GpsTagConstants.GPS_TAG_GPS_LONGITUDE_REF_VALUE_WEST:
+        break;
+      default:
+        throw new IllegalArgumentException();
     }
 
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportIntoSequenceAction.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportIntoSequenceAction.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportIntoSequenceAction.java	(revision 31401)
@@ -73,5 +73,5 @@
         "jpeg"));
     chooser.setMultiSelectionEnabled(true);
-    
+
     if (chooser.showOpenDialog(Main.parent) == JFileChooser.APPROVE_OPTION) {
       for (int i = 0; i < chooser.getSelectedFiles().length; i++) {
@@ -112,5 +112,5 @@
       joinImages();
     }
-    
+
     MapillaryLayer.getInstance().showAllPictures();
   }
@@ -140,6 +140,8 @@
       final TiffField datetimeOriginal = jpegMetadata
           .findEXIFValueWithExactMatch(ExifTagConstants.EXIF_TAG_DATE_TIME_ORIGINAL);
-      if (lat_ref == null || lat == null || lon == null || lon_ref == null || datetimeOriginal == null)
-        throw new IllegalArgumentException("The picture has not correct EXIF tags");
+      if (lat_ref == null || lat == null || lon == null || lon_ref == null
+          || datetimeOriginal == null)
+        throw new IllegalArgumentException(
+            "The picture has not correct EXIF tags");
 
       double latValue = 0;
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryWalkAction.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryWalkAction.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryWalkAction.java	(revision 31401)
@@ -103,4 +103,3 @@
   }
 
-
 }
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/WalkListener.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/WalkListener.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/WalkListener.java	(revision 31401)
@@ -1,4 +1,3 @@
 package org.openstreetmap.josm.plugins.mapillary.actions;
-
 
 /**
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/WalkThread.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/WalkThread.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/WalkThread.java	(revision 31401)
@@ -46,9 +46,12 @@
       while (!end && data.getSelectedImage().next() != null) {
         MapillaryAbstractImage image = data.getSelectedImage();
-        for (int i = 0; i < 5; i++) {
-          if (image.next() == null)
-            break;
-          image = image.next();
-          Utils.downloadPicture(image);
+        // Predownload next 5 pictures.
+        if (image instanceof MapillaryImage) {
+          for (int i = 0; i < 5; i++) {
+            if (image.next() == null)
+              break;
+            image = image.next();
+            Utils.downloadPicture((MapillaryImage) image);
+          }
         }
         try {
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java	(revision 31401)
@@ -30,5 +30,5 @@
     /** Full quality image */
     FULL_IMAGE,
-    
+
     /** Low quality image */
     THUMBNAIL
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/cache/Utils.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/cache/Utils.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/cache/Utils.java	(revision 31401)
@@ -4,5 +4,4 @@
 import org.openstreetmap.josm.data.cache.CacheEntryAttributes;
 import org.openstreetmap.josm.data.cache.ICachedLoaderListener;
-import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
 import org.openstreetmap.josm.plugins.mapillary.MapillaryImage;
 
@@ -18,14 +17,13 @@
 
   /**
-   * Downloads the picture of the given image and does nothing when it is downloaded.
+   * Downloads the picture of the given image and does nothing when it is
+   * downloaded.
    *
    * @param img
    */
-  public static void downloadPicture(MapillaryAbstractImage img) {
-    if (!(img instanceof MapillaryImage))
-      throw new IllegalArgumentException();
-    new MapillaryCache(((MapillaryImage) img).getKey(), MapillaryCache.Type.THUMBNAIL).submit(
+  public static void downloadPicture(MapillaryImage img) {
+    new MapillaryCache(img.getKey(), MapillaryCache.Type.THUMBNAIL).submit(
         IGNORE_DOWNLOAD, false);
-    new MapillaryCache(((MapillaryImage) img).getKey(), MapillaryCache.Type.FULL_IMAGE).submit(
+    new MapillaryCache(img.getKey(), MapillaryCache.Type.FULL_IMAGE).submit(
         IGNORE_DOWNLOAD, false);
   }
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/CommandMoveImage.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/CommandMoveImage.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/CommandMoveImage.java	(revision 31401)
@@ -22,9 +22,13 @@
    * Main constructor.
    * 
-   * @param images Set of images that are going to be moved.
-   * @param x How much the x coordinate increases.
-   * @param y How much the y coordinate increases.
+   * @param images
+   *          Set of images that are going to be moved.
+   * @param x
+   *          How much the x coordinate increases.
+   * @param y
+   *          How much the y coordinate increases.
    */
-  public CommandMoveImage(List<MapillaryAbstractImage> images, double x, double y) {
+  public CommandMoveImage(List<MapillaryAbstractImage> images, double x,
+      double y) {
     this.images = new ArrayList<>(images);
     this.x = x;
@@ -54,5 +58,6 @@
   @Override
   public String toString() {
-    return trn("Moved {0} image", "Moved {0} images", images.size(), images.size());
+    return trn("Moved {0} image", "Moved {0} images", images.size(),
+        images.size());
   }
 
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/CommandTurnImage.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/CommandTurnImage.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/CommandTurnImage.java	(revision 31401)
@@ -21,6 +21,8 @@
    * Main constructor.
    * 
-   * @param images Set of images that is turned.
-   * @param ca How much the images turn.
+   * @param images
+   *          Set of images that is turned.
+   * @param ca
+   *          How much the images turn.
    */
   public CommandTurnImage(List<MapillaryAbstractImage> images, double ca) {
@@ -51,5 +53,6 @@
   @Override
   public String toString() {
-    return trn("Turned {0} image", "Turned {0} images", this.images.size(), this.images.size());
+    return trn("Turned {0} image", "Turned {0} images", this.images.size(),
+        this.images.size());
   }
 
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/MapillaryRecord.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/MapillaryRecord.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/MapillaryRecord.java	(revision 31401)
@@ -72,5 +72,6 @@
         if (!command.images.contains(img))
           equalSets = false;
-      if (equalSets && commandList.get(position).getClass() == command.getClass()) {
+      if (equalSets
+          && commandList.get(position).getClass() == command.getClass()) {
         commandList.get(position).sum(command);
         fireRecordChanged();
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryDownloader.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryDownloader.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryDownloader.java	(revision 31401)
@@ -1,3 +1,5 @@
 package org.openstreetmap.josm.plugins.mapillary.downloads;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
 
 import java.util.concurrent.ConcurrentHashMap;
@@ -5,8 +7,11 @@
 import java.util.concurrent.Executors;
 
+import javax.swing.JOptionPane;
+
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;
+import org.openstreetmap.josm.plugins.mapillary.MapillaryPlugin;
 import org.openstreetmap.josm.plugins.mapillary.actions.MapillaryDownloadViewAction;
 
@@ -20,7 +25,7 @@
 public class MapillaryDownloader {
 
-  /** Possible download modes.*/
-  public static final String[] MODES = new String[] { "Automatic", "Semiautomatic",
-  "Manual" };
+  /** Possible download modes. */
+  public static final String[] MODES = new String[] { "Automatic",
+      "Semiautomatic", "Manual" };
 
   /** Base URL of the Mapillary API. */
@@ -83,3 +88,45 @@
     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();
+    checkAreaTooBig();
+    if (!Main.pref.get("mapillary.download-mode").equals(
+        MapillaryDownloader.MODES[0])
+        || layer.TEMP_SEMIAUTOMATIC)
+      return;
+    for (Bounds bounds : Main.map.mapView.getEditLayer().data
+        .getDataSourceBounds()) {
+      if (!layer.bounds.contains(bounds)) {
+        layer.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 void checkAreaTooBig() {
+    double area = 0;
+    for (Bounds bounds : Main.map.mapView.getEditLayer().data
+        .getDataSourceBounds()) {
+      area += bounds.getArea();
+    }
+    if (area > MapillaryDownloadViewAction.MAX_AREA) {
+      MapillaryLayer.getInstance().TEMP_SEMIAUTOMATIC = true;
+      MapillaryPlugin.setMenuEnabled(MapillaryPlugin.DOWNLOAD_VIEW_MENU, true);
+      JOptionPane
+          .showMessageDialog(
+              Main.parent,
+              tr("The downloaded OSM area is too big. Download mode has been changed to manual until the layer is restarted."));
+    }
+  }
 }
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryExportDownloadThread.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryExportDownloadThread.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryExportDownloadThread.java	(revision 31401)
@@ -25,5 +25,6 @@
  * @see MapillaryExportWriterThread
  */
-public class MapillaryExportDownloadThread extends Thread implements ICachedLoaderListener {
+public class MapillaryExportDownloadThread extends Thread implements
+    ICachedLoaderListener {
 
   String url;
@@ -37,11 +38,18 @@
    * Main constructor.
    * 
-   * @param image Image to be downloaded.
-   * @param queue Queue of {@link BufferedImage} objects for the {@link MapillaryExportWriterThread}.
-   * @param queueImages Queue of {@link MapillaryAbstractImage} objects for the {@link MapillaryExportWriterThread}.
+   * @param image
+   *          Image to be downloaded.
+   * @param queue
+   *          Queue of {@link BufferedImage} objects for the
+   *          {@link MapillaryExportWriterThread}.
+   * @param queueImages
+   *          Queue of {@link MapillaryAbstractImage} objects for the
+   *          {@link MapillaryExportWriterThread}.
    */
-  public MapillaryExportDownloadThread(MapillaryImage image, ArrayBlockingQueue<BufferedImage> queue,
+  public MapillaryExportDownloadThread(MapillaryImage image,
+      ArrayBlockingQueue<BufferedImage> queue,
       ArrayBlockingQueue<MapillaryAbstractImage> queueImages) {
-    url = "https://d1cuyjsrcm0gby.cloudfront.net/" + image.getKey() + "/thumb-2048.jpg";
+    url = "https://d1cuyjsrcm0gby.cloudfront.net/" + image.getKey()
+        + "/thumb-2048.jpg";
     this.queue = queue;
     this.image = image;
@@ -51,9 +59,11 @@
   @Override
   public void run() {
-    new MapillaryCache(image.getKey(), MapillaryCache.Type.FULL_IMAGE).submit(this, false);
+    new MapillaryCache(image.getKey(), MapillaryCache.Type.FULL_IMAGE).submit(
+        this, false);
   }
 
   @Override
-  public void loadingFinished(CacheEntry data, CacheEntryAttributes attributes, LoadResult result) {
+  public void loadingFinished(CacheEntry data, CacheEntryAttributes attributes,
+      LoadResult result) {
     try {
       queue.put(ImageIO.read(new ByteArrayInputStream(data.getContent())));
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryExportManager.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryExportManager.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryExportManager.java	(revision 31401)
@@ -20,8 +20,9 @@
 
 /**
- * Export main thread. Exportation works by creating a {@link MapillaryExportWriterThread} and several
+ * Export main thread. Exportation works by creating a
+ * {@link MapillaryExportWriterThread} and several
  * {@link MapillaryExportDownloadThread}. The second ones download every single
- * image that is going to be exported and stores them in an {@link ArrayBlockingQueue}. Then it is picked by the first
- * one and written on
+ * image that is going to be exported and stores them in an
+ * {@link ArrayBlockingQueue}. Then it is picked by the first one and written on
  * the selected folder. Each image will be named by its key.
  *
@@ -44,9 +45,12 @@
    * Main constructor.
    * 
-   * @param images Set of {@link MapillaryAbstractImage} objects to be exported.
-   * @param path Export path.
+   * @param images
+   *          Set of {@link MapillaryAbstractImage} objects to be exported.
+   * @param path
+   *          Export path.
    */
   public MapillaryExportManager(List<MapillaryAbstractImage> images, String path) {
-    super(tr("Downloading") + "...", new PleaseWaitProgressMonitor("Exporting Mapillary Images"), true);
+    super(tr("Downloading") + "...", new PleaseWaitProgressMonitor(
+        "Exporting Mapillary Images"), true);
     queue = new ArrayBlockingQueue<>(10);
     queueImages = new ArrayBlockingQueue<>(10);
@@ -63,6 +67,8 @@
    * @throws IOException
    */
-  public MapillaryExportManager(List<MapillaryImportedImage> images) throws IOException {
-    super(tr("Downloading") + "...", new PleaseWaitProgressMonitor("Exporting Mapillary Images"), true);
+  public MapillaryExportManager(List<MapillaryImportedImage> images)
+      throws IOException {
+    super(tr("Downloading") + "...", new PleaseWaitProgressMonitor(
+        "Exporting Mapillary Images"), true);
     queue = new ArrayBlockingQueue<>(10);
     queueImages = new ArrayBlockingQueue<>(10);
@@ -81,7 +87,9 @@
 
   @Override
-  protected void realRun() throws SAXException, IOException, OsmTransferException {
+  protected void realRun() throws SAXException, IOException,
+      OsmTransferException {
     // Starts a writer thread in order to write the pictures on the disk.
-    writer = new MapillaryExportWriterThread(path, queue, queueImages, amount, this.getProgressMonitor());
+    writer = new MapillaryExportWriterThread(path, queue, queueImages, amount,
+        this.getProgressMonitor());
     writer.start();
     if (path == null) {
@@ -93,9 +101,11 @@
       return;
     }
-    ex = new ThreadPoolExecutor(20, 35, 25, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(10));
+    ex = new ThreadPoolExecutor(20, 35, 25, TimeUnit.SECONDS,
+        new ArrayBlockingQueue<Runnable>(10));
     for (MapillaryAbstractImage image : images) {
       if (image instanceof MapillaryImage) {
         try {
-          ex.execute(new MapillaryExportDownloadThread((MapillaryImage) image, queue, queueImages));
+          ex.execute(new MapillaryExportDownloadThread((MapillaryImage) image,
+              queue, queueImages));
         } catch (Exception e) {
           Main.error(e);
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryExportWriterThread.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryExportWriterThread.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryExportWriterThread.java	(revision 31401)
@@ -47,9 +47,14 @@
    * Main constructor.
    * 
-   * @param path Path to write the pictures.
-   * @param queue Queue of {@link MapillaryAbstractImage} objects.
-   * @param queueImages Queue of {@link BufferedImage} objects.
-   * @param amount Amount of images that are going to be exported.
-   * @param monitor Progress monitor.
+   * @param path
+   *          Path to write the pictures.
+   * @param queue
+   *          Queue of {@link MapillaryAbstractImage} objects.
+   * @param queueImages
+   *          Queue of {@link BufferedImage} objects.
+   * @param amount
+   *          Amount of images that are going to be exported.
+   * @param monitor
+   *          Progress monitor.
    */
   public MapillaryExportWriterThread(String path,
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryImageInfoDownloaderThread.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryImageInfoDownloaderThread.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryImageInfoDownloaderThread.java	(revision 31401)
@@ -32,9 +32,11 @@
    * Main constructor.
    * 
-   * @param ex {@link ExecutorService} object that is executing this thread.
-   * @param queryString 
-   * @param layer 
+   * @param ex
+   *          {@link ExecutorService} object that is executing this thread.
+   * @param queryString
+   * @param layer
    */
-  public MapillaryImageInfoDownloaderThread(ExecutorService ex, String queryString, MapillaryLayer layer) {
+  public MapillaryImageInfoDownloaderThread(ExecutorService ex,
+      String queryString, MapillaryLayer layer) {
     this.ex = ex;
     this.queryString = queryString;
@@ -45,6 +47,6 @@
   public void run() {
     try {
-      BufferedReader br = new BufferedReader(new InputStreamReader(
-          new URL(URL + queryString).openStream(), "UTF-8"));
+      BufferedReader br = new BufferedReader(new InputStreamReader(new URL(URL
+          + queryString).openStream(), "UTF-8"));
       JsonObject jsonobj = Json.createReader(br).readObject();
       if (!jsonobj.getBoolean("more"))
@@ -55,5 +57,6 @@
         data = jsonarr.getJsonObject(i);
         String key = data.getString("key");
-        for (MapillaryAbstractImage image : layer.getMapillaryData().getImages()) {
+        for (MapillaryAbstractImage image : layer.getMapillaryData()
+            .getImages()) {
           if (image instanceof MapillaryImage) {
             if (((MapillaryImage) image).getKey().equals(key)
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySignDownloaderThread.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySignDownloaderThread.java	(revision 31400)
+++ 	(revision )
@@ -1,95 +1,0 @@
-package org.openstreetmap.josm.plugins.mapillary.downloads;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.concurrent.ExecutorService;
-
-import javax.json.Json;
-import javax.json.JsonArray;
-import javax.json.JsonObject;
-
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
-import org.openstreetmap.josm.plugins.mapillary.MapillaryImage;
-import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;
-
-/**
- * Downloads the signs information in a given area.
- * 
- * @author nokutu
- *
- */
-public class MapillarySignDownloaderThread extends Thread {
-  private static final String URL = MapillaryDownloader.BASE_URL
-      + "search/im/or/";
-  private final String queryString;
-  private final ExecutorService ex;
-  private final MapillaryLayer layer;
-
-  /**
-   * Main constructor.
-   * 
-   * @param ex
-   *          {@link ExecutorService} object that is executing this thread.
-   * @param queryString
-   * @param layer
-   */
-  public MapillarySignDownloaderThread(ExecutorService ex, String queryString,
-      MapillaryLayer layer) {
-    this.ex = ex;
-    this.queryString = queryString;
-    this.layer = layer;
-  }
-
-  @Override
-  public void run() {
-    BufferedReader br;
-    try {
-      br = new BufferedReader(new InputStreamReader(
-          new URL(URL + queryString).openStream(), "UTF-8"));
-      JsonObject jsonobj = Json.createReader(br).readObject();
-      if (!jsonobj.getBoolean("more")) {
-        ex.shutdown();
-      }
-      JsonArray jsonarr = jsonobj.getJsonArray("ims");
-      for (int i = 0; i < jsonarr.size(); i++) {
-        JsonArray rects = jsonarr.getJsonObject(i).getJsonArray("rects");
-        JsonArray rectversions = jsonarr.getJsonObject(i).getJsonArray(
-            "rectversions");
-        String key = jsonarr.getJsonObject(i).getString("key");
-        if (rectversions != null) {
-          for (int j = 0; j < rectversions.size(); j++) {
-            rects = rectversions.getJsonObject(j).getJsonArray("rects");
-            for (int k = 0; k < rects.size(); k++) {
-              JsonObject data = rects.getJsonObject(k);
-              for (MapillaryAbstractImage image : layer.getMapillaryData()
-                  .getImages())
-                if (image instanceof MapillaryImage
-                    && ((MapillaryImage) image).getKey().equals(key))
-                  ((MapillaryImage) image).addSign(data.getString("type"));
-            }
-          }
-        }
-
-        // Just one sign on the picture
-        else if (rects != null) {
-          for (int j = 0; j < rects.size(); j++) {
-            JsonObject data = rects.getJsonObject(j);
-            for (MapillaryAbstractImage image : layer.getMapillaryData()
-                .getImages())
-              if (image instanceof MapillaryImage
-                  && ((MapillaryImage) image).getKey().equals(key))
-                ((MapillaryImage) image).addSign(data.getString("type"));
-          }
-        }
-      }
-    } catch (MalformedURLException e) {
-      Main.error(e);
-    } catch (IOException e) {
-      Main.error(e);
-    }
-  }
-}
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySquareDownloadManagerThread.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySquareDownloadManagerThread.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySquareDownloadManagerThread.java	(revision 31401)
@@ -79,5 +79,5 @@
         completeImages();
         MapillaryMainDialog.getInstance().updateTitle();
-        Main.map.statusLine.setHelpText(tr("Downloading signs"));
+        Main.map.statusLine.setHelpText(tr("Downloading traffic signs"));
         downloadSigns();
       }
@@ -125,5 +125,5 @@
     int page = 0;
     while (!ex.isShutdown()) {
-      ex.execute(new MapillarySignDownloaderThread(ex, signQueryString
+      ex.execute(new MapillaryTrafficSignDownloaderThread(ex, signQueryString
           + "&page=" + page + "&limit=20", layer));
       while (ex.getQueue().remainingCapacity() == 0)
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryTrafficSignDownloaderThread.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryTrafficSignDownloaderThread.java	(revision 31401)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryTrafficSignDownloaderThread.java	(revision 31401)
@@ -0,0 +1,95 @@
+package org.openstreetmap.josm.plugins.mapillary.downloads;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.concurrent.ExecutorService;
+
+import javax.json.Json;
+import javax.json.JsonArray;
+import javax.json.JsonObject;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
+import org.openstreetmap.josm.plugins.mapillary.MapillaryImage;
+import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;
+
+/**
+ * Downloads the signs information in a given area.
+ * 
+ * @author nokutu
+ *
+ */
+public class MapillaryTrafficSignDownloaderThread extends Thread {
+  private static final String URL = MapillaryDownloader.BASE_URL
+      + "search/im/or/";
+  private final String queryString;
+  private final ExecutorService ex;
+  private final MapillaryLayer layer;
+
+  /**
+   * Main constructor.
+   * 
+   * @param ex
+   *          {@link ExecutorService} object that is executing this thread.
+   * @param queryString
+   * @param layer
+   */
+  public MapillaryTrafficSignDownloaderThread(ExecutorService ex,
+      String queryString, MapillaryLayer layer) {
+    this.ex = ex;
+    this.queryString = queryString;
+    this.layer = layer;
+  }
+
+  @Override
+  public void run() {
+    BufferedReader br;
+    try {
+      br = new BufferedReader(new InputStreamReader(
+          new URL(URL + queryString).openStream(), "UTF-8"));
+      JsonObject jsonobj = Json.createReader(br).readObject();
+      if (!jsonobj.getBoolean("more")) {
+        ex.shutdown();
+      }
+      JsonArray jsonarr = jsonobj.getJsonArray("ims");
+      for (int i = 0; i < jsonarr.size(); i++) {
+        JsonArray rects = jsonarr.getJsonObject(i).getJsonArray("rects");
+        JsonArray rectversions = jsonarr.getJsonObject(i).getJsonArray(
+            "rectversions");
+        String key = jsonarr.getJsonObject(i).getString("key");
+        if (rectversions != null) {
+          for (int j = 0; j < rectversions.size(); j++) {
+            rects = rectversions.getJsonObject(j).getJsonArray("rects");
+            for (int k = 0; k < rects.size(); k++) {
+              JsonObject data = rects.getJsonObject(k);
+              for (MapillaryAbstractImage image : layer.getMapillaryData()
+                  .getImages())
+                if (image instanceof MapillaryImage
+                    && ((MapillaryImage) image).getKey().equals(key))
+                  ((MapillaryImage) image).addSign(data.getString("type"));
+            }
+          }
+        }
+
+        // Just one sign on the picture
+        else if (rects != null) {
+          for (int j = 0; j < rects.size(); j++) {
+            JsonObject data = rects.getJsonObject(j);
+            for (MapillaryAbstractImage image : layer.getMapillaryData()
+                .getImages())
+              if (image instanceof MapillaryImage
+                  && ((MapillaryImage) image).getKey().equals(key))
+                ((MapillaryImage) image).addSign(data.getString("type"));
+          }
+        }
+      }
+    } catch (MalformedURLException e) {
+      Main.error(e);
+    } catch (IOException e) {
+      Main.error(e);
+    }
+  }
+}
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryExportDialog.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryExportDialog.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryExportDialog.java	(revision 31401)
@@ -34,7 +34,12 @@
   /** Button to export all downloaded images. */
   public JRadioButton all;
-  /** Button to export all images in the sequence of the selected MapillaryImage. */
+  /**
+   * Button to export all images in the sequence of the selected MapillaryImage.
+   */
   public JRadioButton sequence;
-  /** Button to export all images belonging to the selected {@link MapillaryImage} objects. */
+  /**
+   * Button to export all images belonging to the selected
+   * {@link MapillaryImage} objects.
+   */
   public JRadioButton selected;
   /** Button to rewrite all imported images. */
@@ -51,10 +56,11 @@
   /**
    * Main constructor.
-   * @param ok 
+   * 
+   * @param ok
    */
   public MapillaryExportDialog(JButton ok) {
     this.ok = ok;
     ok.setEnabled(false);
-    
+
     setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
 
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterDialog.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterDialog.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterDialog.java	(revision 31401)
@@ -114,13 +114,13 @@
     downloaded.setSelected(true);
 
-    JPanel col1 = new JPanel(new GridLayout(2,1));
+    JPanel col1 = new JPanel(new GridLayout(2, 1));
     col1.add(downloaded);
     col1.add(fromPanel);
     panel.add(col1);
-    JPanel col2 = new JPanel(new GridLayout(2,1));
+    JPanel col2 = new JPanel(new GridLayout(2, 1));
     col2.add(imported);
     col2.add(userSearchPanel);
     panel.add(col2);
-    JPanel col3 = new JPanel(new GridLayout(2,1));
+    JPanel col3 = new JPanel(new GridLayout(2, 1));
     col3.add(onlySigns);
     col3.add(signChooserPanel);
@@ -204,6 +204,7 @@
       Long currentTime = currentTime();
       if (time.getSelectedItem() == TIME_LIST[1]) {
-        if (img.getCapturedAt() < currentTime - ((Integer) spinner.getValue()).longValue()
-            * 365 * 24 * 60 * 60 * 1000) {
+        if (img.getCapturedAt() < currentTime
+            - ((Integer) spinner.getValue()).longValue() * 365 * 24 * 60 * 60
+            * 1000) {
           img.setVisible(false);
           continue;
@@ -211,6 +212,7 @@
       }
       if (time.getSelectedItem() == TIME_LIST[2]) {
-        if (img.getCapturedAt() < currentTime - ((Integer) spinner.getValue()).longValue() * 30 * 24
-            * 60 * 60 * 1000) {
+        if (img.getCapturedAt() < currentTime
+            - ((Integer) spinner.getValue()).longValue() * 30 * 24 * 60 * 60
+            * 1000) {
           img.setVisible(false);
           continue;
@@ -218,6 +220,6 @@
       }
       if (time.getSelectedItem() == TIME_LIST[3]) {
-        if (img.getCapturedAt() < currentTime - ((Integer) spinner.getValue()).longValue() * 60
-            * 60 * 1000) {
+        if (img.getCapturedAt() < currentTime
+            - ((Integer) spinner.getValue()).longValue() * 60 * 60 * 1000) {
           img.setVisible(false);
           continue;
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryPreferenceSetting.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryPreferenceSetting.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryPreferenceSetting.java	(revision 31401)
@@ -23,5 +23,5 @@
 import org.openstreetmap.josm.plugins.mapillary.MapillaryPlugin;
 import org.openstreetmap.josm.plugins.mapillary.downloads.MapillaryDownloader;
-import org.openstreetmap.josm.plugins.mapillary.oauth.PortListener;
+import org.openstreetmap.josm.plugins.mapillary.oauth.OAuthPortListener;
 
 /**
@@ -62,4 +62,14 @@
     panel.add(reverseButtons);
 
+    // Sets the value of the ComboBox.
+    if (Main.pref.get("mapillary.download-mode").equals(
+        MapillaryDownloader.MODES[0]))
+      downloadMode.setSelectedItem(MapillaryDownloader.MODES[0]);
+    if (Main.pref.get("mapillary.download-mode").equals(
+        MapillaryDownloader.MODES[1]))
+      downloadMode.setSelectedItem(MapillaryDownloader.MODES[1]);
+    if (Main.pref.get("mapillary.download-mode").equals(
+        MapillaryDownloader.MODES[2]))
+      downloadMode.setSelectedItem(MapillaryDownloader.MODES[2]);
     JPanel downloadModePanel = new JPanel();
     downloadModePanel.add(new JLabel(tr("Download mode: ")));
@@ -117,5 +127,5 @@
     @Override
     public void actionPerformed(ActionEvent arg0) {
-      PortListener portListener = new PortListener();
+      OAuthPortListener portListener = new OAuthPortListener();
       portListener.start();
 
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryWalkDialog.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryWalkDialog.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryWalkDialog.java	(revision 31401)
@@ -10,11 +10,12 @@
 /**
  * Dialog to set the walk mode options.
+ * 
  * @author nokutu
  *
  */
 public class MapillaryWalkDialog extends JPanel {
-  
+
   private static final long serialVersionUID = -6258767312211941358L;
-  
+
   /** Spin containing the interval value. */
   public SpinnerModel spin;
@@ -31,5 +32,5 @@
     interval.add(new JSpinner(spin));
     add(interval);
-    
+
     waitForPicture = new JCheckBox("Wait for the picture to be downloaded");
     waitForPicture.setSelected(true);
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/AbstractMode.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/AbstractMode.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/AbstractMode.java	(revision 31401)
@@ -17,5 +17,5 @@
 
 /**
- * Superclass for all the mode of the {@link MapillaryLayer}
+ * Superclass for all the mode of the {@link MapillaryLayer}.
  *
  * @author nokutu
@@ -28,4 +28,5 @@
   protected MapillaryData data = MapillaryData.getInstance();
 
+  /** If in semiautomatic mode, the last Epoch time when there was a download */
   private long lastDownload;
 
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/SelectMode.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/SelectMode.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/SelectMode.java	(revision 31401)
@@ -49,6 +49,6 @@
       return;
     MapillaryAbstractImage closest = getClosest(e.getPoint());
-    if (Main.map.mapView.getActiveLayer() instanceof OsmDataLayer && closest != null
-        && Main.map.mapMode == Main.map.mapModeSelect) {
+    if (Main.map.mapView.getActiveLayer() instanceof OsmDataLayer
+        && closest != null && Main.map.mapMode == Main.map.mapModeSelect) {
       this.lastClicked = this.closest;
       data.setSelectedImage(closest);
@@ -113,8 +113,10 @@
         Main.map.repaint();
       } else if (lastButton == MouseEvent.BUTTON1 && e.isShiftDown()) {
-        this.closest
-            .turn(Math.toDegrees(Math.atan2((e.getX() - start.x), -(e.getY() - start.y))) - closest.getTempCa());
+        this.closest.turn(Math.toDegrees(Math.atan2((e.getX() - start.x),
+            -(e.getY() - start.y)))
+            - closest.getTempCa());
         for (MapillaryAbstractImage img : data.getMultiSelectedImages()) {
-          img.turn(Math.toDegrees(Math.atan2((e.getX() - start.x), -(e.getY() - start.y))) - closest.getTempCa());
+          img.turn(Math.toDegrees(Math.atan2((e.getX() - start.x),
+              -(e.getY() - start.y))) - closest.getTempCa());
         }
         Main.map.repaint();
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/OAuthPortListener.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/OAuthPortListener.java	(revision 31401)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/OAuthPortListener.java	(revision 31401)
@@ -0,0 +1,69 @@
+package org.openstreetmap.josm.plugins.mapillary.oauth;
+
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.net.BindException;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.util.Scanner;
+
+import org.openstreetmap.josm.Main;
+
+/**
+ * Listens to the OAuth port in order to get the access token.
+ *
+ * @author nokutu
+ *
+ */
+public class OAuthPortListener extends Thread {
+
+  @Override
+  public void run() {
+    try {
+      ServerSocket serverSocket = new ServerSocket(8763);
+      Socket clientSocket = serverSocket.accept();
+      PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true);
+      Scanner in = new Scanner(new InputStreamReader(
+          clientSocket.getInputStream()));
+      String s;
+      String accessToken = null;
+      while (in.hasNextLine()) {
+        s = in.nextLine();
+        if (s.contains("access_token=")) {
+          String[] ss = s.split("&");
+          for (int i = 0; i < ss.length; i++) {
+            if (ss[i].contains("access_token=")) {
+              accessToken = ss[i].substring(
+                  ss[i].indexOf("access_token=") + 13, ss[i].length());
+              break;
+            }
+          }
+          break;
+        }
+      }
+
+      writeContent(out);
+
+      Main.info("Successful login with Mapillary, the access token is: "
+          + accessToken);
+      Main.pref.put("mapillary.access-token", accessToken);
+
+      out.close();
+      in.close();
+      serverSocket.close();
+    } catch (BindException e) {
+      return;
+    } catch (IOException e) {
+      Main.error(e);
+    }
+  }
+
+  private void writeContent(PrintWriter out) {
+    String response = "<html><head><title>Mapillary login</title></head><body>Login successful, return to JOSM.</body></html>";
+    out.println("HTTP/1.1 200 OK");
+    out.println("Content-Length: " + response.length());
+    out.println("Content-Type: text/html" + "\r\n\r\n");
+    out.println(response);
+  }
+}
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/PortListener.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/PortListener.java	(revision 31400)
+++ 	(revision )
@@ -1,64 +1,0 @@
-package org.openstreetmap.josm.plugins.mapillary.oauth;
-
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.net.BindException;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.util.Scanner;
-
-import org.openstreetmap.josm.Main;
-
-/**
- * @author nokutu
- *
- */
-public class PortListener extends Thread {
-
-  @Override
-  public void run() {
-    try {
-      ServerSocket serverSocket = new ServerSocket(8763);
-      Socket clientSocket = serverSocket.accept();
-      PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true);
-      Scanner in = new Scanner(new InputStreamReader(clientSocket.getInputStream()));
-      String s;
-      String accessToken = null;
-      while (in.hasNextLine()) {
-        s = in.nextLine();
-        if (s.contains("access_token=")) {
-          String[] ss = s.split("&");
-          for (int i = 0; i < ss.length; i++) {
-            if (ss[i].contains("access_token=")) {
-              accessToken = ss[i].substring(ss[i].indexOf("access_token=") + 13, ss[i].length());
-              break;
-            }
-          }
-          break;
-        }
-      }
-
-      writeContent(out);
-
-      Main.info("Successful login with Mapillary, the access token is: " + accessToken);
-      Main.pref.put("mapillary.access-token", accessToken);
-
-      out.close();
-      in.close();
-      serverSocket.close();
-    } catch (BindException e) {
-      return;
-    } catch (IOException e) {
-      Main.error(e);
-    }
-  }
-
-  private void writeContent(PrintWriter out) {
-    String response = "<html><head><title>Mapillary login</title></head><body>Login successful, return to JOSM.</body></html>";
-    out.println("HTTP/1.1 200 OK");
-    out.println("Content-Length: " + response.length());
-    out.println("Content-Type: text/html" + "\r\n\r\n");
-    out.println(response);
-  }
-}
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/traffico/TrafficoSign.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/traffico/TrafficoSign.java	(revision 31400)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/traffico/TrafficoSign.java	(revision 31401)
@@ -57,24 +57,24 @@
             Color c;
             switch (elements.getJsonObject(i).getString("color").toLowerCase()) {
-            case "black":
-              c = Color.BLACK;
-              break;
-            case "red":
-              c = Color.RED;
-              break;
-            case "blue":
-              c = Color.BLUE;
-              break;
-            case "white":
-              c = Color.WHITE;
-              break;
-            case "green":
-              c = Color.GREEN;
-              break;
-            case "yellow":
-              c = Color.YELLOW;
-              break;
-            default:
-              c = Color.MAGENTA;
+              case "black":
+                c = Color.BLACK;
+                break;
+              case "red":
+                c = Color.RED;
+                break;
+              case "blue":
+                c = Color.BLUE;
+                break;
+              case "white":
+                c = Color.WHITE;
+                break;
+              case "green":
+                c = Color.GREEN;
+                break;
+              case "yellow":
+                c = Color.YELLOW;
+                break;
+              default:
+                c = Color.MAGENTA;
             }
             layers.add(new TrafficoSignElement(glyph, c));
