Index: src/org/openstreetmap/josm/Main.java
===================================================================
--- src/org/openstreetmap/josm/Main.java	(revision 74)
+++ src/org/openstreetmap/josm/Main.java	(revision 75)
@@ -35,4 +35,5 @@
 import org.openstreetmap.josm.data.Preferences;
 import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.data.projection.Epsg4263;
 import org.openstreetmap.josm.data.projection.Projection;
 import org.openstreetmap.josm.gui.MapFrame;
@@ -222,22 +223,4 @@
 			} else
 				pref.load();
-		} catch (RuntimeException x) {
-			//TODO: Temporary code to update user preferences.
-			if (x.getMessage().equals("old version")) {
-				int answer = JOptionPane.showConfirmDialog(
-						null, 
-						"The preferences - file format has changed.\nThe settings will be reset to default.",
-						"Information",
-						JOptionPane.OK_CANCEL_OPTION);
-				if (answer == JOptionPane.CANCEL_OPTION)
-					System.exit(0);
-				pref.resetToDefault();
-				try {
-					pref.save();
-				} catch (IOException e) {
-					e.printStackTrace();
-					errMsg = "Preferences could not be loaded. Reverting to default.";
-				}
-			}
 		} catch (IOException e1) {
 			e1.printStackTrace();
@@ -258,6 +241,6 @@
 		} catch (Exception e) {
 			e.printStackTrace();
-			JOptionPane.showMessageDialog(null, "The projection could not be initialized. Aborting.");
-			System.exit(1);
+			JOptionPane.showMessageDialog(null, "The projection could not be read from preferences. Using EPSG:4263.");
+			proj = new Epsg4263();
 		}
 		
