Index: /src/org/openstreetmap/josm/actions/AutoScaleAction.java
===================================================================
--- /src/org/openstreetmap/josm/actions/AutoScaleAction.java	(revision 90)
+++ /src/org/openstreetmap/josm/actions/AutoScaleAction.java	(revision 91)
@@ -3,9 +3,17 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
+import java.util.Collection;
 
 import javax.swing.KeyStroke;
+import javax.swing.MenuElement;
 
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.SelectionChangedListener;
+import org.openstreetmap.josm.data.coor.EastNorth;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
 import org.openstreetmap.josm.gui.MapFrame;
-import org.openstreetmap.josm.gui.MapView;
+import org.openstreetmap.josm.gui.layer.Layer;
 
 /**
@@ -13,18 +21,69 @@
  * @author imi
  */
-public class AutoScaleAction extends JosmAction {
-	/**
-	 * The mapView this action operates on.
-	 */
-	private final MapView mapView;
+public class AutoScaleAction extends GroupAction {
+
+	private enum AutoScaleMode {data, selection, layer, conflict}
+	private AutoScaleMode mode = AutoScaleMode.data;
+	private final MapFrame mapFrame;
+
+	private class Action extends JosmAction {
+		private final AutoScaleMode mode;
+		public Action(AutoScaleMode mode) {
+	        super("Auto Scale: "+mode, "dialogs/autoscale/"+mode, "Auto zoom the view to "+mode+". Disabled if the view is moved.", "Alt-A", KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.ALT_MASK));
+			this.mode = mode;
+        }
+		public void actionPerformed(ActionEvent e) {
+			AutoScaleAction.this.mode = mode;
+			if (e.getSource() instanceof MenuElement)
+				setAutoScaleOnMapView();
+			else
+				mapFrame.mapView.setAutoScale(!mapFrame.mapView.isAutoScale());
+        }
+	}
 	
-	public AutoScaleAction(MapFrame mapFrame) {
-		super("Auto Scale", "autoscale", "Zoom the view to show the whole layer. Disabled if the view is moved.", "Alt-A", KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.ALT_MASK));
-		mapView = mapFrame.mapView;
+	public AutoScaleAction(final MapFrame mapFrame) {
+		for (AutoScaleMode mode : AutoScaleMode.values())
+			actions.add(new Action(mode));
+		setCurrent(0);
+		this.mapFrame = mapFrame;
+		Main.ds.addSelectionChangedListener(new SelectionChangedListener(){
+			public void selectionChanged(Collection<OsmPrimitive> newSelection) {
+				if (mode == AutoScaleMode.selection)
+					mapFrame.mapView.recalculateCenterScale();
+            }
+		});
 	}
 
+	public BoundingXYVisitor getBoundingBox() {
+		BoundingXYVisitor v = new BoundingXYVisitor();
+		switch (mode) {
+		case data:
+			for (Layer l : mapFrame.mapView.getAllLayers())
+				l.visitBoundingBox(v);
+			break;
+		case layer:
+			mapFrame.mapView.getActiveLayer().visitBoundingBox(v);
+			break;
+		case selection:
+		case conflict:
+			Collection<OsmPrimitive> sel = mode == AutoScaleMode.selection ? Main.ds.getSelected() : mapFrame.conflictDialog.conflicts.keySet();
+			for (OsmPrimitive osm : sel)
+				osm.visit(v);
+			// special case to zoom nicely to one single node
+			if (v.min != null && v.max != null && v.min.north() == v.max.north() && v.min.east() == v.max.east()) {
+				EastNorth en = Main.proj.latlon2eastNorth(new LatLon(0.02, 0.02));
+				v.min = new EastNorth(v.min.east()-en.east(), v.min.north()-en.north());
+				v.max = new EastNorth(v.max.east()+en.east(), v.max.north()+en.north());
+			}
+			break;
+		}
+		return v;
+    }
 
-	public void actionPerformed(ActionEvent e) {
-		mapView.setAutoScale(!mapView.isAutoScale());
-	}
+	private void setAutoScaleOnMapView() {
+    	if (mapFrame.mapView.isAutoScale())
+    		mapFrame.mapView.recalculateCenterScale();
+    	else
+    		mapFrame.mapView.setAutoScale(true);
+    }
 }
