Index: /src/org/openstreetmap/josm/Main.java
===================================================================
--- /src/org/openstreetmap/josm/Main.java	(revision 128)
+++ /src/org/openstreetmap/josm/Main.java	(revision 129)
@@ -48,5 +48,5 @@
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
-import org.openstreetmap.josm.gui.dialogs.AnnotationTester;
+import org.openstreetmap.josm.gui.annotation.AnnotationTester;
 import org.openstreetmap.josm.gui.dialogs.SelectionListDialog;
 import org.openstreetmap.josm.gui.layer.Layer;
@@ -142,4 +142,6 @@
 			setMapFrame(null);
 	}
+
+
 	public Main() {
 		main = this;
Index: /src/org/openstreetmap/josm/gui/annotation/AnnotationCellRenderer.java
===================================================================
--- /src/org/openstreetmap/josm/gui/annotation/AnnotationCellRenderer.java	(revision 129)
+++ /src/org/openstreetmap/josm/gui/annotation/AnnotationCellRenderer.java	(revision 129)
@@ -0,0 +1,35 @@
+/**
+ * 
+ */
+package org.openstreetmap.josm.gui.annotation;
+
+import java.awt.Component;
+
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.JList;
+
+import org.openstreetmap.josm.tools.ImageProvider;
+
+final public class AnnotationCellRenderer extends DefaultListCellRenderer {
+	@Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
+        AnnotationPreset a = (AnnotationPreset)value;
+    	if (a.name == null)
+        	return super.getListCellRendererComponent(list, "", index, false, false);
+    	JComponent c = (JComponent)super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
+        JLabel l = new JLabel((a).name);
+        l.setForeground(c.getForeground());
+        l.setBackground(c.getBackground());
+        l.setFont(c.getFont());
+        l.setBorder(c.getBorder());
+        if (a.types == null)
+        	l.setIcon(ImageProvider.get("data", "empty"));
+        else if (a.types.size() != 1)
+        	l.setIcon(ImageProvider.get("data", "object"));
+        else
+        	l.setIcon(ImageProvider.get("data", a.types.iterator().next().getSimpleName().toLowerCase()));
+        l.setOpaque(true);
+        return l;
+    }
+}
Index: /src/org/openstreetmap/josm/gui/annotation/AnnotationPreset.java
===================================================================
--- /src/org/openstreetmap/josm/gui/annotation/AnnotationPreset.java	(revision 129)
+++ /src/org/openstreetmap/josm/gui/annotation/AnnotationPreset.java	(revision 129)
@@ -0,0 +1,260 @@
+package org.openstreetmap.josm.gui.annotation;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+import static org.openstreetmap.josm.tools.I18n.trn;
+
+import java.awt.GridBagLayout;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+import org.openstreetmap.josm.command.ChangePropertyCommand;
+import org.openstreetmap.josm.command.Command;
+import org.openstreetmap.josm.command.SequenceCommand;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.tools.GBC;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+import uk.co.wilson.xml.MinML2;
+
+
+/**
+ * This class read encapsulate one annotation preset. A class method can
+ * read in all predefined presets, either shipped with JOSM or that are
+ * in the config directory.
+ * 
+ * It is also able to construct dialogs out of preset definitions.
+ */
+public class AnnotationPreset {
+
+	private static interface Item {
+		void addToPanel(JPanel p);
+		void addCommands(Collection<OsmPrimitive> sel, List<Command> cmds);
+	}
+
+	public static class Text implements Item {
+		String key;
+		String label;
+		JTextField value = new JTextField();
+
+		public void addToPanel(JPanel p) {
+			p.add(new JLabel(label), GBC.std().insets(0,0,10,0));
+			p.add(value, GBC.eol().fill(GBC.HORIZONTAL));
+		}
+		public Text(String key, String label, String value) {
+			this.key = key;
+			this.label = label;
+			this.value.setText(value == null ? "" : value);
+		}
+		public void addCommands(Collection<OsmPrimitive> sel, List<Command> cmds) {
+			cmds.add(new ChangePropertyCommand(sel, key, value.getText()));
+		}
+	}
+
+	public static class Check implements Item {
+		String key;
+		JCheckBox check = new JCheckBox();
+
+		public void addToPanel(JPanel p) {
+			p.add(check, GBC.eol().fill(GBC.HORIZONTAL));
+		}
+		public Check(String key, String label, boolean check) {
+			this.key = key;
+			this.check.setText(label);
+			this.check.setSelected(check);
+		}
+		public void addCommands(Collection<OsmPrimitive> sel, List<Command> cmds) {
+			cmds.add(new ChangePropertyCommand(sel, key, check.isSelected() ? "true" : null));
+		}
+	}
+
+	public static class Combo implements Item {
+		String key;
+		String label;
+		JComboBox combo;
+		private final String[] values;
+
+		public void addToPanel(JPanel p) {
+			p.add(new JLabel(label), GBC.std().insets(0,0,10,0));
+			p.add(combo, GBC.eol().fill(GBC.HORIZONTAL));
+		}
+		public Combo(String key, String label, String def, String[] values, String[] displayedValues, boolean editable) {
+			this.key = key;
+			this.label = label;
+			this.values = values;
+			combo = new JComboBox(displayedValues);
+			combo.setEditable(editable);
+			combo.setSelectedItem(def);
+		}
+		public void addCommands(Collection<OsmPrimitive> sel, List<Command> cmds) {
+			String v = combo.getSelectedIndex() == -1 ? null : values[combo.getSelectedIndex()];
+			String str = combo.isEditable()?combo.getEditor().getItem().toString() : v;
+			cmds.add(new ChangePropertyCommand(sel, key, str));
+		}
+	}
+
+	public static class Label implements Item {
+		String text;
+
+		public void addToPanel(JPanel p) {
+			p.add(new JLabel(text), GBC.eol());
+		}
+		public Label(String text) {
+			this.text = text;
+		}
+		public void addCommands(Collection<OsmPrimitive> sel, List<Command> cmds) {}
+	}
+
+	public static class Key implements Item {
+		String key;
+		String value;
+
+		public void addToPanel(JPanel p) {}
+		public Key(String key, String value) {
+			this.key = key;
+			this.value = value;
+		}
+		public void addCommands(Collection<OsmPrimitive> sel, List<Command> cmds) {
+			cmds.add(new ChangePropertyCommand(sel, key, value != null && !value.equals("") ? value : null));
+		}
+	}
+
+	private static class Parser extends MinML2 {
+		List<AnnotationPreset> data = new LinkedList<AnnotationPreset>();
+		List<Item> current;
+		String currentName;
+		Collection<Class<?>> currentTypes;
+		private static int unknownCounter = 1;
+
+		@Override public void startElement(String ns, String lname, String qname, Attributes a) throws SAXException {
+			if (qname.equals("annotations"))
+				return;
+			if (qname.equals("item")) {
+				current = new LinkedList<Item>();
+				currentName = a.getValue("name");
+				if (currentName == null)
+					currentName = "Unnamed Preset #"+(unknownCounter++);
+				if (a.getValue("type") != null) {
+					String s = a.getValue("type");
+					try {
+						for (String type : s.split(",")) {
+							type = Character.toUpperCase(type.charAt(0))+type.substring(1);
+							if (currentTypes == null)
+								currentTypes = new LinkedList<Class<?>>();
+							currentTypes.add(Class.forName("org.openstreetmap.josm.data.osm."+type));
+						}
+					} catch (ClassNotFoundException e) {
+						e.printStackTrace();
+						throw new SAXException(tr("Unknown type at line {0}", getLineNumber()));
+					}
+				}
+			} else if (qname.equals("text"))
+				current.add(new Text(a.getValue("key"), a.getValue("text"), a.getValue("default")));
+			else if (qname.equals("check")) {
+				String s = a.getValue("default");
+				boolean clear = s == null || s.equals("0") || s.startsWith("off") || s.startsWith("false") || s.startsWith("no");
+				current.add(new Check(a.getValue("key"), a.getValue("text"), !clear));
+			} else if (qname.equals("label"))
+				current.add(new Label(a.getValue("text")));
+			else if (qname.equals("combo")) {
+				String[] values = a.getValue("values").split(",");
+				String s = a.getValue("readonly");
+				String dvstr = a.getValue("display_values");
+				boolean editable = s == null  || s.equals("0") || s.startsWith("off") || s.startsWith("false") || s.startsWith("no");
+				if (dvstr != null) {
+					if (editable && s != null)
+						throw new SAXException(tr("Cannot have a writable combobox with default values (line {0})", getLineNumber()));
+					editable = false; // for combos with display_value readonly default to false
+				}
+				String[] displayValues = dvstr == null ? values : dvstr.split(",");
+				if (displayValues.length != values.length)
+					throw new SAXException(tr("display_values ({0}) and values ({1}) must be of same number of elements.",
+							displayValues.length+" "+trn("element", "elements", displayValues.length),
+							values.length+" "+trn("element", "elements", values.length)));
+				current.add(new Combo(a.getValue("key"), a.getValue("text"), a.getValue("default"), values, displayValues, editable));
+			} else if (qname.equals("key"))
+				current.add(new Key(a.getValue("key"), a.getValue("value")));
+			else
+				throw new SAXException(tr("Unknown annotation object {0} at line {1} column {2}", qname, getLineNumber(), getColumnNumber()));
+		}
+
+		@Override public void endElement(String ns, String lname, String qname) {
+			if (qname.equals("item")) {
+				data.add(new AnnotationPreset(current, currentName, currentTypes));
+				current = null;
+				currentName = null;
+				currentTypes = null;
+			}
+		}
+	}
+
+	private List<Item> data;
+	public String name;
+	public Collection<Class<?>> types;
+
+	public AnnotationPreset(List<Item> data, String name, Collection<Class<?>> currentTypes) {
+		this.data = data;
+		this.name = name;
+		this.types = currentTypes;
+	}
+
+	/**
+	 * Create an empty annotation preset. This will not have any items and
+	 * will be an empty string as text. createPanel will return null.
+	 * Use this as default item for "do not select anything".
+	 */
+	public AnnotationPreset() {}
+
+	public static List<AnnotationPreset> readAll(InputStream inStream) throws IOException, SAXException {
+		BufferedReader in = null;
+		try {
+			in = new BufferedReader(new InputStreamReader(inStream, "UTF-8"));
+		} catch (UnsupportedEncodingException e) {
+			e.printStackTrace();
+			in = new BufferedReader(new InputStreamReader(inStream));
+		}
+		Parser p = new Parser();
+		p.parse(in);
+		return p.data;
+	}
+
+	public JPanel createPanel() {
+		if (data == null)
+			return null;
+		JPanel p = new JPanel(new GridBagLayout());
+		for (Item i : data)
+			i.addToPanel(p);
+		return p;
+	}
+
+	public Command createCommand(Collection<OsmPrimitive> participants) {
+		Collection<OsmPrimitive> sel = new LinkedList<OsmPrimitive>();
+		for (OsmPrimitive osm : participants)
+			if (types == null || types.contains(osm.getClass()))
+				sel.add(osm);
+		if (sel.isEmpty())
+			return null;
+
+		List<Command> cmds = new LinkedList<Command>();
+		for (Item i : data)
+			i.addCommands(sel, cmds);
+		if (cmds.size() == 0)
+			return null;
+		else if (cmds.size() == 1)
+			return cmds.get(0);
+		else
+			return new SequenceCommand(tr("Change Properties"), cmds);
+	}
+}
Index: /src/org/openstreetmap/josm/gui/annotation/AnnotationTester.java
===================================================================
--- /src/org/openstreetmap/josm/gui/annotation/AnnotationTester.java	(revision 129)
+++ /src/org/openstreetmap/josm/gui/annotation/AnnotationTester.java	(revision 129)
@@ -0,0 +1,106 @@
+package org.openstreetmap.josm.gui.annotation;
+
+import java.awt.BorderLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Vector;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JFrame;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+
+import org.xml.sax.SAXException;
+
+public class AnnotationTester extends JFrame {
+
+	private JComboBox annotationPresets;
+	private final String[] args;
+	private JPanel annotationPanel = new JPanel(new BorderLayout());
+	private JPanel panel = new JPanel(new BorderLayout());
+
+	public void reload() {
+		Vector<AnnotationPreset> allPresets = new Vector<AnnotationPreset>();
+		for (String source : args) {
+			InputStream in = null;
+			try {
+				if (source.startsWith("http") || source.startsWith("ftp") || source.startsWith("file"))
+					in = new URL(source).openStream();
+				else if (source.startsWith("resource://"))
+					in = AnnotationTester.class.getResourceAsStream(source.substring("resource:/".length()));
+				else
+					in = new FileInputStream(source);
+				allPresets.addAll(AnnotationPreset.readAll(in));
+			} catch (IOException e) {
+				e.printStackTrace();
+				JOptionPane.showMessageDialog(null, "Could not read annotation preset source: "+source);
+			} catch (SAXException e) {
+				e.printStackTrace();
+				JOptionPane.showMessageDialog(null, "Error parsing "+source+": "+e.getMessage());
+			}
+
+			try {
+	            if (in != null)
+	            	in.close();
+            } catch (IOException e) {
+            }
+		}
+		annotationPresets.setModel(new DefaultComboBoxModel(allPresets));
+	}
+
+	public void reselect() {
+		annotationPanel.removeAll();
+		AnnotationPreset preset = (AnnotationPreset)annotationPresets.getSelectedItem();
+		if (preset == null)
+			return;
+		JPanel p = preset.createPanel();
+		p.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
+		if (p != null)
+			annotationPanel.add(p, BorderLayout.NORTH);
+		panel.validate();
+		panel.repaint();
+	}
+	
+	public AnnotationTester(String[] args) {
+		super("Annotation Preset Tester");
+		this.args = args;
+		annotationPresets = new JComboBox();
+		annotationPresets.setRenderer(new AnnotationCellRenderer());
+		reload();
+
+		panel.add(annotationPresets, BorderLayout.NORTH);
+		panel.add(annotationPanel, BorderLayout.CENTER);
+		annotationPresets.addActionListener(new ActionListener(){
+			public void actionPerformed(ActionEvent e) {
+				reselect();
+			}
+		});
+		reselect();
+
+		JButton b = new JButton("Reload");
+		b.addActionListener(new ActionListener(){
+			public void actionPerformed(ActionEvent e) {
+				int i = annotationPresets.getSelectedIndex();
+				reload();
+				annotationPresets.setSelectedIndex(i);
+			}
+		});
+		panel.add(b, BorderLayout.SOUTH);
+
+		setContentPane(panel);
+		setSize(300,500);
+		setVisible(true);
+	}
+
+	public static void main(String[] args) {
+		JFrame f = new AnnotationTester(args);
+		f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+	}
+}
Index: c/org/openstreetmap/josm/gui/dialogs/AnnotationPreset.java
===================================================================
--- /src/org/openstreetmap/josm/gui/dialogs/AnnotationPreset.java	(revision 128)
+++ 	(revision )
@@ -1,260 +1,0 @@
-package org.openstreetmap.josm.gui.dialogs;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-import static org.openstreetmap.josm.tools.I18n.trn;
-
-import java.awt.GridBagLayout;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.swing.JCheckBox;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JTextField;
-
-import org.openstreetmap.josm.command.ChangePropertyCommand;
-import org.openstreetmap.josm.command.Command;
-import org.openstreetmap.josm.command.SequenceCommand;
-import org.openstreetmap.josm.data.osm.OsmPrimitive;
-import org.openstreetmap.josm.tools.GBC;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-import uk.co.wilson.xml.MinML2;
-
-
-/**
- * This class read encapsulate one annotation preset. A class method can
- * read in all predefined presets, either shipped with JOSM or that are
- * in the config directory.
- * 
- * It is also able to construct dialogs out of preset definitions.
- */
-public class AnnotationPreset {
-
-	private static interface Item {
-		void addToPanel(JPanel p);
-		void addCommands(Collection<OsmPrimitive> sel, List<Command> cmds);
-	}
-
-	public static class Text implements Item {
-		String key;
-		String label;
-		JTextField value = new JTextField();
-
-		public void addToPanel(JPanel p) {
-			p.add(new JLabel(label), GBC.std().insets(0,0,10,0));
-			p.add(value, GBC.eol().fill(GBC.HORIZONTAL));
-		}
-		public Text(String key, String label, String value) {
-			this.key = key;
-			this.label = label;
-			this.value.setText(value == null ? "" : value);
-		}
-		public void addCommands(Collection<OsmPrimitive> sel, List<Command> cmds) {
-			cmds.add(new ChangePropertyCommand(sel, key, value.getText()));
-		}
-	}
-
-	public static class Check implements Item {
-		String key;
-		JCheckBox check = new JCheckBox();
-
-		public void addToPanel(JPanel p) {
-			p.add(check, GBC.eol().fill(GBC.HORIZONTAL));
-		}
-		public Check(String key, String label, boolean check) {
-			this.key = key;
-			this.check.setText(label);
-			this.check.setSelected(check);
-		}
-		public void addCommands(Collection<OsmPrimitive> sel, List<Command> cmds) {
-			cmds.add(new ChangePropertyCommand(sel, key, check.isSelected() ? "true" : null));
-		}
-	}
-
-	public static class Combo implements Item {
-		String key;
-		String label;
-		JComboBox combo;
-		private final String[] values;
-
-		public void addToPanel(JPanel p) {
-			p.add(new JLabel(label), GBC.std().insets(0,0,10,0));
-			p.add(combo, GBC.eol().fill(GBC.HORIZONTAL));
-		}
-		public Combo(String key, String label, String def, String[] values, String[] displayedValues, boolean editable) {
-			this.key = key;
-			this.label = label;
-			this.values = values;
-			combo = new JComboBox(displayedValues);
-			combo.setEditable(editable);
-			combo.setSelectedItem(def);
-		}
-		public void addCommands(Collection<OsmPrimitive> sel, List<Command> cmds) {
-			String v = combo.getSelectedIndex() == -1 ? null : values[combo.getSelectedIndex()];
-			String str = combo.isEditable()?combo.getEditor().getItem().toString() : v;
-			cmds.add(new ChangePropertyCommand(sel, key, str));
-		}
-	}
-
-	public static class Label implements Item {
-		String text;
-
-		public void addToPanel(JPanel p) {
-			p.add(new JLabel(text), GBC.eol());
-		}
-		public Label(String text) {
-			this.text = text;
-		}
-		public void addCommands(Collection<OsmPrimitive> sel, List<Command> cmds) {}
-	}
-
-	public static class Key implements Item {
-		String key;
-		String value;
-
-		public void addToPanel(JPanel p) {}
-		public Key(String key, String value) {
-			this.key = key;
-			this.value = value;
-		}
-		public void addCommands(Collection<OsmPrimitive> sel, List<Command> cmds) {
-			cmds.add(new ChangePropertyCommand(sel, key, value != null && !value.equals("") ? value : null));
-		}
-	}
-
-	private static class Parser extends MinML2 {
-		List<AnnotationPreset> data = new LinkedList<AnnotationPreset>();
-		List<Item> current;
-		String currentName;
-		Collection<Class<?>> currentTypes;
-		private static int unknownCounter = 1;
-
-		@Override public void startElement(String ns, String lname, String qname, Attributes a) throws SAXException {
-			if (qname.equals("annotations"))
-				return;
-			if (qname.equals("item")) {
-				current = new LinkedList<Item>();
-				currentName = a.getValue("name");
-				if (currentName == null)
-					currentName = "Unnamed Preset #"+(unknownCounter++);
-				if (a.getValue("type") != null) {
-					String s = a.getValue("type");
-					try {
-						for (String type : s.split(",")) {
-							type = Character.toUpperCase(type.charAt(0))+type.substring(1);
-							if (currentTypes == null)
-								currentTypes = new LinkedList<Class<?>>();
-							currentTypes.add(Class.forName("org.openstreetmap.josm.data.osm."+type));
-						}
-					} catch (ClassNotFoundException e) {
-						e.printStackTrace();
-						throw new SAXException(tr("Unknown type at line {0}", getLineNumber()));
-					}
-				}
-			} else if (qname.equals("text"))
-				current.add(new Text(a.getValue("key"), a.getValue("text"), a.getValue("default")));
-			else if (qname.equals("check")) {
-				String s = a.getValue("default");
-				boolean clear = s == null || s.equals("0") || s.startsWith("off") || s.startsWith("false") || s.startsWith("no");
-				current.add(new Check(a.getValue("key"), a.getValue("text"), !clear));
-			} else if (qname.equals("label"))
-				current.add(new Label(a.getValue("text")));
-			else if (qname.equals("combo")) {
-				String[] values = a.getValue("values").split(",");
-				String s = a.getValue("readonly");
-				String dvstr = a.getValue("display_values");
-				boolean editable = s == null  || s.equals("0") || s.startsWith("off") || s.startsWith("false") || s.startsWith("no");
-				if (dvstr != null) {
-					if (editable && s != null)
-						throw new SAXException(tr("Cannot have a writable combobox with default values (line {0})", getLineNumber()));
-					editable = false; // for combos with display_value readonly default to false
-				}
-				String[] displayValues = dvstr == null ? values : dvstr.split(",");
-				if (displayValues.length != values.length)
-					throw new SAXException(tr("display_values ({0}) and values ({1}) must be of same number of elements.",
-							displayValues.length+" "+trn("element", "elements", displayValues.length),
-							values.length+" "+trn("element", "elements", values.length)));
-				current.add(new Combo(a.getValue("key"), a.getValue("text"), a.getValue("default"), values, displayValues, editable));
-			} else if (qname.equals("key"))
-				current.add(new Key(a.getValue("key"), a.getValue("value")));
-			else
-				throw new SAXException(tr("Unknown annotation object {0} at line {1} column {2}", qname, getLineNumber(), getColumnNumber()));
-		}
-
-		@Override public void endElement(String ns, String lname, String qname) {
-			if (qname.equals("item")) {
-				data.add(new AnnotationPreset(current, currentName, currentTypes));
-				current = null;
-				currentName = null;
-				currentTypes = null;
-			}
-		}
-	}
-
-	private List<Item> data;
-	public String name;
-	Collection<Class<?>> types;
-
-	public AnnotationPreset(List<Item> data, String name, Collection<Class<?>> currentTypes) {
-		this.data = data;
-		this.name = name;
-		this.types = currentTypes;
-	}
-
-	/**
-	 * Create an empty annotation preset. This will not have any items and
-	 * will be an empty string as text. createPanel will return null.
-	 * Use this as default item for "do not select anything".
-	 */
-	public AnnotationPreset() {}
-
-	public static List<AnnotationPreset> readAll(InputStream inStream) throws IOException, SAXException {
-		BufferedReader in = null;
-		try {
-			in = new BufferedReader(new InputStreamReader(inStream, "UTF-8"));
-		} catch (UnsupportedEncodingException e) {
-			e.printStackTrace();
-			in = new BufferedReader(new InputStreamReader(inStream));
-		}
-		Parser p = new Parser();
-		p.parse(in);
-		return p.data;
-	}
-
-	public JPanel createPanel() {
-		if (data == null)
-			return null;
-		JPanel p = new JPanel(new GridBagLayout());
-		for (Item i : data)
-			i.addToPanel(p);
-		return p;
-	}
-
-	public Command createCommand(Collection<OsmPrimitive> participants) {
-		Collection<OsmPrimitive> sel = new LinkedList<OsmPrimitive>();
-		for (OsmPrimitive osm : participants)
-			if (types == null || types.contains(osm.getClass()))
-				sel.add(osm);
-		if (sel.isEmpty())
-			return null;
-
-		List<Command> cmds = new LinkedList<Command>();
-		for (Item i : data)
-			i.addCommands(sel, cmds);
-		if (cmds.size() == 0)
-			return null;
-		else if (cmds.size() == 1)
-			return cmds.get(0);
-		else
-			return new SequenceCommand(tr("Change Properties"), cmds);
-	}
-}
Index: c/org/openstreetmap/josm/gui/dialogs/AnnotationTester.java
===================================================================
--- /src/org/openstreetmap/josm/gui/dialogs/AnnotationTester.java	(revision 128)
+++ 	(revision )
@@ -1,105 +1,0 @@
-package org.openstreetmap.josm.gui.dialogs;
-
-import java.awt.BorderLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Vector;
-
-import javax.swing.BorderFactory;
-import javax.swing.DefaultComboBoxModel;
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JFrame;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-
-import org.xml.sax.SAXException;
-
-public class AnnotationTester extends JFrame {
-
-	private JComboBox annotationPresets;
-	private final String[] args;
-	private JPanel annotationPanel = new JPanel(new BorderLayout());
-	private JPanel panel = new JPanel(new BorderLayout());
-
-	public void reload() {
-		Vector<AnnotationPreset> allPresets = new Vector<AnnotationPreset>();
-		for (String source : args) {
-			InputStream in = null;
-			try {
-				if (source.startsWith("http") || source.startsWith("ftp") || source.startsWith("file"))
-					in = new URL(source).openStream();
-				else if (source.startsWith("resource://"))
-					in = AnnotationTester.class.getResourceAsStream(source.substring("resource:/".length()));
-				else
-					in = new FileInputStream(source);
-				allPresets.addAll(AnnotationPreset.readAll(in));
-			} catch (IOException e) {
-				e.printStackTrace();
-				JOptionPane.showMessageDialog(null, "Could not read annotation preset source: "+source);
-			} catch (SAXException e) {
-				e.printStackTrace();
-				JOptionPane.showMessageDialog(null, "Error parsing "+source+": "+e.getMessage());
-			}
-
-			try {
-	            if (in != null)
-	            	in.close();
-            } catch (IOException e) {
-            }
-		}
-		annotationPresets.setModel(new DefaultComboBoxModel(allPresets));
-	}
-
-	public void reselect() {
-		annotationPanel.removeAll();
-		AnnotationPreset preset = (AnnotationPreset)annotationPresets.getSelectedItem();
-		if (preset == null)
-			return;
-		JPanel p = preset.createPanel();
-		p.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
-		if (p != null)
-			annotationPanel.add(p, BorderLayout.NORTH);
-		panel.validate();
-		panel.repaint();
-	}
-	
-	public AnnotationTester(String[] args) {
-		super("Annotation Preset Tester");
-		this.args = args;
-		annotationPresets = new JComboBox();
-		reload();
-
-		panel.add(annotationPresets, BorderLayout.NORTH);
-		panel.add(annotationPanel, BorderLayout.CENTER);
-		annotationPresets.addActionListener(new ActionListener(){
-			public void actionPerformed(ActionEvent e) {
-				reselect();
-			}
-		});
-		reselect();
-
-		JButton b = new JButton("Reload");
-		b.addActionListener(new ActionListener(){
-			public void actionPerformed(ActionEvent e) {
-				int i = annotationPresets.getSelectedIndex();
-				reload();
-				annotationPresets.setSelectedIndex(i);
-			}
-		});
-		panel.add(b, BorderLayout.SOUTH);
-
-		setContentPane(panel);
-		setSize(300,500);
-		setVisible(true);
-	}
-
-	public static void main(String[] args) {
-		JFrame f = new AnnotationTester(args);
-		f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-	}
-}
Index: /src/org/openstreetmap/josm/gui/dialogs/HistoryDialog.java
===================================================================
--- /src/org/openstreetmap/josm/gui/dialogs/HistoryDialog.java	(revision 128)
+++ /src/org/openstreetmap/josm/gui/dialogs/HistoryDialog.java	(revision 129)
@@ -57,12 +57,12 @@
 		return c.getTime();
 	}