Index: src/org/openstreetmap/josm/actions/DownloadAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/DownloadAction.java	(revision 74)
+++ src/org/openstreetmap/josm/actions/DownloadAction.java	(revision 75)
@@ -55,6 +55,4 @@
 public class DownloadAction extends JosmAction {
 
-    private enum DownloadStatus {FINISHED, REDISPLAY}
-
     /**
      * minlat, minlon, maxlat, maxlon
@@ -77,5 +75,5 @@
 	public void actionPerformed(ActionEvent e) {
 		
-		String osmDataServer = Main.pref.get("osmDataServer");
+		String osmDataServer = Main.pref.get("osm-server.url");
 		//TODO: Remove this in later versions (temporary only)
 		if (osmDataServer.endsWith("/0.2") || osmDataServer.endsWith("/0.2/")) {
@@ -90,5 +88,5 @@
 				return;
 			int cutPos = osmDataServer.endsWith("/0.2") ? 4 : 5;
-			Main.pref.put("osmDataServer", osmDataServer.substring(0, osmDataServer.length()-cutPos));
+			Main.pref.put("osm-server.url", osmDataServer.substring(0, osmDataServer.length()-cutPos));
 			try {
 				Main.pref.save();
@@ -244,5 +242,5 @@
 			if (r != JOptionPane.OK_OPTION)
 				return;
-			if (startDownload() == DownloadStatus.FINISHED) 
+			if (startDownload()) 
 				break;
 		}
@@ -251,10 +249,11 @@
 	/**
 	 * Read the values from the edit fields and from the download.
-	 */
-	private DownloadStatus startDownload() {
+	 * @return <code>true</code> for a success, <code>false</code> redisplay
+	 */
+	private boolean startDownload() {
 		Bookmark b = readBookmark();
 		if (b == null) {
 			JOptionPane.showMessageDialog(Main.main, "Please enter the desired coordinates or click on a bookmark.");
-			return DownloadStatus.REDISPLAY;
+			return false;
 		}
 
@@ -264,5 +263,5 @@
 		double maxlat = b.latlon[3];
 		download(rawGps.isSelected(), minlon, minlat, maxlon, maxlat);
-		return DownloadStatus.FINISHED;
+		return true;
 	}
 	
Index: src/org/openstreetmap/josm/actions/UploadAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/UploadAction.java	(revision 74)
+++ src/org/openstreetmap/josm/actions/UploadAction.java	(revision 75)
@@ -40,5 +40,5 @@
 	public void actionPerformed(ActionEvent e) {
 		
-		String osmDataServer = Main.pref.get("osmDataServer");
+		String osmDataServer = Main.pref.get("osm-server.url");
 		//TODO: Remove this in later versions (temporary only)
 		if (osmDataServer.endsWith("/0.2") || osmDataServer.endsWith("/0.2/")) {
@@ -53,5 +53,5 @@
 				return;
 			int cutPos = osmDataServer.endsWith("/0.2") ? 4 : 5;
-			Main.pref.put("osmDataServer", osmDataServer.substring(0, osmDataServer.length()-cutPos));
+			Main.pref.put("osm-server.url", osmDataServer.substring(0, osmDataServer.length()-cutPos));
 			try {
 				Main.pref.save();
Index: src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- src/org/openstreetmap/josm/data/Preferences.java	(revision 74)
+++ src/org/openstreetmap/josm/data/Preferences.java	(revision 75)
@@ -1,4 +1,6 @@
 package org.openstreetmap.josm.data;
 
+import java.awt.Color;
+import java.io.BufferedReader;
 import java.io.FileReader;
 import java.io.FileWriter;
@@ -6,13 +8,12 @@
 import java.io.PrintWriter;
 import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedList;
 import java.util.SortedMap;
 import java.util.TreeMap;
 import java.util.Map.Entry;
 
-import org.openstreetmap.josm.tools.XmlWriter;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-import uk.co.wilson.xml.MinML2;
+import org.openstreetmap.josm.data.osm.visitor.SimplePaintVisitor;
+import org.openstreetmap.josm.tools.ColorHelper;
 
 
@@ -59,9 +60,22 @@
 		return properties.get(key);
 	}
+	synchronized public String get(String key, String def) {
+		String prop = properties.get(key);
+		if (prop == null || prop.equals(""))
+			return def;
+		return prop;
+	}
+	synchronized public Collection<Entry<String, String>> getAllPrefix(String prefix) {
+		LinkedList<Entry<String,String>> all = new LinkedList<Entry<String,String>>();
+		for (Entry<String,String> e : properties.entrySet())
+			if (e.getKey().startsWith(prefix))
+				all.add(e);
+		return all;
+	}
 	synchronized public boolean getBoolean(String key) {
 		return properties.containsKey(key) ? Boolean.parseBoolean(properties.get(key)) : false;
 	}
-	
-	
+
+
 	synchronized public void put(String key, String value) {
 		if (value == null)
@@ -83,13 +97,7 @@
 	public void save() throws IOException {
 		PrintWriter out = new PrintWriter(new FileWriter(getPreferencesDir()+"preferences"));
-		out.println(XmlWriter.header());
-		out.println("<josm>");
-		for (Entry<String, String> e : properties.entrySet()) {
-			out.print("  <"+e.getKey());
+		for (Entry<String, String> e : properties.entrySet())
 			if (!e.getValue().equals(""))
-				out.print(" value='"+XmlWriter.encode(e.getValue())+"'");
-			out.println(" />");
-		}
-		out.println("</josm>");
+				out.println(e.getKey()+"="+e.getValue());
 		out.close();
 	}
@@ -97,18 +105,12 @@
 
 	public void load() throws IOException {
-		MinML2 reader = new MinML2(){
-			@Override public void startElement(String ns, String name, String qName, Attributes attr) {
-				if (name.equals("josm-settings"))
-					throw new RuntimeException("old version");
-				String v = attr.getValue("value");
-				if (!name.equals("josm"))
-					properties.put(name, v == null ? "" : v);
-			}
-		};
-		try {
-			reader.parse(new FileReader(getPreferencesDir()+"preferences"));
-		} catch (SAXException e) {
-			e.printStackTrace();
-			throw new IOException("Error in preferences file");
+		properties.clear();
+		BufferedReader in = new BufferedReader(new FileReader(getPreferencesDir()+"preferences"));
+		int lineNumber = 0;
+		for (String line = in.readLine(); line != null; line = in.readLine(), lineNumber++) {
+			int i = line.indexOf('=');
+			if (i == -1 || i == 0)
+				throw new IOException("Malformed config file at line "+lineNumber);
+			properties.put(line.substring(0,i), line.substring(i+1));
 		}
 	}
@@ -118,5 +120,11 @@
 		properties.put("laf", "javax.swing.plaf.metal.MetalLookAndFeel");
 		properties.put("projection", "org.openstreetmap.josm.data.projection.Epsg4263");
-		properties.put("osmDataServer", "http://www.openstreetmap.org/api");
+		properties.put("osm-server.url", "http://www.openstreetmap.org/api");
+		properties.put("color.node", ColorHelper.color2html(Color.red));
+		properties.put("color.segment", ColorHelper.color2html(SimplePaintVisitor.darkgreen));
+		properties.put("color.way", ColorHelper.color2html(SimplePaintVisitor.darkblue));
+		properties.put("color.incomplete way", ColorHelper.color2html(SimplePaintVisitor.darkerblue));
+		properties.put("color.selected", ColorHelper.color2html(Color.white));
+		properties.put("color.gps point", ColorHelper.color2html(Color.gray));
 	}
 }
Index: src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java
===================================================================
--- src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java	(revision 74)
+++ src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java	(revision 75)
@@ -5,8 +5,10 @@
 import java.awt.Point;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.LineSegment;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.NavigatableComponent;
+import org.openstreetmap.josm.tools.ColorHelper;
 
 /**
@@ -18,7 +20,7 @@
 public class SimplePaintVisitor implements Visitor {
 
-	private final static Color darkerblue = new Color(0,0,96);
-	private final static Color darkblue = new Color(0,0,128);
-	private final static Color darkgreen = new Color(0,128,0);
+	public final static Color darkerblue = new Color(0,0,96);
+	public final static Color darkblue = new Color(0,0,128);
+	public final static Color darkgreen = new Color(0,128,0);
 
 	/**
@@ -48,5 +50,6 @@
 	 */
 	public void visit(Node n) {
-		drawNode(n, n.isSelected() ? Color.WHITE : Color.RED);
+		drawNode(n, n.isSelected() ? getPreferencesColor("selected", Color.WHITE)
+				: getPreferencesColor("node", Color.RED));
 	}
 
@@ -56,5 +59,5 @@
 	 */
 	public void visit(LineSegment ls) {
-		drawLineSegment(ls, darkgreen);
+		drawLineSegment(ls, getPreferencesColor("segment", darkgreen));
 	}
 
@@ -65,8 +68,8 @@
 	public void visit(Way t) {
 		// only to overwrite with blue
-		Color wayColor = darkblue;
+		Color wayColor = getPreferencesColor("way", darkblue);
 		for (LineSegment ls : t.segments) {
 			if (ls.incomplete) {
-				wayColor = darkerblue;
+				wayColor = getPreferencesColor("incomplete way", darkerblue);
 				break;
 			}
@@ -74,5 +77,5 @@
 		for (LineSegment ls : t.segments)
 			if (!ls.isSelected()) // selected already in good color
-				drawLineSegment(ls, t.isSelected() ? Color.WHITE : wayColor);
+				drawLineSegment(ls, t.isSelected() ? getPreferencesColor("selected", Color.WHITE) : wayColor);
 	}
 
@@ -96,5 +99,5 @@
 			return;
 		if (ls.isSelected())
-			col = Color.WHITE;
+			col = getPreferencesColor("selected", Color.WHITE);
 		g.setColor(col);
 		Point p1 = nc.getPoint(ls.from.eastNorth);
@@ -102,3 +105,10 @@
 		g.drawLine(p1.x, p1.y, p2.x, p2.y);
 	}
+	
+	private Color getPreferencesColor(String colName, Color def) {
+		String colStr = Main.pref.get("color."+colName);
+		if (colStr.equals(""))
+			return def;
+		return ColorHelper.html2color(colStr);
+	}
 }
Index: src/org/openstreetmap/josm/gui/PreferenceDialog.java
===================================================================
--- src/org/openstreetmap/josm/gui/PreferenceDialog.java	(revision 74)
+++ src/org/openstreetmap/josm/gui/PreferenceDialog.java	(revision 75)
@@ -1,4 +1,5 @@
 package org.openstreetmap.josm.gui;
 
+import java.awt.Color;
 import java.awt.Component;
 import java.awt.Dimension;
@@ -8,4 +9,7 @@
 import java.awt.event.ActionListener;
 import java.io.IOException;
+import java.util.Collection;
+import java.util.Vector;
+import java.util.Map.Entry;
 
 import javax.swing.AbstractAction;
@@ -15,4 +19,5 @@
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
+import javax.swing.JColorChooser;
 import javax.swing.JComboBox;
 import javax.swing.JDialog;
@@ -22,12 +27,17 @@
 import javax.swing.JPanel;
 import javax.swing.JPasswordField;
+import javax.swing.JScrollPane;
 import javax.swing.JTabbedPane;
+import javax.swing.JTable;
 import javax.swing.JTextField;
 import javax.swing.ListCellRenderer;
+import javax.swing.ListSelectionModel;
 import javax.swing.UIManager;
 import javax.swing.UIManager.LookAndFeelInfo;
+import javax.swing.table.TableCellRenderer;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.projection.Projection;
+import org.openstreetmap.josm.tools.ColorHelper;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -52,13 +62,20 @@
 			Main.pref.put("laf", ((LookAndFeelInfo)lafCombo.getSelectedItem()).getClassName());
 			Main.pref.put("projection", projectionCombo.getSelectedItem().getClass().getName());
-			Main.pref.put("osmDataServer", osmDataServer.getText());
-			Main.pref.put("osmDataUsername", osmDataUsername.getText());
+			Main.pref.put("osm-server.url", osmDataServer.getText());
+			Main.pref.put("osm-server.username", osmDataUsername.getText());
 			String pwd = String.valueOf(osmDataPassword.getPassword());
 			if (pwd.equals(""))
 				pwd = null;
-			Main.pref.put("osmDataPassword", pwd);
+			Main.pref.put("osm-server.password", pwd);
 			Main.pref.put("csvImportString", csvImportString.getText());
 			Main.pref.put("drawRawGpsLines", drawRawGpsLines.isSelected());
 			Main.pref.put("forceRawGpsLines", forceRawGpsLines.isSelected());
+
+			for (int i = 0; i < colors.getRowCount(); ++i) {
+				String name = (String)colors.getValueAt(i, 0);
+				Color col = (Color)colors.getValueAt(i, 1);
+				Main.pref.put("color."+name, ColorHelper.color2html(col));
+			}
+
 			try {
 				Main.pref.save();
@@ -69,4 +86,5 @@
 			if (requiresRestart)
 				JOptionPane.showMessageDialog(PreferenceDialog.this, "You have to restart JOSM for some settings to take effect.");
+			Main.main.repaint();
 			setVisible(false);
 		}
@@ -130,4 +148,7 @@
 	JCheckBox forceRawGpsLines = new JCheckBox("Force lines if no line segments imported.");
 
+	JTable colors;
+	
+	
 	/**
 	 * Create a preference setting dialog from an preferences-file. If the file does not
@@ -140,5 +161,11 @@
 
 		// look and feel combo box
-		lafCombo.setSelectedItem(Main.pref.get("laf"));
+		String laf = Main.pref.get("laf");
+		for (int i = 0; i < lafCombo.getItemCount(); ++i) {
+			if (((LookAndFeelInfo)lafCombo.getItemAt(i)).getClassName().equals(laf)) {
+				lafCombo.setSelectedIndex(i);
+				break;
+			}
+		}
 		final ListCellRenderer oldRenderer = lafCombo.getRenderer();
 		lafCombo.setRenderer(new DefaultListCellRenderer(){
@@ -175,5 +202,60 @@
 		});
 
-		
+		osmDataServer.setText(Main.pref.get("osm-server.url"));
+		osmDataUsername.setText(Main.pref.get("osm-server.username"));
+		osmDataPassword.setText(Main.pref.get("osm-server.password"));
+		csvImportString.setText(Main.pref.get("csvImportString"));
+		drawRawGpsLines.setSelected(Main.pref.getBoolean("drawRawGpsLines"));
+		forceRawGpsLines.setToolTipText("Force drawing of lines if the imported data contain no line information.");
+		forceRawGpsLines.setSelected(Main.pref.getBoolean("forceRawGpsLines"));
+		forceRawGpsLines.setEnabled(drawRawGpsLines.isSelected());
+
+		
+		Collection<Entry<String,String>> c = Main.pref.getAllPrefix("color.");
+		Vector<Vector<Object>> rows = new Vector<Vector<Object>>();
+		for (Entry<String,String> e : c) {
+			Vector<Object> row = new Vector<Object>(2);
+			row.add(e.getKey().substring("color.".length()));
+			row.add(ColorHelper.html2color(e.getValue()));
+			rows.add(row);
+		}
+		Vector<Object> cols = new Vector<Object>(2);
+		cols.add("Color");
+		cols.add("Name");
+		colors = new JTable(rows, cols){
+			@Override public boolean isCellEditable(int row, int column) {
+				return false;
+			}
+		};
+		colors.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+		JButton colorEdit = new JButton("Choose");
+		colorEdit.addActionListener(new ActionListener(){
+			public void actionPerformed(ActionEvent e) {
+				if (colors.getSelectedRowCount() == 0) {
+					JOptionPane.showMessageDialog(PreferenceDialog.this, "Please select a color.");
+					return;
+				}
+				int sel = colors.getSelectedRow();
+				JColorChooser chooser = new JColorChooser((Color)colors.getValueAt(sel, 1));
+				int answer = JOptionPane.showConfirmDialog(PreferenceDialog.this, chooser, "Choose a color for "+colors.getValueAt(sel, 0), JOptionPane.OK_CANCEL_OPTION);
+				if (answer == JOptionPane.OK_OPTION)
+					colors.setValueAt(chooser.getColor(), sel, 1);
+			}
+		});
+		final TableCellRenderer oldColorsRenderer = colors.getDefaultRenderer(Object.class);
+		colors.setDefaultRenderer(Object.class, new TableCellRenderer(){
+			public Component getTableCellRendererComponent(JTable t, Object o, boolean selected, boolean focus, int row, int column) {
+				if (column == 1) {
+					JLabel l = new JLabel(ColorHelper.color2html((Color)o));
+					l.setBackground((Color)o);
+					l.setOpaque(true);
+					return l;
+				}
+				return oldColorsRenderer.getTableCellRendererComponent(t,o,selected,focus,row,column);
+			}
+		});
+		colors.getColumnModel().getColumn(1).setWidth(100);
+
+		// setting tooltips
 		osmDataServer.setToolTipText("The base URL to the OSM server (REST API)");
 		osmDataUsername.setToolTipText("Login name (email) to the OSM account.");
@@ -186,14 +268,8 @@
 				"Other example: \"lat,lon\" will just read lat/lon values comma seperated.</html>");
 		drawRawGpsLines.setToolTipText("If your gps device draw to few lines, select this to draw lines along your way.");
-		drawRawGpsLines.setSelected(Main.pref.getBoolean("drawRawGpsLines"));
-		forceRawGpsLines.setToolTipText("Force drawing of lines if the imported data contain no line information.");
-		forceRawGpsLines.setSelected(Main.pref.getBoolean("forceRawGpsLines"));
-		forceRawGpsLines.setEnabled(drawRawGpsLines.isSelected());
-
-		osmDataServer.setText(Main.pref.get("osmDataServer"));
-		osmDataUsername.setText(Main.pref.get("osmDataUsername"));
-		osmDataPassword.setText(Main.pref.get("osmDataPassword"));
-		csvImportString.setText(Main.pref.get("csvImportString"));
-
+		colors.setToolTipText("Colors used by different objects in JOSM.");
+		
+		// creating the gui
+		
 		// Display tab
 		JPanel display = createPreferenceTab("display", "Display Settings", "Various settings that influence the visual representation of the whole program.");
@@ -202,6 +278,10 @@
 		display.add(lafCombo, GBC.eol().fill(GBC.HORIZONTAL));
 		display.add(drawRawGpsLines, GBC.eol().insets(20,0,0,0));
-		display.add(forceRawGpsLines, GBC.eol().insets(40,0,0,0));
-		display.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL));
+		display.add(forceRawGpsLines, GBC.eop().insets(40,0,0,0));
+		display.add(new JLabel("Colors"), GBC.eol());
+		colors.setPreferredScrollableViewportSize(new Dimension(100,112));
+		display.add(new JScrollPane(colors), GBC.eol().fill(GBC.BOTH));
+		display.add(colorEdit, GBC.eol().anchor(GBC.EAST));
+		//display.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL));
 
 		// Connection tab
@@ -221,4 +301,5 @@
 		con.add(new JLabel("CSV import specification (empty: read from first line in data)"), GBC.eol());
 		con.add(csvImportString, GBC.eop().fill(GBC.HORIZONTAL));
+		con.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL));
 		
 		// Map tab
Index: src/org/openstreetmap/josm/gui/dialogs/LayerList.java
===================================================================
--- src/org/openstreetmap/josm/gui/dialogs/LayerList.java	(revision 74)
+++ src/org/openstreetmap/josm/gui/dialogs/LayerList.java	(revision 75)
@@ -30,4 +30,5 @@
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.ImageProvider.OverlayPosition;
 
 /**
@@ -86,5 +87,5 @@
 				Icon icon = layer.getIcon();
 				if (!layer.visible)
-					icon = ImageProvider.overlay(icon, invisible, ImageProvider.OverlayPosition.SOUTHEAST);
+					icon = ImageProvider.overlay(icon, invisible, OverlayPosition.SOUTHEAST);
 				label.setIcon(icon);
 				label.setToolTipText(layer.getToolTipText());
Index: src/org/openstreetmap/josm/gui/layer/RawGpsDataLayer.java
===================================================================
--- src/org/openstreetmap/josm/gui/layer/RawGpsDataLayer.java	(revision 74)
+++ src/org/openstreetmap/josm/gui/layer/RawGpsDataLayer.java	(revision 75)
@@ -16,4 +16,5 @@
 import org.openstreetmap.josm.data.projection.Projection;
 import org.openstreetmap.josm.gui.MapView;
+import org.openstreetmap.josm.tools.ColorHelper;
 import org.openstreetmap.josm.tools.ImageProvider;
 
@@ -62,5 +63,9 @@
 	@Override
 	public void paint(Graphics g, MapView mv) {
-		g.setColor(Color.GRAY);
+		String gpsCol = Main.pref.get("color.gps point");
+		if (gpsCol.equals(""))
+			g.setColor(Color.GRAY);
+		else
+			g.setColor(ColorHelper.html2color(gpsCol));
 		Point old = null;
 		for (Collection<EastNorth> c : eastNorth) {
Index: src/org/openstreetmap/josm/io/OsmConnection.java
===================================================================
--- src/org/openstreetmap/josm/io/OsmConnection.java	(revision 74)
+++ src/org/openstreetmap/josm/io/OsmConnection.java	(revision 75)
@@ -39,6 +39,6 @@
 		@Override
 		protected PasswordAuthentication getPasswordAuthentication() {
-			String username = Main.pref.get("osmDataUsername");
-			String password = Main.pref.get("osmDataPassword");
+			String username = Main.pref.get("osm-server.username");
+			String password = Main.pref.get("osm-server.password");
 			if (passwordtried || username.equals("") || password.equals("")) {
 				JPanel p = new JPanel(new GridBagLayout());
Index: src/org/openstreetmap/josm/io/OsmServerReader.java
===================================================================
--- src/org/openstreetmap/josm/io/OsmServerReader.java	(revision 74)
+++ src/org/openstreetmap/josm/io/OsmServerReader.java	(revision 75)
@@ -48,5 +48,5 @@
 	 */
 	public Collection<Collection<LatLon>> parseRawGps() throws IOException, JDOMException {
-		String url = Main.pref.get("osmDataServer")+"/0.3/trackpoints?bbox="+lon1+","+lat1+","+lon2+","+lat2+"&page=";
+		String url = Main.pref.get("osm-server.url")+"/0.3/trackpoints?bbox="+lon1+","+lat1+","+lon2+","+lat2+"&page=";
 		Collection<Collection<LatLon>> data = new LinkedList<Collection<LatLon>>();
 		Collection<LatLon> list = new LinkedList<LatLon>();
@@ -80,5 +80,5 @@
 	 */
 	public DataSet parseOsm() throws SAXException, IOException {
-		Reader r = getReader(Main.pref.get("osmDataServer")+"/0.3/map?bbox="+lon1+","+lat1+","+lon2+","+lat2);
+		Reader r = getReader(Main.pref.get("osm-server.url")+"/0.3/map?bbox="+lon1+","+lat1+","+lon2+","+lat2);
 		if (r == null)
 			return null;
Index: src/org/openstreetmap/josm/io/OsmServerWriter.java
===================================================================
--- src/org/openstreetmap/josm/io/OsmServerWriter.java	(revision 74)
+++ src/org/openstreetmap/josm/io/OsmServerWriter.java	(revision 75)
@@ -136,5 +136,5 @@
 			OsmPrimitive osm, boolean addBody) {
 		try {
-			URL url = new URL(Main.pref.get("osmDataServer") + "/0.3/" + urlSuffix + "/" + osm.id);
+			URL url = new URL(Main.pref.get("osm-server.url") + "/0.3/" + urlSuffix + "/" + osm.id);
 			System.out.println("upload to: "+url);
 			HttpURLConnection con = (HttpURLConnection) url.openConnection();
Index: src/org/openstreetmap/josm/tools/ColorHelper.java
===================================================================
--- src/org/openstreetmap/josm/tools/ColorHelper.java	(revision 75)
+++ src/org/openstreetmap/josm/tools/ColorHelper.java	(revision 75)
@@ -0,0 +1,33 @@
+package org.openstreetmap.josm.tools;
+
+import java.awt.Color;
+
+/**
+ * Helper to convert from color to html string and back
+ */
+public class ColorHelper {
+	
+	public static Color html2color(String html) {
+		if (html.length() > 0 && html.charAt(0) == '#')
+			html = html.substring(1);
+		if (html.length() != 6)
+			return null;
+		try {
+			return new Color(
+					Integer.parseInt(html.substring(0,2),16),
+					Integer.parseInt(html.substring(2,4),16),
+					Integer.parseInt(html.substring(4,6),16));
+		} catch (NumberFormatException e) {
+			return null;
+		}		
+	}
+
+	private static String int2hex(int i) {
+		String s = Integer.toHexString(i / 16) + Integer.toHexString(i % 16);
+		return s.toUpperCase();
+	}
+	
+	public static String color2html(Color col) {
+		return "#"+int2hex(col.getRed())+int2hex(col.getGreen())+int2hex(col.getBlue());
+	}
+}
Index: src/org/openstreetmap/josm/tools/ImageProvider.java
===================================================================
--- src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 74)
+++ src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 75)
@@ -25,5 +25,12 @@
 	 * @author imi
 	 */
-	public enum OverlayPosition {NORTHWEST, NORTHEAST, SOUTHWEST, SOUTHEAST}
+	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();
+	}
+	
 	
 	/**
@@ -78,9 +85,16 @@
 		ground.paintIcon(null, g, 0, 0);
 		int x = 0, y = 0;
-		switch (pos) {
-		case NORTHWEST: x = 0;		y = 0;		break;
-		case NORTHEAST: x = w-wo;	y = 0;		break;
-		case SOUTHWEST: x = 0;		y = h-ho;	break;
-		case SOUTHEAST: x = w-wo;	y = h-ho;	break;
+		if (pos == OverlayPosition.NORTHWEST) {
+			x = 0;
+			y = 0;
+		} else if (pos == OverlayPosition.NORTHEAST) {
+			x = w-wo;
+			y = 0;
+		} else if (pos == OverlayPosition.SOUTHWEST) {
+			x = 0;
+			y = h-ho;
+		} else if (pos == OverlayPosition.SOUTHEAST) {
+			x = w-wo;
+			y = h-ho;
 		}
 		overlay.paintIcon(null, g, x, y);