Index: /src/org/openstreetmap/josm/actions/GroupAction.java
===================================================================
--- /src/org/openstreetmap/josm/actions/GroupAction.java	(revision 91)
+++ /src/org/openstreetmap/josm/actions/GroupAction.java	(revision 91)
@@ -0,0 +1,53 @@
+package org.openstreetmap.josm.actions;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.Icon;
+import javax.swing.JMenuItem;
+import javax.swing.JPopupMenu;
+
+import org.openstreetmap.josm.gui.IconToggleButton;
+import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.ImageProvider.OverlayPosition;
+
+
+public class GroupAction extends AbstractAction {
+
+	protected final List<Action> actions = new ArrayList<Action>();
+	private int current;
+
+	protected void setCurrent(int current) {
+		this.current = current;
+		putValue(SMALL_ICON, ImageProvider.overlay((Icon)actions.get(current).getValue(SMALL_ICON), "right", OverlayPosition.SOUTHEAST));
+		putValue(SHORT_DESCRIPTION, actions.get(current).getValue(SHORT_DESCRIPTION));
+    }
+
+	public void actionPerformed(ActionEvent e) {
+		if (e.getSource() instanceof IconToggleButton && ((IconToggleButton)e.getSource()).groupbutton) {
+			IconToggleButton b = (IconToggleButton)e.getSource();
+			b.setSelected(!b.isSelected());
+			openPopup(b);
+		} else
+			actions.get(current).actionPerformed(e);
+    }
+
+	private void openPopup(IconToggleButton b) {
+		JPopupMenu popup = new JPopupMenu();
+		for (int i = 0; i < actions.size(); ++i) {
+			final int j = i;
+			JMenuItem item = new JMenuItem(actions.get(i));
+			item.addActionListener(new ActionListener(){
+				public void actionPerformed(ActionEvent e) {
+					setCurrent(j);
+                }
+			});
+			popup.add(item);
+		}
+		popup.show(b, b.getWidth(), 0);
+    }
+}
Index: /src/org/openstreetmap/josm/actions/mapmode/MapMode.java
===================================================================
--- /src/org/openstreetmap/josm/actions/mapmode/MapMode.java	(revision 90)
+++ /src/org/openstreetmap/josm/actions/mapmode/MapMode.java	(revision 91)
@@ -63,31 +63,10 @@
 	}
 
-	/**
-	 * Does nothing. Only to subclass.
-	 */
+	public void mouseReleased(MouseEvent e) {}
+	public void mouseExited(MouseEvent e) {}
+	public void mousePressed(MouseEvent e) {}
 	public void mouseClicked(MouseEvent e) {}
-	/**
-	 * Does nothing. Only to subclass.
-	 */
-	public void mousePressed(MouseEvent e) {}
-	/**
-	 * Does nothing. Only to subclass.
-	 */
-	public void mouseReleased(MouseEvent e) {}
-	/**
-	 * Does nothing. Only to subclass.
-	 */
 	public void mouseEntered(MouseEvent e) {}
-	/**
-	 * Does nothing. Only to subclass.
-	 */
-	public void mouseExited(MouseEvent e) {}
-	/**
-	 * Does nothing. Only to subclass.
-	 */
 	public void mouseMoved(MouseEvent e) {}
-	/**
-	 * Does nothing. Only to subclass.
-	 */
 	public void mouseDragged(MouseEvent e) {}
 }
Index: /src/org/openstreetmap/josm/command/ConflictResolveCommand.java
===================================================================
--- /src/org/openstreetmap/josm/command/ConflictResolveCommand.java	(revision 90)
+++ /src/org/openstreetmap/josm/command/ConflictResolveCommand.java	(revision 91)
@@ -44,8 +44,10 @@
 			}
 		}
-		for (OsmPrimitive k : completed)
-			conflictDialog.conflicts.remove(k);
-		if (!completed.isEmpty())
+		if (!completed.isEmpty()) {
+			for (OsmPrimitive k : completed)
+				conflictDialog.conflicts.remove(k);
 			conflictDialog.rebuildList();
+			Main.main.getMapFrame().mapView.recalculateCenterScale(); // in case of auto-zoom
+ 		}
 	}
 