-	
+
 	private static class HistoryItem implements Comparable<HistoryItem> {
 		OsmPrimitive osm;
 		boolean visible;
-		
+
 		public int compareTo(HistoryItem o) {
-	        return unifyDate(osm.timestamp).compareTo(unifyDate(o.osm.timestamp));
-        }
+			return unifyDate(osm.timestamp).compareTo(unifyDate(o.osm.timestamp));
+		}
 	}
 
@@ -100,15 +100,15 @@
 		history.getTableHeader().setDefaultRenderer(new DefaultTableCellRenderer(){
 			@Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
-	            JComponent c = (JComponent)oldRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
-	            if (!value.equals(""))
-	            	return c;
-	            JLabel l = new JLabel(ImageProvider.get("misc","showhide"));
-	            l.setForeground(c.getForeground());
-	            l.setBackground(c.getBackground());
-	            l.setFont(c.getFont());
-	            l.setBorder(c.getBorder());
-	            l.setOpaque(true);
-	            return l;
-            }
+				JComponent c = (JComponent)oldRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
+				if (!value.equals(""))
+					return c;
+				JLabel l = new JLabel(ImageProvider.get("misc","showhide"));
+				l.setForeground(c.getForeground());
+				l.setBackground(c.getBackground());
+				l.setFont(c.getFont());
+				l.setBorder(c.getBorder());
+				l.setOpaque(true);
+				return l;
+			}
 		});
 
