Index: applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageEntries.java
===================================================================
--- applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageEntries.java	(revision 12588)
+++ applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageEntries.java	(revision 12778)
@@ -15,15 +15,15 @@
 public final class ImageEntries {
     private static final class ImageReadyListener implements
-	    IImageReadyListener {
-	private final ImageEntries imageEntries;
-
-	public ImageReadyListener(final ImageEntries imageEntries) {
-	    this.imageEntries = imageEntries;
-	}
-
-	public final void onImageReady(final ImageEntry imageEntry,
-	    final Image image) {
-	    this.imageEntries.setCurrentImage(imageEntry, image);
-	}
+        IImageReadyListener {
+    private final ImageEntries imageEntries;
+
+    public ImageReadyListener(final ImageEntries imageEntries) {
+        this.imageEntries = imageEntries;
+    }
+
+    public final void onImageReady(final ImageEntry imageEntry,
+        final Image image) {
+        this.imageEntries.setCurrentImage(imageEntry, image);
+    }
     }
 
@@ -39,86 +39,86 @@
 
     private ImageEntries() {
-	this.images = new ArrayList<ImageEntry>();
-	this.locatedImages = new ArrayList<ImageEntry>();
-	this.listeners = new ArrayList<IImageChangeListener>();
-	this.listener = new ImageReadyListener(this);
-
-	this.currentImageEntry = null;
-	this.currentImage = null;
+    this.images = new ArrayList<ImageEntry>();
+    this.locatedImages = new ArrayList<ImageEntry>();
+    this.listeners = new ArrayList<IImageChangeListener>();
+    this.listener = new ImageReadyListener(this);
+
+    this.currentImageEntry = null;
+    this.currentImage = null;
     }
 
     public static final ImageEntries getInstance() {
-	return ImageEntries.INSTANCE;
+    return ImageEntries.INSTANCE;
     }
 
     public final void addListener(final IImageChangeListener listener) {
-	this.listeners.add(listener);
+    this.listeners.add(listener);
     }
 
     public final void removeListener(final IImageChangeListener listener) {
-	this.listeners.remove(listener);
+    this.listeners.remove(listener);
     }
 
     public final void add(final File[] imageFiles) {
-	if (null != imageFiles) {
-	    for (int index = 0; index < imageFiles.length; index++) {
-		this.images.add(new ImageEntry(imageFiles[index]));
-	    }
-	    this.associateAllLayers();
-	}
+    if (null != imageFiles) {
+        for (int index = 0; index < imageFiles.length; index++) {
+        this.images.add(new ImageEntry(imageFiles[index]));
+        }
+        this.associateAllLayers();
+    }
     }
 
     public final void associateAllLayers() {
-	for (int index = 0; index < this.images.size(); index++) {
-	    this.images.get(index).setWayPoint(null);
-	}
-	this.locatedImages.clear();
-
-	if (null != Main.map && null != Main.map.mapView) {
-	    final Collection<Layer> layerCollection = Main.map.mapView.getAllLayers();
-	    final Layer[] layers = layerCollection.toArray(new Layer[layerCollection.size()]);
-
-	    for (int index = 0; index < layers.length; index++) {
-		if (layers[index] instanceof GpxLayer
-			&& null != ((GpxLayer) layers[index]).data
-			&& !((GpxLayer) layers[index]).data.fromServer) {
-		    this.doAssociateLayer((GpxLayer) layers[index]);
-		}
-	    }
-
-	    for (IImageChangeListener listener : this.listeners) {
-		listener.onSelectedImageEntryChanged(this);
-	    }
-	}
+    for (int index = 0; index < this.images.size(); index++) {
+        this.images.get(index).setWayPoint(null);
+    }
+    this.locatedImages.clear();
+
+    if (null != Main.map && null != Main.map.mapView) {
+        final Collection<Layer> layerCollection = Main.map.mapView.getAllLayers();
+        final Layer[] layers = layerCollection.toArray(new Layer[layerCollection.size()]);
+
+        for (int index = 0; index < layers.length; index++) {
+        if (layers[index] instanceof GpxLayer
+            && null != ((GpxLayer) layers[index]).data
+            && !((GpxLayer) layers[index]).data.fromServer) {
+            this.doAssociateLayer((GpxLayer) layers[index]);
+        }
+        }
+
+        for (IImageChangeListener listener : this.listeners) {
+        listener.onSelectedImageEntryChanged(this);
+        }
+    }
     }
 
     private final void doAssociateLayer(final GpxLayer gpxLayer) {
-	if (null != gpxLayer && null != gpxLayer.data
-		&& !gpxLayer.data.fromServer) {
-	    for (WayPoint wayPoint : gpxLayer.data.waypoints) {
-		final List<String> texts = this.getTextContentsFromWayPoint(wayPoint);
-
-		for (String text : texts) {
-		    final ImageEntry image = this.findImageEntryWithFileName(text);
-		    if (null != image) {
-			image.setWayPoint(wayPoint);
-			this.locatedImages.add(image);
-		    }
-		}
-	    }
-	}
+    if (null != gpxLayer && null != gpxLayer.data
+        && !gpxLayer.data.fromServer) {
+        for (WayPoint wayPoint : gpxLayer.data.waypoints) {
+        final List<String> texts = this.getTextContentsFromWayPoint(wayPoint);
+
+        for (String text : texts) {
+            final ImageEntry image = this.findImageEntryWithFileName(text);
+            if (null != image) {
+            image.setWayPoint(wayPoint);
+            this.locatedImages.add(image);
+            }
+        }
+        }
+    }
     }
 
     private final List<String> getTextContentsFromWayPoint(
-	final WayPoint wayPoint) {
-	final List<String> texts = new ArrayList<String>();
-	for(String s : new String[]{"name", "cmt", "desc"})
-	{
-		String t = wayPoint.getString(s);
-		if(null != t && 0 < t.length())
-			texts.add(t);
-	}
-
-	return texts;
+    final WayPoint wayPoint) {
+    final List<String> texts = new ArrayList<String>();
+    for(String s : new String[]{"name", "cmt", "desc"})
+    {
+        String t = wayPoint.getString(s);
+        if(null != t && 0 < t.length())
+            texts.add(t);
+    }
+
+    return texts;
     }
 
@@ -134,98 +134,98 @@
 
     private final ImageEntry findImageEntryWithFileName(final String fileName) {
-	ImageEntry foundimage = null;
-
-	for (int index = 0; index < this.images.size() && null == foundimage; index++) {
-	    final ImageEntry image = this.images.get(index);
-	    if (null == image.getWayPoint()
-		    && image.getFileName().startsWith(fileName)) {
-		foundimage = image;
-	    }
-	}
-
-	return foundimage;
+    ImageEntry foundimage = null;
+
+    for (int index = 0; index < this.images.size() && null == foundimage; index++) {
+        final ImageEntry image = this.images.get(index);
+        if (null == image.getWayPoint()
+            && image.getFileName().startsWith(fileName)) {
+        foundimage = image;
+        }
+    }
+
+    return foundimage;
     }
 
     private final void setCurrentImage(final ImageEntry imageEntry,
-	final Image image) {
-	if (imageEntry == this.currentImageEntry) {
-	    this.currentImage = image;
-	}
-
-	for (IImageChangeListener listener : this.listeners) {
-	    listener.onSelectedImageEntryChanged(this);
-	}
+    final Image image) {
+    if (imageEntry == this.currentImageEntry) {
+        this.currentImage = image;
+    }
+
+    for (IImageChangeListener listener : this.listeners) {
+        listener.onSelectedImageEntryChanged(this);
+    }
     }
 
     public final ImageEntry[] getImages() {
-	return this.locatedImages.toArray(new ImageEntry[this.locatedImages.size()]);
+    return this.locatedImages.toArray(new ImageEntry[this.locatedImages.size()]);
     }
 
     public final ImageEntry getCurrentImageEntry() {
-	return this.currentImageEntry;
+    return this.currentImageEntry;
     }
 
     public final Image getCurrentImage() {
-	return this.currentImage;
+    return this.currentImage;
     }
 
     public final boolean hasNext() {
-	return null != this.currentImageEntry
-		&& this.locatedImages.indexOf(this.currentImageEntry) < this.locatedImages.size() - 1;
+    return null != this.currentImageEntry
+        && this.locatedImages.indexOf(this.currentImageEntry) < this.locatedImages.size() - 1;
     }
 
     public final boolean hasPrevious() {
-	return null != this.currentImageEntry
-		&& this.locatedImages.indexOf(this.currentImageEntry) > 0;
+    return null != this.currentImageEntry
+        && this.locatedImages.indexOf(this.currentImageEntry) > 0;
     }
 
     public final void next() {
-	if (null != this.currentImageEntry
-		&& this.locatedImages.indexOf(this.currentImageEntry) < this.locatedImages.size() - 1) {
-	    this.setCurrentImageEntry(this.locatedImages.get(this.locatedImages.indexOf(this.currentImageEntry) + 1));
-	}
+    if (null != this.currentImageEntry
+        && this.locatedImages.indexOf(this.currentImageEntry) < this.locatedImages.size() - 1) {
+        this.setCurrentImageEntry(this.locatedImages.get(this.locatedImages.indexOf(this.currentImageEntry) + 1));
+    }
     }
 
     public final void previous() {
-	if (null != this.currentImageEntry
-		&& this.locatedImages.indexOf(this.currentImageEntry) > 0) {
-	    this.setCurrentImageEntry(this.locatedImages.get(this.locatedImages.indexOf(this.currentImageEntry) - 1));
-	}
+    if (null != this.currentImageEntry
+        && this.locatedImages.indexOf(this.currentImageEntry) > 0) {
+        this.setCurrentImageEntry(this.locatedImages.get(this.locatedImages.indexOf(this.currentImageEntry) - 1));
+    }
     }
 
     public final void rotateCurrentImageLeft() {
-	if (null != this.currentImageEntry) {
-	    this.currentImageEntry.setOrientation(this.currentImageEntry.getOrientation()
-		.rotateLeft());
-	}
-
-	this.setCurrentImageEntry(this.currentImageEntry);
+    if (null != this.currentImageEntry) {
+        this.currentImageEntry.setOrientation(this.currentImageEntry.getOrientation()
+        .rotateLeft());
+    }
+
+    this.setCurrentImageEntry(this.currentImageEntry);
     }
 
     public final void rotateCurrentImageRight() {
-	if (null != this.currentImageEntry) {
-	    this.currentImageEntry.setOrientation(this.currentImageEntry.getOrientation()
-		.rotateRight());
-	}
-
-	this.setCurrentImageEntry(this.currentImageEntry);
+    if (null != this.currentImageEntry) {
+        this.currentImageEntry.setOrientation(this.currentImageEntry.getOrientation()
+        .rotateRight());
+    }
+
+    this.setCurrentImageEntry(this.currentImageEntry);
     }
 
     public final void setCurrentImageEntry(final ImageEntry imageEntry) {
-	if (null == imageEntry || this.locatedImages.contains(imageEntry)) {
-	    if (null != this.currentImageEntry) {
-		this.currentImageEntry.flush();
-	    }
-
-	    this.currentImageEntry = imageEntry;
-	    this.currentImage = null;
-
-	    for (IImageChangeListener listener : this.listeners) {
-		listener.onSelectedImageEntryChanged(this);
-	    }
-
-	    // now try to get the image
-	    this.currentImageEntry.requestImage(this.listener);
-	}
+    if (null == imageEntry || this.locatedImages.contains(imageEntry)) {
+        if (null != this.currentImageEntry) {
+        this.currentImageEntry.flush();
+        }
+
+        this.currentImageEntry = imageEntry;
+        this.currentImage = null;
+
+        for (IImageChangeListener listener : this.listeners) {
+        listener.onSelectedImageEntryChanged(this);
+        }
+
+        // now try to get the image
+        this.currentImageEntry.requestImage(this.listener);
+    }
     }
 }
Index: applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageEntry.java
===================================================================
--- applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageEntry.java	(revision 12588)
+++ applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageEntry.java	(revision 12778)
@@ -1,4 +1,4 @@
 /**
- * 
+ *
  */
 package org.insignificant.josm.plugins.imagewaypoint;
@@ -23,72 +23,72 @@
 public final class ImageEntry implements Comparable<ImageEntry> {
     public interface IImageReadyListener {
-	void onImageReady(ImageEntry imageEntry, Image image);
+    void onImageReady(ImageEntry imageEntry, Image image);
     }
 
     private static final class Observer implements ImageObserver {
-	private final ImageEntry imageEntry;
-
-	public Observer(final ImageEntry imageEntry) {
-	    this.imageEntry = imageEntry;
-	}
-
-	/**
-	 * @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int,
-	 *      int, int, int, int)
-	 * @return true if this ImageObserver still wants to be updates about
-	 *         image loading progress
-	 */
-	public final boolean imageUpdate(final Image image,
-	    final int infoflags, final int x, final int y, final int width,
-	    final int height) {
-	    final boolean complete = ImageObserver.ALLBITS == (infoflags | ImageObserver.ALLBITS);
-	    if (complete) {
-		this.imageEntry.imageLoaded(image);
-	    }
-
-	    return !complete;
-	}
+    private final ImageEntry imageEntry;
+
+    public Observer(final ImageEntry imageEntry) {
+        this.imageEntry = imageEntry;
+    }
+
+    /**
+     * @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int,
+     *      int, int, int, int)
+     * @return true if this ImageObserver still wants to be updates about
+     *         image loading progress
+     */
+    public final boolean imageUpdate(final Image image,
+        final int infoflags, final int x, final int y, final int width,
+        final int height) {
+        final boolean complete = ImageObserver.ALLBITS == (infoflags | ImageObserver.ALLBITS);
+        if (complete) {
+        this.imageEntry.imageLoaded(image);
+        }
+
+        return !complete;
+    }
     }
 
     public static final class Orientation {
-	private static final Orientation[] orientations = new Orientation[4];
-
-	public static final Orientation NORMAL = new Orientation(tr("Normal"), 0);
-	public static final Orientation ROTATE_90 = new Orientation(tr("Rotate 90"),
-	    1);
-	public static final Orientation ROTATE_180 = new Orientation(tr("Rotate 180"),
-	    2);
-	public static final Orientation ROTATE_270 = new Orientation(tr("Rotate 270"),
-	    3);
-
-	private final String name;
-	private final int index;
-
-	private Orientation(final String name, final int index) {
-	    this.name = name;
-	    this.index = index;
-	    Orientation.orientations[index] = this;
-	}
-
-	public final Orientation rotateRight() {
-	    if (this.index < Orientation.orientations.length - 1) {
-		return Orientation.orientations[this.index + 1];
-	    } else {
-		return Orientation.orientations[0];
-	    }
-	}
-
-	public final Orientation rotateLeft() {
-	    if (this.index == 0) {
-		return Orientation.orientations[Orientation.orientations.length - 1];
-	    } else {
-		return Orientation.orientations[this.index - 1];
-	    }
-	}
-
-	@Override
-	public String toString() {
-	    return "[" + this.name + "]";
-	}
+    private static final Orientation[] orientations = new Orientation[4];
+
+    public static final Orientation NORMAL = new Orientation(tr("Normal"), 0);
+    public static final Orientation ROTATE_90 = new Orientation(tr("Rotate 90"),
+        1);
+    public static final Orientation ROTATE_180 = new Orientation(tr("Rotate 180"),
+        2);
+    public static final Orientation ROTATE_270 = new Orientation(tr("Rotate 270"),
+        3);
+
+    private final String name;
+    private final int index;
+
+    private Orientation(final String name, final int index) {
+        this.name = name;
+        this.index = index;
+        Orientation.orientations[index] = this;
+    }
+
+    public final Orientation rotateRight() {
+        if (this.index < Orientation.orientations.length - 1) {
+        return Orientation.orientations[this.index + 1];
+        } else {
+        return Orientation.orientations[0];
+        }
+    }
+
+    public final Orientation rotateLeft() {
+        if (this.index == 0) {
+        return Orientation.orientations[Orientation.orientations.length - 1];
+        } else {
+        return Orientation.orientations[this.index - 1];
+        }
+    }
+
+    @Override
+    public String toString() {
+        return "[" + this.name + "]";
+    }
     }
 
@@ -108,153 +108,153 @@
 
     public ImageEntry(final File file) {
-	this.filePath = file.getAbsolutePath();
-	this.fileName = file.getName();
-	this.observer = new Observer(this);
-
-	this.wayPoint = null;
-	this.orientation = Orientation.NORMAL;
-	this.listener = null;
-	this.normalImage = null;
-	this.rotatedImage = null;
+    this.filePath = file.getAbsolutePath();
+    this.fileName = file.getName();
+    this.observer = new Observer(this);
+
+    this.wayPoint = null;
+    this.orientation = Orientation.NORMAL;
+    this.listener = null;
+    this.normalImage = null;
+    this.rotatedImage = null;
     }
 
     public final int compareTo(final ImageEntry image) {
-	return this.fileName.compareTo(image.fileName);
+    return this.fileName.compareTo(image.fileName);
     }
 
     public final String getFileName() {
-	return fileName;
+    return fileName;
     }
 
     public final WayPoint getWayPoint() {
-	return wayPoint;
+    return wayPoint;
     }
 
     public final void setWayPoint(final WayPoint wayPoint) {
-	this.wayPoint = wayPoint;
+    this.wayPoint = wayPoint;
     }
 
     public final Orientation getOrientation() {
-	return orientation;
+    return orientation;
     }
 
     public final void setOrientation(final Orientation orientation) {
-	this.orientation = orientation;
-	this.normalImage = null;
-	this.rotatedImage = null;
+    this.orientation = orientation;
+    this.normalImage = null;
+    this.rotatedImage = null;
     }
 
     public final Rectangle getBounds(final MapView mapView) {
-	final Rectangle bounds;
-
-	if (null == this.wayPoint) {
-	    bounds = null;
-	} else {
-	    final Point point = mapView.getPoint(this.getWayPoint().eastNorth);
-	    bounds = new Rectangle(point.x - ImageEntry.ICON_WIDTH,
-		point.y - ImageEntry.ICON_HEIGHT,
-		ImageEntry.ICON_WIDTH,
-		ImageEntry.ICON_WIDTH);
-	}
-
-	return bounds;
+    final Rectangle bounds;
+
+    if (null == this.wayPoint) {
+        bounds = null;
+    } else {
+        final Point point = mapView.getPoint(this.getWayPoint().eastNorth);
+        bounds = new Rectangle(point.x - ImageEntry.ICON_WIDTH,
+        point.y - ImageEntry.ICON_HEIGHT,
+        ImageEntry.ICON_WIDTH,
+        ImageEntry.ICON_WIDTH);
+    }
+
+    return bounds;
     }
 
     public final void requestImage(final IImageReadyListener imageReadyListener) {
-	this.listener = imageReadyListener;
-
-	if (null == this.rotatedImage) {
-	    final Image image = Toolkit.getDefaultToolkit()
-		.getImage(this.filePath);
-	    if (Toolkit.getDefaultToolkit().prepareImage(image,
-		-1,
-		-1,
-		this.observer)) {
-		this.imageLoaded(image);
-	    }
-	} else if (null != this.listener) {
-	    this.listener.onImageReady(this, this.rotatedImage);
-	}
+    this.listener = imageReadyListener;
+
+    if (null == this.rotatedImage) {
+        final Image image = Toolkit.getDefaultToolkit()
+        .getImage(this.filePath);
+        if (Toolkit.getDefaultToolkit().prepareImage(image,
+        -1,
+        -1,
+        this.observer)) {
+        this.imageLoaded(image);
+        }
+    } else if (null != this.listener) {
+        this.listener.onImageReady(this, this.rotatedImage);
+    }
     }
 
     public final void flush() {
-	if (null != this.normalImage) {
-	    this.normalImage.flush();
-	    this.normalImage = null;
-	}
-
-	if (null != this.rotatedImage) {
-	    this.rotatedImage.flush();
-	    this.rotatedImage = null;
-	}
+    if (null != this.normalImage) {
+        this.normalImage.flush();
+        this.normalImage = null;
+    }
+
+    if (null != this.rotatedImage) {
+        this.rotatedImage.flush();
+        this.rotatedImage = null;
+    }
     }
 
     private final void imageLoaded(final Image image) {
-	if (Orientation.NORMAL == this.getOrientation()) {
-	    this.rotatedImage = image;
-	} else {
-	    final int[] buffer = new int[image.getWidth(null)
-		    * image.getHeight(null)];
-	    PixelGrabber grabber = new PixelGrabber(image,
-		0,
-		0,
-		image.getWidth(null),
-		image.getHeight(null),
-		buffer,
-		0,
-		image.getWidth(null));
-	    try {
-		grabber.grabPixels();
-
-		final int newHeight;
-		final int newWidth;
-
-		if (Orientation.ROTATE_180 == this.getOrientation()) {
-		    newHeight = image.getHeight(null);
-		    newWidth = image.getWidth(null);
-		} else {
-		    newHeight = image.getWidth(null);
-		    newWidth = image.getHeight(null);
-		}
-
-		final int[] destination = new int[image.getWidth(null)
-			* image.getHeight(null)];
-		for (int x = 0; x < image.getWidth(null); x++) {
-		    for (int y = 0; y < image.getHeight(null); y++) {
-			final int pix = buffer[x + (y * image.getWidth(null))];
-			final int newX;
-			final int newY;
-			if (Orientation.ROTATE_90 == this.getOrientation()) {
-			    newX = newWidth - y;
-			    newY = x;
-			} else if (Orientation.ROTATE_180 == this.getOrientation()) {
-			    newX = newWidth - x;
-			    newY = newHeight - y;
-			} else { // Orientation.ROTATE_270 ==
-			    // this.getOrientation()
-			    newX = y;
-			    newY = newHeight - x;
-			}
-			final int newIndex = newX + (newY * newWidth);
-			if (newIndex < destination.length) {
-			    destination[newIndex] = pix;
-			}
-		    }
-		}
-
-		this.rotatedImage = Toolkit.getDefaultToolkit()
-		    .createImage(new MemoryImageSource(newWidth,
-			newHeight,
-			destination,
-			0,
-			newWidth));
-	    } catch (final InterruptedException e) {
-		this.rotatedImage = null;
-	    }
-	}
-
-	if (null != this.listener) {
-	    this.listener.onImageReady(this, this.rotatedImage);
-	}
+    if (Orientation.NORMAL == this.getOrientation()) {
+        this.rotatedImage = image;
+    } else {
+        final int[] buffer = new int[image.getWidth(null)
+            * image.getHeight(null)];
+        PixelGrabber grabber = new PixelGrabber(image,
+        0,
+        0,
+        image.getWidth(null),
+        image.getHeight(null),
+        buffer,
+        0,
+        image.getWidth(null));
+        try {
+        grabber.grabPixels();
+
+        final int newHeight;
+        final int newWidth;
+
+        if (Orientation.ROTATE_180 == this.getOrientation()) {
+            newHeight = image.getHeight(null);
+            newWidth = image.getWidth(null);
+        } else {
+            newHeight = image.getWidth(null);
+            newWidth = image.getHeight(null);
+        }
+
+        final int[] destination = new int[image.getWidth(null)
+            * image.getHeight(null)];
+        for (int x = 0; x < image.getWidth(null); x++) {
+            for (int y = 0; y < image.getHeight(null); y++) {
+            final int pix = buffer[x + (y * image.getWidth(null))];
+            final int newX;
+            final int newY;
+            if (Orientation.ROTATE_90 == this.getOrientation()) {
+                newX = newWidth - y;
+                newY = x;
+            } else if (Orientation.ROTATE_180 == this.getOrientation()) {
+                newX = newWidth - x;
+                newY = newHeight - y;
+            } else { // Orientation.ROTATE_270 ==
+                // this.getOrientation()
+                newX = y;
+                newY = newHeight - x;
+            }
+            final int newIndex = newX + (newY * newWidth);
+            if (newIndex < destination.length) {
+                destination[newIndex] = pix;
+            }
+            }
+        }
+
+        this.rotatedImage = Toolkit.getDefaultToolkit()
+            .createImage(new MemoryImageSource(newWidth,
+            newHeight,
+            destination,
+            0,
+            newWidth));
+        } catch (final InterruptedException e) {
+        this.rotatedImage = null;
+        }
+    }
+
+    if (null != this.listener) {
+        this.listener.onImageReady(this, this.rotatedImage);
+    }
     }
 }
Index: applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageWayPointDialog.java
===================================================================
--- applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageWayPointDialog.java	(revision 12588)
+++ applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageWayPointDialog.java	(revision 12778)
@@ -23,153 +23,153 @@
 public final class ImageWayPointDialog {
     private static final class ImageComponent extends JComponent {
-	private static final long serialVersionUID = -5207198660736375133L;
-
-	private Image image;
-
-	public ImageComponent() {
-	    this.image = null;
-	}
-
-	@Override
-	public final void paint(final Graphics g) {
-	    if (null == this.image || 0 >= this.image.getWidth(null)
-		    || 0 >= this.image.getHeight(null)) {
-		g.setColor(Color.white);
-		g.fillRect(0, 0, this.getSize().width, this.getSize().height);
-	    } else {
-		final int maxWidth = this.getSize().width;
-		final int maxHeight = this.getSize().height;
-		final int imageWidth = this.image.getWidth(null);
-		final int imageHeight = this.image.getHeight(null);
-
-		final double aspect = 1.0 * imageWidth / imageHeight;
-
-		// what's the width if the height is 100%?
-		final int widthIfHeightIsMax = (int) (aspect * maxHeight);
-
-		// now find the real width and height
-		final int resizedWidth;
-		final int resizedHeight;
-		if (widthIfHeightIsMax > maxWidth) {
-		    // oops - burst the width - so width should be the max, and
-		    // work out the resulting height
-		    resizedWidth = maxWidth;
-		    resizedHeight = (int) (resizedWidth / aspect);
-		} else {
-		    // that'll do...
-		    resizedWidth = widthIfHeightIsMax;
-		    resizedHeight = maxHeight;
-		}
-
-		g.drawImage(this.image,
-		    (maxWidth - resizedWidth) / 2,
-		    (maxHeight - resizedHeight) / 2,
-		    resizedWidth,
-		    resizedHeight,
-		    Color.black,
-		    null);
-	    }
-	}
-
-	public final void setImage(final Image image) {
-	    this.image = image;
-	    this.repaint();
-	}
+    private static final long serialVersionUID = -5207198660736375133L;
+
+    private Image image;
+
+    public ImageComponent() {
+        this.image = null;
+    }
+
+    @Override
+    public final void paint(final Graphics g) {
+        if (null == this.image || 0 >= this.image.getWidth(null)
+            || 0 >= this.image.getHeight(null)) {
+        g.setColor(Color.white);
+        g.fillRect(0, 0, this.getSize().width, this.getSize().height);
+        } else {
+        final int maxWidth = this.getSize().width;
+        final int maxHeight = this.getSize().height;
+        final int imageWidth = this.image.getWidth(null);
+        final int imageHeight = this.image.getHeight(null);
+
+        final double aspect = 1.0 * imageWidth / imageHeight;
+
+        // what's the width if the height is 100%?
+        final int widthIfHeightIsMax = (int) (aspect * maxHeight);
+
+        // now find the real width and height
+        final int resizedWidth;
+        final int resizedHeight;
+        if (widthIfHeightIsMax > maxWidth) {
+            // oops - burst the width - so width should be the max, and
+            // work out the resulting height
+            resizedWidth = maxWidth;
+            resizedHeight = (int) (resizedWidth / aspect);
+        } else {
+            // that'll do...
+            resizedWidth = widthIfHeightIsMax;
+            resizedHeight = maxHeight;
+        }
+
+        g.drawImage(this.image,
+            (maxWidth - resizedWidth) / 2,
+            (maxHeight - resizedHeight) / 2,
+            resizedWidth,
+            resizedHeight,
+            Color.black,
+            null);
+        }
+    }
+
+    public final void setImage(final Image image) {
+        this.image = image;
+        this.repaint();
+    }
     }
 
     private static final class ImageChangeListener implements
-	    IImageChangeListener {
-	private final ImageWayPointDialog dialog;
-
-	public ImageChangeListener(final ImageWayPointDialog dialog) {
-	    this.dialog = dialog;
-	}
-
-	public final void onAvailableImageEntriesChanged(
-	    final ImageEntries entries) {
-	    this.dialog.imageDisplay.setImage(entries.getCurrentImage());
-	    this.dialog.updateUI();
-	}
-
-	public final void onSelectedImageEntryChanged(final ImageEntries entries) {
-	    this.dialog.imageDisplay.setImage(entries.getCurrentImage());
-	    this.dialog.updateUI();
-	}
+        IImageChangeListener {
+    private final ImageWayPointDialog dialog;
+
+    public ImageChangeListener(final ImageWayPointDialog dialog) {
+        this.dialog = dialog;
+    }
+
+    public final void onAvailableImageEntriesChanged(
+        final ImageEntries entries) {
+        this.dialog.imageDisplay.setImage(entries.getCurrentImage());
+        this.dialog.updateUI();
+    }
+
+    public final void onSelectedImageEntryChanged(final ImageEntries entries) {
+        this.dialog.imageDisplay.setImage(entries.getCurrentImage());
+        this.dialog.updateUI();
+    }
     }
 
     private static final class PreviousAction extends JosmAction {
-	private static final long serialVersionUID = -7899209365124237890L;
-
-	private final ImageWayPointDialog dialog;
-
-	public PreviousAction(final ImageWayPointDialog dialog) {
-	    super(tr("Previous"),
-		null,
-		tr("Previous image"),
-		null,
-		false);
-	    this.dialog = dialog;
-	}
-
-	public final void actionPerformed(final ActionEvent actionEvent) {
-	    if (ImageEntries.getInstance().hasPrevious()) {
-		ImageEntries.getInstance().previous();
-	    }
-	}
+    private static final long serialVersionUID = -7899209365124237890L;
+
+    private final ImageWayPointDialog dialog;
+
+    public PreviousAction(final ImageWayPointDialog dialog) {
+        super(tr("Previous"),
+        null,
+        tr("Previous image"),
+        null,
+        false);
+        this.dialog = dialog;
+    }
+
+    public final void actionPerformed(final ActionEvent actionEvent) {
+        if (ImageEntries.getInstance().hasPrevious()) {
+        ImageEntries.getInstance().previous();
+        }
+    }
     }
 
     private static final class NextAction extends JosmAction {
-	private static final long serialVersionUID = 176134010956760988L;
-
-	private final ImageWayPointDialog dialog;
-
-	public NextAction(final ImageWayPointDialog dialog) {
-	    super(tr("Next"), null, tr("Next image"), null, false);
-	    this.dialog = dialog;
-	}
-
-	public final void actionPerformed(final ActionEvent actionEvent) {
-	    if (ImageEntries.getInstance().hasNext()) {
-		ImageEntries.getInstance().next();
-	    }
-	}
+    private static final long serialVersionUID = 176134010956760988L;
+
+    private final ImageWayPointDialog dialog;
+
+    public NextAction(final ImageWayPointDialog dialog) {
+        super(tr("Next"), null, tr("Next image"), null, false);
+        this.dialog = dialog;
+    }
+
+    public final void actionPerformed(final ActionEvent actionEvent) {
+        if (ImageEntries.getInstance().hasNext()) {
+        ImageEntries.getInstance().next();
+        }
+    }
     }
 
     private static final class RotateLeftAction extends JosmAction {
-	private static final long serialVersionUID = 3536922796446259943L;
-
-	private final ImageWayPointDialog dialog;
-
-	public RotateLeftAction(final ImageWayPointDialog dialog) {
-	    super(tr("Rotate left"),
-		null,
-		tr("Rotate image left"),
-		null,
-		false);
-	    this.dialog = dialog;
-	}
-
-	public final void actionPerformed(final ActionEvent actionEvent) {
-	    ImageEntries.getInstance().rotateCurrentImageLeft();
-	}
+    private static final long serialVersionUID = 3536922796446259943L;
+
+    private final ImageWayPointDialog dialog;
+
+    public RotateLeftAction(final ImageWayPointDialog dialog) {
+        super(tr("Rotate left"),
+        null,
+        tr("Rotate image left"),
+        null,
+        false);
+        this.dialog = dialog;
+    }
+
+    public final void actionPerformed(final ActionEvent actionEvent) {
+        ImageEntries.getInstance().rotateCurrentImageLeft();
+    }
     }
 
     private static final class RotateRightAction extends JosmAction {
-	private static final long serialVersionUID = 1760186810341888993L;
-
-	private final ImageWayPointDialog dialog;
-
-	public RotateRightAction(final ImageWayPointDialog dialog) {
-	    super(tr("Rotate right"),
-		null,
-		tr("Rotate image right"),
-		null,
-		false);
-	    this.dialog = dialog;
-	}
-
-	public final void actionPerformed(final ActionEvent actionEvent) {
-	    ImageEntries.getInstance().rotateCurrentImageRight();
-	}
+    private static final long serialVersionUID = 1760186810341888993L;
+
+    private final ImageWayPointDialog dialog;
+
+    public RotateRightAction(final ImageWayPointDialog dialog) {
+        super(tr("Rotate right"),
+        null,
+        tr("Rotate image right"),
+        null,
+        false);
+        this.dialog = dialog;
+    }
+
+    public final void actionPerformed(final ActionEvent actionEvent) {
+        ImageEntries.getInstance().rotateCurrentImageRight();
+    }
     }
 
@@ -185,61 +185,61 @@
 
     private ImageWayPointDialog() {
-	this.dialog = new ToggleDialog(tr("WayPoint Image"),
-	    "imagewaypoint",
-	    tr("Display non-geotagged photos"),
-	    Shortcut.registerShortcut("subwindow:imagewaypoint", tr("Toggle: {0}", tr("WayPoint Image")),
-	    KeyEvent.VK_Y, Shortcut.GROUP_LAYER),
-	    200);
-
-	this.previousAction = new PreviousAction(this);
-	this.nextAction = new NextAction(this);
-	this.rotateLeftAction = new RotateLeftAction(this);
-	this.rotateRightAction = new RotateRightAction(this);
-
-	final JButton previousButton = new JButton(this.previousAction);
-	final JButton nextButton = new JButton(this.nextAction);
-	final JButton rotateLeftButton = new JButton(this.rotateLeftAction);
-	final JButton rotateRightButton = new JButton(this.rotateRightAction);
-
-	// default layout, FlowLayout, is fine
-	final JPanel buttonPanel = new JPanel();
-	buttonPanel.add(previousButton);
-	buttonPanel.add(nextButton);
-	buttonPanel.add(rotateLeftButton);
-	buttonPanel.add(rotateRightButton);
-
-	final JPanel mainPanel = new JPanel();
-	mainPanel.setLayout(new BorderLayout());
-
-	this.imageDisplay = new ImageComponent();
-	mainPanel.add(buttonPanel, BorderLayout.SOUTH);
-	mainPanel.add(this.imageDisplay, BorderLayout.CENTER);
-
-	this.listener = new ImageChangeListener(this);
-	ImageEntries.getInstance().addListener(this.listener);
-
-	this.updateUI();
-	dialog.add(mainPanel);
+    this.dialog = new ToggleDialog(tr("WayPoint Image"),
+        "imagewaypoint",
+        tr("Display non-geotagged photos"),
+        Shortcut.registerShortcut("subwindow:imagewaypoint", tr("Toggle: {0}", tr("WayPoint Image")),
+        KeyEvent.VK_Y, Shortcut.GROUP_LAYER),
+        200);
+
+    this.previousAction = new PreviousAction(this);
+    this.nextAction = new NextAction(this);
+    this.rotateLeftAction = new RotateLeftAction(this);
+    this.rotateRightAction = new RotateRightAction(this);
+
+    final JButton previousButton = new JButton(this.previousAction);
+    final JButton nextButton = new JButton(this.nextAction);
+    final JButton rotateLeftButton = new JButton(this.rotateLeftAction);
+    final JButton rotateRightButton = new JButton(this.rotateRightAction);
+
+    // default layout, FlowLayout, is fine
+    final JPanel buttonPanel = new JPanel();
+    buttonPanel.add(previousButton);
+    buttonPanel.add(nextButton);
+    buttonPanel.add(rotateLeftButton);
+    buttonPanel.add(rotateRightButton);
+
+    final JPanel mainPanel = new JPanel();
+    mainPanel.setLayout(new BorderLayout());
+
+    this.imageDisplay = new ImageComponent();
+    mainPanel.add(buttonPanel, BorderLayout.SOUTH);
+    mainPanel.add(this.imageDisplay, BorderLayout.CENTER);
+
+    this.listener = new ImageChangeListener(this);
+    ImageEntries.getInstance().addListener(this.listener);
+
+    this.updateUI();
+    dialog.add(mainPanel);
     }
 
     private final void updateUI() {
-	this.previousAction.setEnabled(ImageEntries.getInstance().hasPrevious());
-	this.nextAction.setEnabled(ImageEntries.getInstance().hasNext());
-	this.rotateLeftAction.setEnabled(null != ImageEntries.getInstance()
-	    .getCurrentImageEntry());
-	this.rotateRightAction.setEnabled(null != ImageEntries.getInstance()
-	    .getCurrentImageEntry());
-
-	if (null != Main.map) {
-	    Main.map.repaint();
-	}
+    this.previousAction.setEnabled(ImageEntries.getInstance().hasPrevious());
+    this.nextAction.setEnabled(ImageEntries.getInstance().hasNext());
+    this.rotateLeftAction.setEnabled(null != ImageEntries.getInstance()
+        .getCurrentImageEntry());
+    this.rotateRightAction.setEnabled(null != ImageEntries.getInstance()
+        .getCurrentImageEntry());
+
+    if (null != Main.map) {
+        Main.map.repaint();
+    }
     }
 
     public static ImageWayPointDialog getInstance() {
-	return ImageWayPointDialog.INSTANCE;
+    return ImageWayPointDialog.INSTANCE;
     }
 
     public final ToggleDialog getDisplayComponent() {
-	return this.dialog;
+    return this.dialog;
     }
 }
Index: applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageWayPointLayer.java
===================================================================
--- applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageWayPointLayer.java	(revision 12588)
+++ applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageWayPointLayer.java	(revision 12778)
@@ -20,50 +20,50 @@
 public final class ImageWayPointLayer extends Layer {
     private static final class ImageWayPointMouseListener extends MouseAdapter {
-	private final ImageWayPointLayer layer;
+    private final ImageWayPointLayer layer;
 
-	public ImageWayPointMouseListener(final ImageWayPointLayer layer) {
-	    this.layer = layer;
-	}
+    public ImageWayPointMouseListener(final ImageWayPointLayer layer) {
+        this.layer = layer;
+    }
 
-	@Override
-	public final void mouseClicked(final MouseEvent event) {
-	    if (MouseEvent.BUTTON1 == event.getButton() && this.layer.visible) {
-		final ImageEntry[] images = ImageEntries.getInstance()
-		    .getImages();
+    @Override
+    public final void mouseClicked(final MouseEvent event) {
+        if (MouseEvent.BUTTON1 == event.getButton() && this.layer.visible) {
+        final ImageEntry[] images = ImageEntries.getInstance()
+            .getImages();
 
-		if (null != images) {
-		    boolean found = false;
-		    // Note: the images are checked in the *reverse* order to
-		    // which they're painted - this means than an image which
-		    // partly obscures another will match the click first
-		    for (int index = images.length - 1; !found && index >= 0; index--) {
-			final Rectangle bounds = images[index].getBounds(Main.map.mapView);
-			if (null != bounds && bounds.contains(event.getPoint())) {
-			    found = true;
-			    ImageEntries.getInstance()
-				.setCurrentImageEntry(images[index]);
-			}
-		    }
-		}
-	    }
-	}
+        if (null != images) {
+            boolean found = false;
+            // Note: the images are checked in the *reverse* order to
+            // which they're painted - this means than an image which
+            // partly obscures another will match the click first
+            for (int index = images.length - 1; !found && index >= 0; index--) {
+            final Rectangle bounds = images[index].getBounds(Main.map.mapView);
+            if (null != bounds && bounds.contains(event.getPoint())) {
+                found = true;
+                ImageEntries.getInstance()
+                .setCurrentImageEntry(images[index]);
+            }
+            }
+        }
+        }
+    }
     }
 
     private static final class ImageChangeListener implements
-	    IImageChangeListener {
-	private final ImageWayPointLayer layer;
+        IImageChangeListener {
+    private final ImageWayPointLayer layer;
 
-	public ImageChangeListener(final ImageWayPointLayer layer) {
-	    this.layer = layer;
-	}
+    public ImageChangeListener(final ImageWayPointLayer layer) {
+        this.layer = layer;
+    }
 
-	public final void onAvailableImageEntriesChanged(
-	    final ImageEntries entries) {
-	    Main.map.repaint();
-	}
+    public final void onAvailableImageEntriesChanged(
+        final ImageEntries entries) {
+        Main.map.repaint();
+    }
 
-	public final void onSelectedImageEntryChanged(final ImageEntries entries) {
-	    Main.map.repaint();
-	}
+    public final void onSelectedImageEntryChanged(final ImageEntries entries) {
+        Main.map.repaint();
+    }
     }
 
@@ -72,96 +72,96 @@
 
     public ImageWayPointLayer() {
-	super(tr("Imported Images"));
+    super(tr("Imported Images"));
 
-	Main.main.addLayer(this);
+    Main.main.addLayer(this);
 
-	this.layerMouseListener = new ImageWayPointMouseListener(this);
-	Main.map.mapView.addMouseListener(this.layerMouseListener);
+    this.layerMouseListener = new ImageWayPointMouseListener(this);
+    Main.map.mapView.addMouseListener(this.layerMouseListener);
 
-	this.imageChangeListener = new ImageChangeListener(this);
-	ImageEntries.getInstance().addListener(this.imageChangeListener);
+    this.imageChangeListener = new ImageChangeListener(this);
+    ImageEntries.getInstance().addListener(this.imageChangeListener);
     }
 
     @Override
     public final Icon getIcon() {
-	return ImageProvider.get("dialogs/imagewaypoint");
+    return ImageProvider.get("dialogs/imagewaypoint");
     }
 
     @Override
     public final Object getInfoComponent() {
-	return null;
+    return null;
     }
 
     @Override
     public final Component[] getMenuEntries() {
-	return new Component[0];
+    return new Component[0];
     }
 
     @Override
     public final String getToolTipText() {
-	// TODO
-	return "";
+    // TODO
+    return "";
     }
 
     @Override
     public final boolean isMergable(final Layer other) {
-	// TODO
-	return false;
+    // TODO
+    return false;
     }
 
     @Override
     public final void mergeFrom(final Layer from) {
-	// TODO not supported yet
+    // TODO not supported yet
     }
 
     @Override
     public final void paint(final Graphics graphics, final MapView mapView) {
-	final ImageEntry[] images = ImageEntries.getInstance().getImages();
+    final ImageEntry[] images = ImageEntries.getInstance().getImages();
 
-	if (null != images) {
-	    final ImageEntry currentImage = ImageEntries.getInstance()
-		.getCurrentImageEntry();
+    if (null != images) {
+        final ImageEntry currentImage = ImageEntries.getInstance()
+        .getCurrentImageEntry();
 
-	    for (int index = 0; index < images.length; index++) {
-		final Rectangle bounds = images[index].getBounds(mapView);
-		if (null != bounds) {
-		    if (images[index] == currentImage) {
-			ImageEntry.SELECTED_ICON.paintIcon(mapView,
-			    graphics,
-			    bounds.x,
-			    bounds.y);
-		    } else {
-			ImageEntry.ICON.paintIcon(mapView,
-			    graphics,
-			    bounds.x,
-			    bounds.y);
-		    }
-		}
-	    }
-	}
+        for (int index = 0; index < images.length; index++) {
+        final Rectangle bounds = images[index].getBounds(mapView);
+        if (null != bounds) {
+            if (images[index] == currentImage) {
+            ImageEntry.SELECTED_ICON.paintIcon(mapView,
+                graphics,
+                bounds.x,
+                bounds.y);
+            } else {
+            ImageEntry.ICON.paintIcon(mapView,
+                graphics,
+                bounds.x,
+                bounds.y);
+            }
+        }
+        }
+    }
     }
 
     @Override
     public final void visitBoundingBox(final BoundingXYVisitor visitor) {
-	final ImageEntry[] images = ImageEntries.getInstance().getImages();
+    final ImageEntry[] images = ImageEntries.getInstance().getImages();
 
-	if (null != images) {
-	    for (int index = 0; index < images.length; index++) {
-		final ImageEntry imageEntry = images[index];
+    if (null != images) {
+        for (int index = 0; index < images.length; index++) {
+        final ImageEntry imageEntry = images[index];
 
-		if (null != imageEntry.getWayPoint()
-			&& null != imageEntry.getWayPoint().eastNorth) {
-		    visitor.visit(imageEntry.getWayPoint().eastNorth);
-		}
-	    }
-	}
+        if (null != imageEntry.getWayPoint()
+            && null != imageEntry.getWayPoint().eastNorth) {
+            visitor.visit(imageEntry.getWayPoint().eastNorth);
+        }
+        }
+    }
     }
 
     @Override
     public final void destroy() {
-	super.destroy();
+    super.destroy();
 
-	Main.map.mapView.removeMouseListener(this.layerMouseListener);
-	ImageEntries.getInstance().removeListener(this.imageChangeListener);
+    Main.map.mapView.removeMouseListener(this.layerMouseListener);
+    ImageEntries.getInstance().removeListener(this.imageChangeListener);
     }
 }
Index: applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageWayPointPlugin.java
===================================================================
--- applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageWayPointPlugin.java	(revision 12588)
+++ applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageWayPointPlugin.java	(revision 12778)
@@ -24,72 +24,72 @@
 public final class ImageWayPointPlugin extends org.openstreetmap.josm.plugins.Plugin {
     private static final class ImageFileFilter extends FileFilter {
-	@Override
-	public final boolean accept(final File file) {
-	    return file.isDirectory()
-		    || file.getName().toLowerCase().endsWith(".jpg")
-		    || file.getName().toLowerCase().endsWith(".jpeg")
-		    || file.getName().toLowerCase().endsWith(".png")
-		    || file.getName().toLowerCase().endsWith(".gif");
-	}
+    @Override
+    public final boolean accept(final File file) {
+        return file.isDirectory()
+            || file.getName().toLowerCase().endsWith(".jpg")
+            || file.getName().toLowerCase().endsWith(".jpeg")
+            || file.getName().toLowerCase().endsWith(".png")
+            || file.getName().toLowerCase().endsWith(".gif");
+    }
 
-	@Override
-	public final String getDescription() {
-	    return tr("Image files (*.jpg, *.jpeg, *.png, *.gif)");
-	}
+    @Override
+    public final String getDescription() {
+        return tr("Image files (*.jpg, *.jpeg, *.png, *.gif)");
+    }
     }
 
     private static final class LoadImagesAction extends JosmAction {
-	private static final long serialVersionUID = 4480306223276347301L;
+    private static final long serialVersionUID = 4480306223276347301L;
 
-	private final ImageWayPointPlugin plugin;
+    private final ImageWayPointPlugin plugin;
 
-	public LoadImagesAction(final ImageWayPointPlugin plugin) {
-	    super(tr("Open images with ImageWayPoint"),
-		"imagewaypoint-open",
-		tr("Load set of images as a new layer."),
-		null,
-		false);
+    public LoadImagesAction(final ImageWayPointPlugin plugin) {
+        super(tr("Open images with ImageWayPoint"),
+        "imagewaypoint-open",
+        tr("Load set of images as a new layer."),
+        null,
+        false);
 
-	    this.plugin = plugin;
-	}
+        this.plugin = plugin;
+    }
 
-	public final void actionPerformed(final ActionEvent actionEvent) {
-	    final JFileChooser fileChooser = new JFileChooser(Main.pref.get("tagimages.lastdirectory"));
-	    fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
-	    fileChooser.setMultiSelectionEnabled(true);
-	    fileChooser.setAcceptAllFileFilterUsed(false);
-	    fileChooser.setFileFilter(new ImageFileFilter());
+    public final void actionPerformed(final ActionEvent actionEvent) {
+        final JFileChooser fileChooser = new JFileChooser(Main.pref.get("tagimages.lastdirectory"));
+        fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
+        fileChooser.setMultiSelectionEnabled(true);
+        fileChooser.setAcceptAllFileFilterUsed(false);
+        fileChooser.setFileFilter(new ImageFileFilter());
 
-	    fileChooser.showOpenDialog(Main.parent);
+        fileChooser.showOpenDialog(Main.parent);
 
-	    final File[] selectedFiles = fileChooser.getSelectedFiles();
-	    if (null != selectedFiles && 0 != selectedFiles.length) {
-		Main.pref.put("tagimages.lastdirectory",
-		    fileChooser.getCurrentDirectory().getPath());
+        final File[] selectedFiles = fileChooser.getSelectedFiles();
+        if (null != selectedFiles && 0 != selectedFiles.length) {
+        Main.pref.put("tagimages.lastdirectory",
+            fileChooser.getCurrentDirectory().getPath());
 
-		// recursively find all files
-		final List<File> allFiles = new ArrayList<File>();
-		this.plugin.addFiles(allFiles, selectedFiles);
+        // recursively find all files
+        final List<File> allFiles = new ArrayList<File>();
+        this.plugin.addFiles(allFiles, selectedFiles);
 
-		// add files to ImageEntries
-		ImageEntries.getInstance()
-		    .add(allFiles.toArray(new File[allFiles.size()]));
+        // add files to ImageEntries
+        ImageEntries.getInstance()
+            .add(allFiles.toArray(new File[allFiles.size()]));
 
-		// check to see whether there's already an ImageWayPointLayer
-		boolean foundImageWayPointLayer = false;
-		if (null != Main.map && null != Main.map.mapView) {
-		    final Collection<Layer> layerCollection = Main.map.mapView.getAllLayers();
-		    final Iterator<Layer> layerIterator = layerCollection.iterator();
-		    while (layerIterator.hasNext() && !foundImageWayPointLayer) {
-			if (layerIterator.next() instanceof ImageWayPointLayer) {
-			    foundImageWayPointLayer = true;
-			}
-		    }
-		}
-		if (!foundImageWayPointLayer) {
-		    new ImageWayPointLayer();
-		}
-	    }
-	}
+        // check to see whether there's already an ImageWayPointLayer
+        boolean foundImageWayPointLayer = false;
+        if (null != Main.map && null != Main.map.mapView) {
+            final Collection<Layer> layerCollection = Main.map.mapView.getAllLayers();
+            final Iterator<Layer> layerIterator = layerCollection.iterator();
+            while (layerIterator.hasNext() && !foundImageWayPointLayer) {
+            if (layerIterator.next() instanceof ImageWayPointLayer) {
+                foundImageWayPointLayer = true;
+            }
+            }
+        }
+        if (!foundImageWayPointLayer) {
+            new ImageWayPointLayer();
+        }
+        }
+    }
     }
 
@@ -98,44 +98,44 @@
      */
     public ImageWayPointPlugin() {
-	// find the File menu
-	final JMenuBar menuBar = Main.main.menu;
-	JMenu fileMenu = null;
+    // find the File menu
+    final JMenuBar menuBar = Main.main.menu;
+    JMenu fileMenu = null;
 
-	if (null != menuBar) {
-	    for (int index = 0; index < menuBar.getMenuCount()
-		    && null == fileMenu; index++) {
-		if (I18n.tr("File").equals(menuBar.getMenu(index).getText())) {
-		    fileMenu = menuBar.getMenu(index);
-		}
-	    }
-	}
+    if (null != menuBar) {
+        for (int index = 0; index < menuBar.getMenuCount()
+            && null == fileMenu; index++) {
+        if (I18n.tr("File").equals(menuBar.getMenu(index).getText())) {
+            fileMenu = menuBar.getMenu(index);
+        }
+        }
+    }
 
-	if (null != fileMenu) {
-	    // now create our 'load' menu item and add to the file menu
-	    final JMenuItem menuItem = new JMenuItem(new LoadImagesAction(this));
-	    fileMenu.add(menuItem, 2);
-	}
+    if (null != fileMenu) {
+        // now create our 'load' menu item and add to the file menu
+        final JMenuItem menuItem = new JMenuItem(new LoadImagesAction(this));
+        fileMenu.add(menuItem, 2);
+    }
     }
 
     @Override
     public final void mapFrameInitialized(final MapFrame oldFrame,
-	final MapFrame newFrame) {
-	if (newFrame != null) {
-	    newFrame.addToggleDialog(ImageWayPointDialog.getInstance()
-		.getDisplayComponent());
-	} else {
-	    ImageEntries.getInstance().setCurrentImageEntry(null);
-	}
+    final MapFrame newFrame) {
+    if (newFrame != null) {
+        newFrame.addToggleDialog(ImageWayPointDialog.getInstance()
+        .getDisplayComponent());
+    } else {
+        ImageEntries.getInstance().setCurrentImageEntry(null);
+    }
     }
 
     private void addFiles(List<File> allFiles, File[] selectedFiles) {
-	for (int index = 0; index < selectedFiles.length; index++) {
-	    final File selectedFile = selectedFiles[index];
-	    if (selectedFile.isDirectory()) {
-		this.addFiles(allFiles, selectedFile.listFiles());
-	    } else if (selectedFile.getName().toLowerCase().endsWith(".jpg")) {
-		allFiles.add(selectedFile);
-	    }
-	}
+    for (int index = 0; index < selectedFiles.length; index++) {
+        final File selectedFile = selectedFiles[index];
+        if (selectedFile.isDirectory()) {
+        this.addFiles(allFiles, selectedFile.listFiles());
+        } else if (selectedFile.getName().toLowerCase().endsWith(".jpg")) {
+        allFiles.add(selectedFile);
+        }
+    }
     }
 }