Index: /src/org/openstreetmap/josm/data/osm/DataSet.java
===================================================================
--- /src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 90)
+++ /src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 91)
@@ -151,3 +151,7 @@
     		listeners.remove(listener);
     }
+
+	public void addAllSelectionListener(DataSet ds) {
+		listeners.addAll(ds.listeners);
+    }
 }
Index: /src/org/openstreetmap/josm/gui/IconToggleButton.java
===================================================================
--- /src/org/openstreetmap/josm/gui/IconToggleButton.java	(revision 90)
+++ /src/org/openstreetmap/josm/gui/IconToggleButton.java	(revision 91)
@@ -1,4 +1,6 @@
 package org.openstreetmap.josm.gui;
 
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
@@ -15,4 +17,6 @@
 public class IconToggleButton extends JToggleButton implements PropertyChangeListener {
 
+	public boolean groupbutton;
+
 	/**
 	 * Construct the toggle button with the given action.
@@ -25,6 +29,12 @@
 		if (o != null)
 			setToolTipText(o.toString());
+
+		action.addPropertyChangeListener(this);
 		
-		action.addPropertyChangeListener(this);
+		addMouseListener(new MouseAdapter(){
+			@Override public void mousePressed(MouseEvent e) {
+				groupbutton = e.getX() > getWidth()/3 && e.getY() > getHeight()/3;
+            }
+		});
 	}
 
Index: /src/org/openstreetmap/josm/gui/MapFrame.java
===================================================================
--- /src/org/openstreetmap/josm/gui/MapFrame.java	(revision 90)
+++ /src/org/openstreetmap/josm/gui/MapFrame.java	(revision 91)
@@ -12,11 +12,10 @@
 import javax.swing.ButtonGroup;
 import javax.swing.JPanel;
-import javax.swing.JToggleButton;
 import javax.swing.JToolBar;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.AutoScaleAction;
+import org.openstreetmap.josm.actions.mapmode.AddNodeAction;
 import org.openstreetmap.josm.actions.mapmode.AddSegmentAction;
-import org.openstreetmap.josm.actions.mapmode.AddNodeAction;
 import org.openstreetmap.josm.actions.mapmode.AddWayAction;
 import org.openstreetmap.josm.actions.mapmode.DeleteAction;
@@ -70,5 +69,7 @@
 		setLayout(new BorderLayout());
 
-		add(mapView = new MapView(layer), BorderLayout.CENTER);
+		AutoScaleAction autoScaleAction = new AutoScaleAction(this);
+		add(mapView = new MapView(autoScaleAction), BorderLayout.CENTER);
+		mapView.addLayer(layer);
 
 		// toolbar
@@ -92,5 +93,5 @@
 		// autoScale
 		toolBarActions.addSeparator();
-		final JToggleButton autoScaleButton = new IconToggleButton(new AutoScaleAction(this));
+		final IconToggleButton autoScaleButton = new IconToggleButton(autoScaleAction);
 		toolBarActions.add(autoScaleButton);
 		autoScaleButton.setText(null);
Index: /src/org/openstreetmap/josm/gui/MapView.java
===================================================================
--- /src/org/openstreetmap/josm/gui/MapView.java	(revision 90)
+++ /src/org/openstreetmap/josm/gui/MapView.java	(revision 91)
@@ -12,9 +12,9 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.AutoScaleAction;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.SelectionChangedListener;
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
@@ -71,10 +71,9 @@
 	 */
 	private Collection<LayerChangeListener> listeners = new LinkedList<LayerChangeListener>();
-	
-	/**
-	 * Construct a MapView.
-	 * @param layer The first layer in the view.
-	 */
-	public MapView(Layer layer) {
+
+	private final AutoScaleAction autoScaleAction;
+
+	public MapView(AutoScaleAction autoScaleAction) {
+		this.autoScaleAction = autoScaleAction;
 		addComponentListener(new ComponentAdapter(){
 			@Override public void componentResized(ComponentEvent e) {
@@ -83,11 +82,10 @@
 		});
 		new MapMover(this);
-		addLayer(layer);
-		
+
 		// listend to selection changes to redraw the map
 		Main.ds.addSelectionChangedListener(new SelectionChangedListener(){
 			public void selectionChanged(Collection<OsmPrimitive> newSelection) {
 				repaint();
-            }
+			}
 		});
 	}
@@ -101,7 +99,4 @@
 			final OsmDataLayer dataLayer = (OsmDataLayer)layer;
 			if (editLayer != null) {
-				// merge the layer into the existing one
-				if (!editLayer.isMergable(layer))
-					throw new IllegalArgumentException("Cannot merge argument");
 				editLayer.mergeFrom(layer);
 				repaint();
@@ -109,4 +104,6 @@
 			}
 			editLayer = dataLayer;
+			dataLayer.data.addAllSelectionListener(Main.ds);
+			Main.ds = dataLayer.data;
 			dataLayer.addModifiedListener(new ModifiedChangedListener(){
 				public void modifiedChanged(boolean value, OsmDataLayer source) {
@@ -117,8 +114,8 @@
 
 		// add as a new layer
-        if (layer instanceof WmsServerLayer)
-            layers.add(layers.size(), layer);
-        else
-            layers.add(0, layer);
+		if (layer instanceof WmsServerLayer)
+			layers.add(layers.size(), layer);
+		else
+			layers.add(0, layer);
 
 		for (LayerChangeListener l : listeners)
@@ -127,5 +124,4 @@
 		// autoselect the new layer
 		setActiveLayer(layer);
-		recalculateCenterScale();
 	}
 
@@ -207,5 +203,5 @@
 	 * scale, if in autoScale mode.
 	 */
-	void recalculateCenterScale() {
+	public void recalculateCenterScale() {
 		if (autoScale) {
 			// -20 to leave some border
@@ -217,12 +213,10 @@
 				h = 20;
 
-			BoundingXYVisitor v = new BoundingXYVisitor();
-			for (Layer l : layers)
-				l.visitBoundingBox(v);
+			BoundingXYVisitor v = autoScaleAction.getBoundingBox();
 
 			boolean oldAutoScale = autoScale;
 			EastNorth oldCenter = center;
 			double oldScale = this.scale;
-			
+
 			if (v.min == null || v.max == null || v.min.equals(v.max)) {
 				// no bounds means whole world 
@@ -238,5 +232,5 @@
 				scale = Math.max(scaleX, scaleY); // minimum scale to see all of the screen
 			}
-	
+
 			if (!center.equals(oldCenter))
 				firePropertyChange("center", oldCenter, center);
@@ -275,5 +269,4 @@
 	/**
 	 * Set the active selection to the given value and raise an layerchange event.
-	 * Also, swap the active dataset in Main.main if it is a datalayer.
 	 */
 	public void setActiveLayer(Layer layer) {
@@ -282,6 +275,4 @@
 		Layer old = activeLayer;
 		activeLayer = layer;
-		if (layer instanceof OsmDataLayer)
-			Main.ds = ((OsmDataLayer)layer).data;
 		if (old != layer) {
 			for (LayerChangeListener l : listeners)
@@ -304,5 +295,5 @@
 	public OsmDataLayer editLayer() {
 		if (editLayer == null)
-			addLayer(new OsmDataLayer(new DataSet(), "unnamed", false));
+			addLayer(new OsmDataLayer(Main.ds, "unnamed", false));
 		return editLayer;
 	}
@@ -319,7 +310,7 @@
 
 		super.zoomTo(newCenter, scale);
-		
+
 		recalculateCenterScale();
-		
+
 		if (!oldCenter.equals(center))
 			firePropertyChange("center", oldCenter, center);
Index: /src/org/openstreetmap/josm/gui/dialogs/LayerList.java
===================================================================
--- /src/org/openstreetmap/josm/gui/dialogs/LayerList.java	(revision 90)
+++ /src/org/openstreetmap/josm/gui/dialogs/LayerList.java	(revision 91)
@@ -102,9 +102,4 @@
 	JList layers = new JList(model);
 	/**
-	 * The invisible icon blended over invisible layers.
-	 */
-	static final Icon invisible = ImageProvider.get("layer", "invisible");
-
-	/**
 	 * The merge action. This is only called, if the current selection and its
 	 * item below are editable datasets and the merge button is clicked. 
@@ -139,5 +134,5 @@
 				Icon icon = layer.getIcon();
 				if (!layer.visible)
-					icon = ImageProvider.overlay(icon, invisible, OverlayPosition.SOUTHEAST);
+					icon = ImageProvider.overlay(icon, "invisible", OverlayPosition.SOUTHEAST);
 				label.setIcon(icon);
 				label.setToolTipText(layer.getToolTipText());
Index: /src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
===================================================================
--- /src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java	(revision 90)
+++ /src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java	(revision 91)
@@ -10,6 +10,12 @@
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.Collection;
 import java.util.LinkedList;
+import java.util.Map;
 
 import javax.swing.ButtonGroup;
@@ -30,7 +36,9 @@
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
+import org.openstreetmap.josm.io.OsmIdReader;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.SearchCompiler;
+import org.xml.sax.SAXException;
 
 /**
@@ -120,16 +128,21 @@
 					return;
 				lastSearch = input.getText();
-				SearchCompiler.Match matcher = SearchCompiler.compile(lastSearch);
-				Collection<OsmPrimitive> sel = Main.ds.getSelected();
-				for (OsmPrimitive osm : Main.ds.allNonDeletedPrimitives()) {
-					if (replace.isSelected()) {
-						if (matcher.match(osm))
+				Collection<OsmPrimitive> sel = null;
+				if (lastSearch.startsWith("http://"))
+					sel = selectFromWebsite(lastSearch, replace.isSelected(), add.isSelected(), remove.isSelected());
+				if (sel == null) {
+					sel = Main.ds.getSelected();
+					SearchCompiler.Match matcher = SearchCompiler.compile(lastSearch);
+					for (OsmPrimitive osm : Main.ds.allNonDeletedPrimitives()) {
+						if (replace.isSelected()) {
+							if (matcher.match(osm))
+								sel.add(osm);
+							else
+								sel.remove(osm);
+						} else if (add.isSelected() && !osm.selected && matcher.match(osm))
 							sel.add(osm);
-						else
+						else if (remove.isSelected() && osm.selected && matcher.match(osm))
 							sel.remove(osm);
-					} else if (add.isSelected() && !osm.selected && matcher.match(osm))
-						sel.add(osm);
-					else if (remove.isSelected() && osm.selected && matcher.match(osm))
-						sel.remove(osm);
+					}
 				}
 				Main.ds.setSelected(sel);
@@ -141,4 +154,29 @@
 		selectionChanged(Main.ds.getSelected());
 	}
+
+	private Collection<OsmPrimitive> selectFromWebsite(String url, boolean replace, boolean add, boolean remove) {
+		Collection<OsmPrimitive> sel = replace ? new LinkedList<OsmPrimitive>() : Main.ds.allNonDeletedPrimitives();
+		try {
+	        Reader in = new InputStreamReader(new URL(url).openStream());
+	        Map<Long, String> ids = OsmIdReader.parseIds(in);
+	        for (OsmPrimitive osm : Main.ds.allNonDeletedPrimitives()) {
+	        	if (ids.containsKey(osm.id) && osm.getClass().getName().toLowerCase().endsWith(ids.get(osm.id))) {
+	        		if (remove)
+	        			sel.remove(osm);
+	        		else
+	        			sel.add(osm);
+	        	}
+			}
+        } catch (MalformedURLException e) {
+	        return null;
+        } catch (IOException e) {
+	        e.printStackTrace();
+	        JOptionPane.showMessageDialog(Main.main, "Could not read from url: '"+url+"'");
+        } catch (SAXException e) {
+	        e.printStackTrace();
+	        JOptionPane.showMessageDialog(Main.main, "Parsing error in url: '"+url+"'");
+        }
+        return sel;
+    }
 
 	@Override public void setVisible(boolean b) {
Index: /src/org/openstreetmap/josm/io/OsmIdReader.java
===================================================================
--- /src/org/openstreetmap/josm/io/OsmIdReader.java	(revision 91)
+++ /src/org/openstreetmap/josm/io/OsmIdReader.java	(revision 91)
@@ -0,0 +1,38 @@
+package org.openstreetmap.josm.io;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+import uk.co.wilson.xml.MinML2;
+
+/**
+ * Read only the ids and classes of an stream.
+ * 
+ * @author Imi
+ */
+public class OsmIdReader extends MinML2 {
+
+	Map<Long, String> entries = new HashMap<Long, String>();
+
+	@Override public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
+		if (qName.equals("node") || qName.equals("segment") || qName.equals("way")) {
+			try {
+				entries.put(Long.valueOf(atts.getValue("id")), qName);
+			} catch (Exception e) {
+				e.printStackTrace();
+				throw new SAXException("Error during parse.");
+			}
+		}
+    }
+
+	public static Map<Long, String> parseIds(Reader in) throws IOException, SAXException {
+		OsmIdReader r = new OsmIdReader();
+        r.parse(in);
+		return r.entries;
+	}
+}
Index: /src/org/openstreetmap/josm/io/OsmReader.java
===================================================================
--- /src/org/openstreetmap/josm/io/OsmReader.java	(revision 90)
+++ /src/org/openstreetmap/josm/io/OsmReader.java	(revision 91)
@@ -11,7 +11,7 @@
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.DataSet;
-import org.openstreetmap.josm.data.osm.Segment;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.Segment;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.data.osm.visitor.AddVisitor;
@@ -113,4 +113,5 @@
 			throw new SAXException(x.getMessage(), x);
 		} catch (NullPointerException x) {
+			x.printStackTrace(); // SAXException does not chain correctly
 			throw new SAXException("NullPointerException. Possible some missing tags.", x);
 		}
Index: /src/org/openstreetmap/josm/tools/ImageProvider.java
===================================================================
--- /src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 90)
+++ /src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 91)
@@ -27,12 +27,5 @@
 	 * @author imi
 	 */
-	public final static class OverlayPosition {
-		private OverlayPosition() {}
-		public static OverlayPosition NORTHWEST = new OverlayPosition();
-		public static OverlayPosition NORTHEAST = new OverlayPosition();
-		public static OverlayPosition SOUTHWEST = new OverlayPosition();
-		public static OverlayPosition SOUTHEAST = new OverlayPosition();
-	}
-	
+	public static enum OverlayPosition {NORTHWEST, NORTHEAST, SOUTHWEST, SOUTHEAST}
 	
 	/**
@@ -71,15 +64,12 @@
 
 	/**
-	 * Return an icon that represent the overlay of the two given icons. The
+	 * @return an icon that represent the overlay of the two given icons. The
 	 * second icon is layed on the first relative to the given position.
-	 *
-	 * @param ground The ground icon (base)
-	 * @param overlay The icon to put on top of the ground (overlay)
-	 * @return The merged icon.
 	 */
-	public static Icon overlay(Icon ground, Icon overlay, OverlayPosition pos) {
+	public static Icon overlay(Icon ground, String overlayImage, OverlayPosition pos) {
 		GraphicsConfiguration conf = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
 		int w = ground.getIconWidth();
 		int h = ground.getIconHeight();
+		ImageIcon overlay = ImageProvider.get("overlay",overlayImage);
 		int wo = overlay.getIconWidth();
 		int ho = overlay.getIconHeight();
@@ -88,16 +78,21 @@
 		ground.paintIcon(null, g, 0, 0);
 		int x = 0, y = 0;
-		if (pos == OverlayPosition.NORTHWEST) {
+		switch (pos) {
+		case NORTHWEST:
 			x = 0;
 			y = 0;
-		} else if (pos == OverlayPosition.NORTHEAST) {
+			break;
+		case NORTHEAST:
 			x = w-wo;
 			y = 0;
-		} else if (pos == OverlayPosition.SOUTHWEST) {
+			break;
+		case SOUTHWEST:
 			x = 0;
 			y = h-ho;
-		} else if (pos == OverlayPosition.SOUTHEAST) {
+			break;
+		case SOUTHEAST:
 			x = w-wo;
 			y = h-ho;
+			break;
 		}
 		overlay.paintIcon(null, g, x, y);