Index: /src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java
===================================================================
--- /src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java	(revision 128)
+++ /src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java	(revision 129)
@@ -28,11 +28,8 @@
 
 import javax.swing.DefaultComboBoxModel;
-import javax.swing.DefaultListCellRenderer;
 import javax.swing.JButton;
 import javax.swing.JComboBox;
-import javax.swing.JComponent;
 import javax.swing.JDialog;
 import javax.swing.JLabel;
-import javax.swing.JList;
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
@@ -50,4 +47,6 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.gui.MapFrame;
+import org.openstreetmap.josm.gui.annotation.AnnotationCellRenderer;
+import org.openstreetmap.josm.gui.annotation.AnnotationPreset;
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.xml.sax.SAXException;
@@ -264,25 +263,5 @@
 			}
 		});
-		annotationPresets.setRenderer(new DefaultListCellRenderer(){
-			@Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
-	            AnnotationPreset a = (AnnotationPreset)value;
-				if (a.name == null)
-	            	return super.getListCellRendererComponent(list, "", index, false, false);
-				JComponent c = (JComponent)super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
-	            JLabel l = new JLabel((a).name);
-	            l.setForeground(c.getForeground());
-	            l.setBackground(c.getBackground());
-	            l.setFont(c.getFont());
-	            l.setBorder(c.getBorder());
-	            if (a.types == null)
-	            	l.setIcon(ImageProvider.get("data", "empty"));
-	            else if (a.types.size() != 1)
-	            	l.setIcon(ImageProvider.get("data", "object"));
-	            else
-	            	l.setIcon(ImageProvider.get("data", a.types.iterator().next().getSimpleName().toLowerCase()));
-	            l.setOpaque(true);
-	            return l;
-            }
-		});
+		annotationPresets.setRenderer(new AnnotationCellRenderer());
 
 		data.setColumnIdentifiers(new String[]{tr("Key"),tr("Value")});
Index: /src/org/openstreetmap/josm/gui/layer/GeoImageLayer.java
===================================================================
--- /src/org/openstreetmap/josm/gui/layer/GeoImageLayer.java	(revision 128)
+++ /src/org/openstreetmap/josm/gui/layer/GeoImageLayer.java	(revision 129)
@@ -299,5 +299,8 @@
 				e.icon.paintIcon(mv, g, r.x, r.y);
 				Border b = null;
-				if (!clickedFound && mousePressed && r.contains(mv.getMousePosition())) {
+				Point mousePosition = mv.getMousePosition();
+				if (mousePosition == null)
+					continue; // mouse outside the whole window
+				if (!clickedFound && mousePressed && r.contains(mousePosition)) {
 					b = BorderFactory.createBevelBorder(BevelBorder.LOWERED);
 					clickedFound = true;
