Index: applications/editors/josm/plugins/wmsplugin/src/wmsplugin/GeorefImage.java
===================================================================
--- applications/editors/josm/plugins/wmsplugin/src/wmsplugin/GeorefImage.java	(revision 16860)
+++ applications/editors/josm/plugins/wmsplugin/src/wmsplugin/GeorefImage.java	(revision 16872)
@@ -1,5 +1,4 @@
 package wmsplugin;
 
-import java.awt.Color;
 import java.awt.Dimension;
 import java.awt.Graphics;
Index: applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSAdjustAction.java
===================================================================
--- applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSAdjustAction.java	(revision 16860)
+++ applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSAdjustAction.java	(revision 16872)
@@ -3,15 +3,30 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
+import java.awt.Component;
 import java.awt.Cursor;
+import java.awt.GridBagLayout;
 import java.awt.event.MouseEvent;
 import java.awt.event.MouseListener;
 import java.awt.event.MouseMotionListener;
+import java.util.List;
+
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.Icon;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
 
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.actions.mapmode.MapMode;
 import org.openstreetmap.josm.data.coor.EastNorth;
+import org.openstreetmap.josm.gui.ExtendedDialog;
+import org.openstreetmap.josm.gui.MapFrame;
+import org.openstreetmap.josm.gui.OptionPaneUtil;
+import org.openstreetmap.josm.gui.layer.Layer;
+import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
-import org.openstreetmap.josm.gui.layer.Layer;
 
 
@@ -20,7 +35,7 @@
 
     GeorefImage selectedImage;
-    WMSLayer selectedLayer;
     boolean mouseDown;
     EastNorth prevEastNorth;
+    private WMSLayer adjustingLayer;
 
     public WMSAdjustAction(MapFrame mapFrame) {
@@ -30,6 +45,23 @@
     }
 
+    
+    
     @Override public void enterMode() {
-        super.enterMode();
+        super.enterMode();       
+        if (!hasWMSLayersToAdjust()) {
+        	warnNoWMSLayers();
+        	return;
+        }
+        List<WMSLayer> wmsLayers = Main.map.mapView.getLayersOfType(WMSLayer.class);
+        if (wmsLayers.size() == 1) {
+        	adjustingLayer = wmsLayers.get(0);
+        } else {
+        	adjustingLayer = (WMSLayer)askAdjustLayer(Main.map.mapView.getLayersOfType(WMSLayer.class));
+        }
+        if (adjustingLayer == null)
+        	return;
+        if (!adjustingLayer.isVisible()) {
+        	adjustingLayer.setVisible(true);
+        }
         Main.map.mapView.addMouseListener(this);
         Main.map.mapView.addMouseMotionListener(this);
@@ -40,4 +72,5 @@
         Main.map.mapView.removeMouseListener(this);
         Main.map.mapView.removeMouseMotionListener(this);
+        adjustingLayer = null;
     }
 
@@ -46,9 +79,7 @@
             return;
 
-        Layer layer=Main.map.mapView.getActiveLayer();
-        if (layer.isVisible() && layer instanceof WMSLayer) {
+        if (adjustingLayer.isVisible()) {
             prevEastNorth=Main.map.mapView.getEastNorth(e.getX(),e.getY());
-            selectedLayer = ((WMSLayer)layer);
-            selectedImage = selectedLayer.findImage(prevEastNorth);
+            selectedImage = adjustingLayer.findImage(prevEastNorth);
             if(selectedImage!=null) {
                 Main.map.mapView.setCursor
@@ -62,5 +93,5 @@
             EastNorth eastNorth=
                     Main.map.mapView.getEastNorth(e.getX(),e.getY());
-            selectedLayer.displace(
+            adjustingLayer.displace(
                 eastNorth.east()-prevEastNorth.east(),
                 eastNorth.north()-prevEastNorth.north()
@@ -76,5 +107,4 @@
         selectedImage = null;
         prevEastNorth = null;
-        selectedLayer = null;
     }
     
@@ -99,3 +129,86 @@
         return (l instanceof WMSLayer) && l.isVisible();
     }
+    
+    /**
+    * the list cell renderer used to render layer list entries
+    * 
+    */
+   static public class LayerListCellRenderer extends DefaultListCellRenderer {
+
+       protected boolean isActiveLayer(Layer layer) {
+           if (Main.map == null)
+               return false;
+           if (Main.map.mapView == null)
+               return false;
+           return Main.map.mapView.getActiveLayer() == layer;
+       }
+
+       @Override
+       public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
+               boolean cellHasFocus) {
+           Layer layer = (Layer) value;
+           JLabel label = (JLabel) super.getListCellRendererComponent(list, layer.getName(), index, isSelected,
+                   cellHasFocus);
+           Icon icon = layer.getIcon();
+           label.setIcon(icon);
+           label.setToolTipText(layer.getToolTipText());
+           return label;
+       }
+   }
+
+   /**
+    * Prompts the user with a list of WMS layers which can be adjusted  
+    * 
+    * @param adjustableLayers the list of adjustable layers 
+    * @return  the selected layer; null, if no layer was selected 
+    */
+   protected Layer askAdjustLayer(List<? extends Layer> adjustableLayers) {
+       JComboBox layerList = new JComboBox();
+       layerList.setRenderer(new LayerListCellRenderer());
+       layerList.setModel(new DefaultComboBoxModel(adjustableLayers.toArray()));
+       layerList.setSelectedIndex(0);
+   
+       JPanel pnl = new JPanel();
+       pnl.setLayout(new GridBagLayout());
+       pnl.add(new JLabel(tr("Please select the WMS layer to adjust.")), GBC.eol());
+       pnl.add(layerList, GBC.eol());
+   
+       int decision = new ExtendedDialog(Main.parent, tr("Select WMS layer"), pnl, new String[] { tr("Start adjusting"),
+           tr("Cancel") }, new String[] { "mapmode/adjustwms", "cancel" }).getValue();
+       if (decision != 1)
+           return null;
+       Layer adjustLayer = (Layer) layerList.getSelectedItem();
+       return adjustLayer;
+   }
+
+   /**
+    * Displays a warning message if there are no WMS layers to adjust 
+    * 
+    */
+   protected void warnNoWMSLayers() {
+       OptionPaneUtil.showMessageDialog(
+    		   Main.parent,
+               tr("There are currently no WMS layer to adjust."),
+               tr("No layers to adjust"), 
+               JOptionPane.WARNING_MESSAGE
+       );
+   }
+   
+   /**
+    * Replies true if there is at least one WMS layer 
+    * 
+    * @return true if there is at least one WMS layer
+    */
+   protected boolean hasWMSLayersToAdjust() {
+	   if (Main.map == null) return false;
+	   if (Main.map.mapView == null) return false;
+	   return ! Main.map.mapView.getLayersOfType(WMSLayer.class).isEmpty();
+   }
+
+
+
+	@Override
+	protected void updateEnabledState() {
+		setEnabled(hasWMSLayersToAdjust());
+	}   
 }
Index: applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSGrabber.java
===================================================================
--- applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSGrabber.java	(revision 16860)
+++ applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSGrabber.java	(revision 16872)
@@ -14,5 +14,4 @@
 import java.text.DecimalFormat;
 import java.text.DecimalFormatSymbols;
-import java.text.MessageFormat;
 import java.text.NumberFormat;
 import java.util.Locale;
@@ -27,5 +26,4 @@
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.data.projection.Epsg4326;
 import org.openstreetmap.josm.data.projection.Mercator;
 import org.openstreetmap.josm.gui.MapView;
