Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryAbstractImage.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryAbstractImage.java	(revision 31330)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryAbstractImage.java	(revision 31331)
@@ -20,5 +20,5 @@
  */
 public abstract class MapillaryAbstractImage {
-    
+
     public static Lock lock = new ReentrantLock();
 
@@ -30,5 +30,5 @@
     public final double ca;
     public boolean isModified = false;
-    /** Temporal position of the picture until it is uplaoded */
+    /** Temporal position of the picture until it is uploaded */
     public LatLon tempLatLon;
     /**
@@ -37,5 +37,5 @@
      */
     public LatLon movingLatLon;
-    /** Temporal direction of the picture until it is uplaoded */
+    /** Temporal direction of the picture until it is uploaded */
     public double tempCa;
     /**
@@ -75,4 +75,9 @@
     }
 
+    /**
+     * Returns whether the image is visible on the map or not.
+     * 
+     * @return
+     */
     public boolean isVisible() {
         return visible;
@@ -84,5 +89,5 @@
 
     /**
-     * Returns the last fixed coorditanes of the object.
+     * Returns the last fixed coordinates of the object.
      * 
      * @return
@@ -95,5 +100,6 @@
      * Moves the image temporally to another position
      * 
-     * @param pos
+     * @param x
+     * @param y
      */
     public void move(double x, double y) {
@@ -182,4 +188,11 @@
     }
 
+    /**
+     * Parses a string with a given format and returns the Epoch time.
+     * 
+     * @param date
+     * @param format
+     * @return
+     */
     public long getEpoch(String date, String format) {
 
@@ -194,4 +207,9 @@
     }
 
+    /**
+     * Returns current time in Epoch format
+     * 
+     * @return
+     */
     private long currentTime() {
         Calendar cal = Calendar.getInstance();
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 31330)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java	(revision 31331)
@@ -25,5 +25,6 @@
     private final List<MapillaryAbstractImage> images;
     private MapillaryAbstractImage selectedImage;
-    private MapillaryAbstractImage hoveredImage;
+    /** The image under the cursor */
+    private MapillaryAbstractImage highlightedImage;
     private final List<MapillaryAbstractImage> multiSelectedImages;
 
@@ -97,5 +98,5 @@
      */
     public void setHoveredImage(MapillaryAbstractImage image) {
-        hoveredImage = image;
+        highlightedImage = image;
     }
 
@@ -106,5 +107,5 @@
      */
     public MapillaryAbstractImage getHoveredImage() {
-        return hoveredImage;
+        return highlightedImage;
     }
 
@@ -237,4 +238,5 @@
             if (image instanceof MapillaryImage) {
                 MapillaryImage mapillaryImage = (MapillaryImage) image;
+                // Donwloadins thumbnails of surrounding pictures.
                 if (mapillaryImage.next() != null) {
                     new MapillaryCache(mapillaryImage.next().getKey(),
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 31330)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java	(revision 31331)
@@ -64,4 +64,6 @@
             "mapillary.sequence-max-jump-distance", 100);
 
+    private boolean TEMP_MANUAL = false;
+
     public static MapillaryLayer INSTANCE;
     public static CacheAccess<String, BufferedImageCacheEntry> CACHE;
@@ -82,5 +84,5 @@
     private volatile TexturePaint hatched;
 
-    public MapillaryLayer() {
+    private MapillaryLayer() {
         super(tr("Mapillary Images"));
         bounds = new ArrayList<>();
@@ -92,6 +94,5 @@
      */
     private void init() {
-        MapillaryLayer.INSTANCE = this;
-        startMouseAdapter();
+        mouseAdapter = new MapillaryMouseAdapter();
         try {
             CACHE = JCSCacheManager.getCache("Mapillary");
@@ -115,8 +116,4 @@
     }
 
-    private void startMouseAdapter() {
-        mouseAdapter = new MapillaryMouseAdapter();
-    }
-
     public synchronized static MapillaryLayer getInstance() {
         if (MapillaryLayer.INSTANCE == null)
@@ -130,6 +127,6 @@
      */
     public void download() {
-        checkBigAreas();
-        if (Main.pref.getBoolean("mapillary.download-manually"))
+        checkAreaTooBig();
+        if (Main.pref.getBoolean("mapillary.download-manually") || TEMP_MANUAL)
             return;
         for (Bounds bounds : Main.map.mapView.getEditLayer().data
@@ -149,5 +146,5 @@
      * shown and you will have to download areas manually.
      */
-    private void checkBigAreas() {
+    private void checkAreaTooBig() {
         double area = 0;
         for (Bounds bounds : Main.map.mapView.getEditLayer().data
@@ -156,9 +153,11 @@
         }
         if (area > MapillaryDownloadViewAction.MAX_AREA) {
-            Main.pref.put("mapillary.download-manually", true);
+            TEMP_MANUAL = true;
+            MapillaryPlugin.setMenuEnabled(MapillaryPlugin.DOWNLOAD_VIEW_MENU,
+                    true);
             JOptionPane
                     .showMessageDialog(
                             Main.parent,
-                            tr("The downloaded OSM area is too big. Download mode has been change to manual. You can change this back to automatic in preferences settings."));
+                            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/actions/MapillaryDownloadAction.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryDownloadAction.java	(revision 31330)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryDownloadAction.java	(revision 31331)
@@ -16,5 +16,6 @@
 
 /**
- * Action that triggers the plugin.
+ * Action that triggers the plugin. If in automatic mode, it will automatically
+ * download the images in the areas where there is OSM data.
  * 
  * @author nokutu
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryDownloadViewAction.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryDownloadViewAction.java	(revision 31330)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryDownloadViewAction.java	(revision 31331)
@@ -15,4 +15,10 @@
 import org.openstreetmap.josm.tools.Shortcut;
 
+/**
+ * If in manual mode, downloads all the images in the current view.
+ * 
+ * @author nokutu
+ *
+ */
 public class MapillaryDownloadViewAction extends JosmAction {
 
@@ -33,5 +39,4 @@
     @Override
     public void actionPerformed(ActionEvent arg0) {
-        MapillaryLayer.getInstance();
         MapillaryLayer.getInstance().bounds.add(Main.map.mapView
                 .getRealBounds());
@@ -41,5 +46,5 @@
         } else {
             JOptionPane.showMessageDialog(Main.parent,
-                    tr("This area too big to be downloaded"));
+                    tr("This area is too big to be downloaded"));
         }
     }
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 31330)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryExportAction.java	(revision 31331)
@@ -25,5 +25,5 @@
 
 /**
- * Action that launches a MapillaryExportDialog.
+ * Action that launches a MapillaryExportDialog and lets you export the images.
  * 
  * @author nokutu
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 31330)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/CommandTurnImage.java	(revision 31331)
@@ -10,5 +10,5 @@
 
 /**
- * Command created when a image's direction is changed.
+ * Command created when an image's direction is changed.
  * 
  * @author nokutu
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 31330)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/MapillaryRecord.java	(revision 31331)
@@ -6,5 +6,5 @@
 
 /**
- * History record system in order to let you undo commands
+ * History record system in order to let the user undo and redo commands
  * 
  * @author nokutu
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 31330)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryDownloader.java	(revision 31331)
@@ -11,5 +11,6 @@
 
 /**
- * Class that concentrates all the ways of downloading of the plugin.
+ * Class that concentrates all the ways of downloading of the plugin. All the
+ * download petitions will be managed one by one.
  * 
  * @author nokutu
@@ -62,4 +63,9 @@
     }
 
+    /**
+     * Gets the images within the given bounds.
+     * 
+     * @param bounds
+     */
     public void getImages(Bounds bounds) {
         getImages(bounds.getMin(), bounds.getMax());
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 31330)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryExportDownloadThread.java	(revision 31331)
@@ -19,10 +19,10 @@
 /**
  * This is the thread that downloads one of the images that are going to be
- * exported and writes them in a {@link ArrayBlockQueue}.
+ * exported and writes them in a {@link ArrayBlockingQueue}.
  * 
  * @author nokutu
  * @see MapillaryExportManager
  */
-public class MapillaryExportDownloadThread implements Runnable,
+public class MapillaryExportDownloadThread extends Thread implements
         ICachedLoaderListener {
 
@@ -48,5 +48,4 @@
         new MapillaryCache(image.getKey(), MapillaryCache.Type.FULL_IMAGE)
                 .submit(this, false);
-
     }
 
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 31330)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryExportManager.java	(revision 31331)
@@ -21,5 +21,5 @@
 /**
  * Export main thread. Exportation works by creating a
- * {@link MapillaryWriterThread} and several
+ * {@link MapillaryExportWriterThread} and several
  * {@link MapillaryExportDownloadThread}. The second ones download every single
  * image that is going to be exported and stores them in an
@@ -38,4 +38,7 @@
     List<MapillaryAbstractImage> images;
     String path;
+    
+    private Thread writer;
+    private ThreadPoolExecutor ex;
 
     public MapillaryExportManager(List<MapillaryAbstractImage> images,
@@ -72,5 +75,6 @@
     @Override
     protected void cancel() {
-        // TODO Auto-generated method stub
+        writer.interrupt();
+        ex.shutdown();
     }
 
@@ -79,6 +83,6 @@
             OsmTransferException {
         // Starts a writer thread in order to write the pictures on the disk.
-        Thread writer = new Thread(new MapillaryExportWriterThread(path, queue,
-                queueImages, amount, this.getProgressMonitor()));
+        writer = new MapillaryExportWriterThread(path, queue,
+                queueImages, amount, this.getProgressMonitor());
         writer.start();
         if (path == null) {
@@ -90,5 +94,5 @@
             return;
         }
-        ThreadPoolExecutor ex = new ThreadPoolExecutor(20, 35, 25,
+        ex = new ThreadPoolExecutor(20, 35, 25,
                 TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(10));
         for (MapillaryAbstractImage image : images) {
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 31330)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryExportWriterThread.java	(revision 31331)
@@ -32,5 +32,5 @@
  * @see MapillaryExportManager
  */
-public class MapillaryExportWriterThread implements Runnable {
+public class MapillaryExportWriterThread extends Thread {
 
     private final String path;
@@ -103,5 +103,6 @@
                 os.close();
             } catch (InterruptedException e) {
-                Main.error(e);
+                Main.info("Mapillary export cancelled");
+                return;
             } catch (IOException e) {
                 Main.error(e);
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 31330)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryImageInfoDownloaderThread.java	(revision 31331)
@@ -22,7 +22,7 @@
  * 
  * @author nokutu
- * @see MapillarySqueareDownloadManagerThread
+ * @see MapillarySquareDownloadManagerThread
  */
-public class MapillaryImageInfoDownloaderThread implements Runnable {
+public class MapillaryImageInfoDownloaderThread extends Thread {
     private final String url;
     private final ExecutorService ex;
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySequenceDownloadThread.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySequenceDownloadThread.java	(revision 31330)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySequenceDownloadThread.java	(revision 31331)
@@ -27,7 +27,7 @@
  * 
  * @author nokutu
- * @see MapillarySquareDownloadManagarThread
+ * @see MapillarySquareDownloadManagerThread
  */
-public class MapillarySequenceDownloadThread implements Runnable {
+public class MapillarySequenceDownloadThread extends Thread {
 
     private final String url;
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 31330)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySignDownloaderThread.java	(revision 31331)
@@ -17,5 +17,5 @@
 import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;
 
-public class MapillarySignDownloaderThread implements Runnable {
+public class MapillarySignDownloaderThread extends Thread {
 
     private final String url;
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 31330)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySquareDownloadManagerThread.java	(revision 31331)
@@ -21,5 +21,5 @@
  * @see MapillaryDownloader
  */
-public class MapillarySquareDownloadManagerThread implements Runnable {
+public class MapillarySquareDownloadManagerThread extends Thread {
 
     private final String urlImages;
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 31330)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryExportDialog.java	(revision 31331)
@@ -7,4 +7,5 @@
 import java.awt.event.ActionListener;
 
+import javax.swing.AbstractAction;
 import javax.swing.BoxLayout;
 import javax.swing.ButtonGroup;
@@ -16,6 +17,8 @@
 import javax.swing.JRadioButton;
 
+import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
 import org.openstreetmap.josm.plugins.mapillary.MapillaryData;
 import org.openstreetmap.josm.plugins.mapillary.MapillaryImage;
+import org.openstreetmap.josm.plugins.mapillary.MapillaryImportedImage;
 
 /**
@@ -49,10 +52,15 @@
     public MapillaryExportDialog() {
         setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
-
+        
+        RewriteButtonAction action = new RewriteButtonAction(this);
         group = new ButtonGroup();
-        all = new JRadioButton(tr("Export all images"));
-        sequence = new JRadioButton(tr("Export selected sequence"));
-        selected = new JRadioButton(tr("Export selected images"));
-        rewrite = new JRadioButton(tr("Rewrite imported images"));
+        all = new JRadioButton(action);
+        all.setText(tr("Export all images"));
+        sequence = new JRadioButton(action);
+        sequence.setText(tr("Export selected sequence"));
+        selected = new JRadioButton(action);
+        selected.setText(tr("Export selected images"));
+        rewrite = new JRadioButton(action);
+        rewrite.setText(tr("Rewrite imported images"));
         group.add(all);
         group.add(sequence);
@@ -68,4 +76,9 @@
             selected.setEnabled(false);
         }
+        rewrite.setEnabled(false);
+        for (MapillaryAbstractImage img : MapillaryData.getInstance().getImages())
+            if (img instanceof MapillaryImportedImage)
+                rewrite.setEnabled(true);
+        
         path = new JLabel(tr("Select a folder"));
         choose = new JButton(tr("Explore"));
@@ -105,3 +118,27 @@
         }
     }
+    
+    public class RewriteButtonAction extends AbstractAction {
+
+        private String lastPath;
+        private MapillaryExportDialog dlg;
+        
+        public RewriteButtonAction(MapillaryExportDialog dlg) {
+            this.dlg = dlg;
+        }
+        
+        @Override
+        public void actionPerformed(ActionEvent arg0) {
+           choose.setEnabled(!rewrite.isSelected());
+           if (rewrite.isSelected()) {
+               lastPath = dlg.path.getText();
+               dlg.path.setText(" ");
+           } 
+           else if (lastPath != null){
+               dlg.path.setText(lastPath);
+           }
+           
+        }
+        
+    }
 }
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryHistoryDialog.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryHistoryDialog.java	(revision 31330)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryHistoryDialog.java	(revision 31331)
@@ -30,4 +30,12 @@
 import javax.swing.tree.DefaultMutableTreeNode;
 
+/**
+ * Toggle dialog that shows you the latest commands done and allows the user to
+ * revert them.
+ * 
+ * @see MapillaryRecord
+ * @author nokutu
+ *
+ */
 public class MapillaryHistoryDialog extends ToggleDialog implements
         MapillaryRecordListener {
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryImageDisplay.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryImageDisplay.java	(revision 31330)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryImageDisplay.java	(revision 31331)
@@ -28,5 +28,5 @@
  * 
  * @author Jorge
- * @see ImageDisplay
+ * @see MapillaryImageDisplay
  * @see MapillaryToggleDialog
  */
