Index: trunk/src/org/openstreetmap/josm/data/projection/Lambert.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/projection/Lambert.java	(revision 809)
+++ trunk/src/org/openstreetmap/josm/data/projection/Lambert.java	(revision 810)
@@ -1,5 +1,5 @@
 //License: GPL. For details, see LICENSE file.
 //Thanks to Johan Montagnat and its geoconv java converter application
-//(http://www.i3s.unice.fr/~johan/gps/ , published under GPL license) 
+//(http://www.i3s.unice.fr/~johan/gps/ , published under GPL license)
 //from which some code and constants have been reused here.
 package org.openstreetmap.josm.data.projection;
@@ -14,268 +14,271 @@
 
 public class Lambert implements Projection {
-    /**
-     * Lambert I, II, III, and IV projection exponents
-     */
-    public static final double n[] = { 0.7604059656, 0.7289686274, 0.6959127966, 0.6712679322 };
-
-    /**
-     * Lambert I, II, III, and IV projection constants
-     */
-    public static final double c[] = { 11603796.98, 11745793.39, 11947992.52, 12136281.99 };
-
-    /**
-     * Lambert I, II, III, and IV false east
-     */
-    public static final double Xs[] = { 600000.0, 600000.0, 600000.0, 234.358 };
-
-    /**
-     * Lambert I, II, III, and IV false north
-     */
-    public static final double Ys[] = { 5657616.674, 6199695.768, 6791905.085, 7239161.542 };
-
-    /**
-     * Lambert I, II, III, and IV longitudinal offset to Greenwich meridian
-     */
-    public static final double lg0 = 0.04079234433198; // 2deg20'14.025"
-
-    /**
-     * precision in iterative schema
-     */
-
-    public static final double epsilon = 1e-11;
-
-    /**
-     * France is divided in 4 Lambert projection zones (1,2,3 + 4th for Corsica) 
-     */
-    public static final double cMaxLatZone1 = Math.toRadians(57 * 0.9);
-
-    public static final double zoneLimits[] = { Math.toRadians(53.5 * 0.9), // between Zone 1 and Zone 2 (in grad *0.9)
-            Math.toRadians(50.5 * 0.9), // between Zone 2 and Zone 3
-            Math.toRadians(47.51963 * 0.9), // between Zone 3 and Zone 4
-            Math.toRadians(46.17821 * 0.9) };// lowest latitude of Zone 4
-
-    public static final double cMinLonZones = Math.toRadians(-4.9074074074074059 * 0.9);
-
-    public static final double cMaxLonZones = Math.toRadians(10.2 * 0.9);
-
-    /**
-     *  Because josm cannot work correctly if two zones are displayed, we allow some overlapping
-     */
-    public static final double cMaxOverlappingZones = Math.toRadians(1.5 * 0.9);
-
-    public static int layoutZone = -1;
-
-    /**
-     * @param p  WGS84 lat/lon (ellipsoid GRS80) (in degree)
-     * @return eastnorth projection in Lambert Zone (ellipsoid Clark)
-     */
-    public EastNorth latlon2eastNorth(LatLon p) {
-        // translate ellipsoid GRS80 (WGS83) => Clark
-        LatLon geo = GRS802Clark(p);
-        double lt = geo.lat(); // in radian
-        double lg = geo.lon();
-
-        // check if longitude and latitude are inside the french Lambert zones
-        int currentZone = 0;
-        boolean outOfLambertZones = false;
-        if (lt >= zoneLimits[3] && lt <= cMaxLatZone1 && lg >= cMinLonZones && lg <= cMaxLonZones) {
-            // zone I
-            if (lt > zoneLimits[0])
-                currentZone = 0;
-            // zone II
-            else if (lt > zoneLimits[1])
-                currentZone = 1;
-            // zone III
-            else if (lt > zoneLimits[2])
-                currentZone = 2;
-            // zone III or IV
-            else if (lt > zoneLimits[3])
-                // Note: zone IV is dedicated to Corsica island and extends from 47.8 to 
-                // 45.9 degrees of latitude. There is an overlap with zone III that can be 
-                // solved only with longitude (covers Corsica if lon > 7.2 degree)
-                if (lg < Math.toRadians(8 * 0.9))
-                    currentZone = 2;
-                else
-                    currentZone = 3;
-        } else {
-            outOfLambertZones = true; // possible when MAX_LAT is used
-        }
-        if (layoutZone == -1)
-            layoutZone = currentZone;
-        else if (layoutZone != currentZone && !outOfLambertZones) {
-            if ((currentZone < layoutZone && Math.abs(zoneLimits[currentZone] - lt) > cMaxOverlappingZones)
-                    || (currentZone > layoutZone && Math.abs(zoneLimits[layoutZone] - lt) > cMaxOverlappingZones)) {
-                JOptionPane.showMessageDialog(Main.parent,
-                        tr("IMPORTANT : data positionned far away from\n"
-                                +"the current Lambert zone limits.\n"
-                                +"Undo your last action, Save your work \n"
-                                +"and Start a new layer on the new zone."));
-                layoutZone = -1;
-            } else {
-                System.out.println("temporarily extends Lambert zone " + layoutZone 
-                        + " projection at lat,lon:" + lt + "," + lg);
-            }
-        }
-        if (layoutZone == -1) {
-            return ConicProjection(lt, lg, Xs[currentZone], Ys[currentZone], c[currentZone], n[currentZone]);
-        } // else
-        return ConicProjection(lt, lg, Xs[layoutZone], Ys[layoutZone], c[layoutZone], n[layoutZone]);
-    }
-
-    public LatLon eastNorth2latlon(EastNorth p) {
-        LatLon geo = Geographic(p, Xs[layoutZone], Ys[layoutZone], c[layoutZone], n[layoutZone]);
-        // translate ellipsoid Clark => GRS80 (WGS83)
-        LatLon wgs = Clark2GRS80(geo);
-        return new LatLon(Math.toDegrees(wgs.lat()), Math.toDegrees(wgs.lon()));
-    }
-
-    @Override
-    public String toString() {
-        return "Lambert";
-    }
-
-    public String getCacheDirectoryName() {
-        return "lambert";
-    }
-
-    public double scaleFactor() {
-        return 1.0 / 360;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        return o instanceof Lambert;
-    }
-
-    @Override
-    public int hashCode() {
-        return Lambert.class.hashCode();
-    }
-
-    /**
-     * Initializes from geographic coordinates. Note that reference ellipsoid
-     * used by Lambert is the Clark ellipsoid.
-     * 
-     * @param lat latitude in grad
-     * @param lon longitude in grad
-     * @param Xs  false east (coordinate system origin) in meters
-     * @param Ys  false north (coordinate system origin) in meters
-     * @param c   projection constant
-     * @param n   projection exponent
-     * @return EastNorth projected coordinates in meter
-     */
-    private EastNorth ConicProjection(double lat, double lon, double Xs, double Ys, double c, double n) {
-        double eslt = Ellipsoid.clarke.e * Math.sin(lat);
-        double l = Math.log(Math.tan(Math.PI / 4.0 + (lat / 2.0))
-                * Math.pow((1.0 - eslt) / (1.0 + eslt), Ellipsoid.clarke.e / 2.0));
-        double east = Xs + c * Math.exp(-n * l) * Math.sin(n * (lon - lg0));
-        double north = Ys - c * Math.exp(-n * l) * Math.cos(n * (lon - lg0));
-        return new EastNorth(east, north);
-    }
-
-    /**
-     * Initializes from projected coordinates (conic projection). Note that
-     * reference ellipsoid used by Lambert is Clark
-     * 
-     * @param coord projected coordinates pair in meters
-     * @param Xs    false east (coordinate system origin) in meters
-     * @param Ys    false north (coordinate system origin) in meters
-     * @param c     projection constant
-     * @param n     projection exponent
-     * @return LatLon in radian
-     */
-    private LatLon Geographic(EastNorth eastNorth, double Xs, double Ys, double c, double n) {
-        double dx = eastNorth.east() - Xs;
-        double dy = Ys - eastNorth.north();
-        double R = Math.sqrt(dx * dx + dy * dy);
-        double gamma = Math.atan(dx / dy);
-        double l = -1.0 / n * Math.log(Math.abs(R / c));
-        l = Math.exp(l);
-        double lon = lg0 + gamma / n;
-        double lat = 2.0 * Math.atan(l) - Math.PI / 2.0;
-        double delta = 1.0;
-        while (delta > epsilon) {
-            double eslt = Ellipsoid.clarke.e * Math.sin(lat);
-            double nlt = 2.0 * Math.atan(Math.pow((1.0 + eslt) / (1.0 - eslt), Ellipsoid.clarke.e / 2.0) * l) - Math.PI
-                    / 2.0;
-            delta = Math.abs(nlt - lat);
-            lat = nlt;
-        }
-        return new LatLon(lat, lon); // in radian
-    }
-
-    /**
-     * Translate latitude/longitude in WGS84, (ellipsoid GRS80) to Lambert
-     * geographic, (ellipsoid Clark)
-     * 
-     * @param wgs
-     * @return
-     */
-    private LatLon GRS802Clark(LatLon wgs) {
-        double lat = Math.toRadians(wgs.lat()); // degree to radian
-        double lon = Math.toRadians(wgs.lon());
-        // WGS84 geographic => WGS84 cartesian
-        double N = Ellipsoid.GRS80.a / (Math.sqrt(1.0 - Ellipsoid.GRS80.e2 * Math.sin(lat) * Math.sin(lat)));
-        double X = (N/* +height */) * Math.cos(lat) * Math.cos(lon);
-        double Y = (N/* +height */) * Math.cos(lat) * Math.sin(lon);
-        double Z = (N * (1.0 - Ellipsoid.GRS80.e2)/* + height */) * Math.sin(lat);
-        // WGS84 => Lambert ellipsoide similarity
-        X += 168.0;
-        Y += 60.0;
-        Z += -320.0;
-        // Lambert cartesian => Lambert geographic
-        return Geographic(X, Y, Z, Ellipsoid.clarke);
-    }
-
-    /**
-     * @param lambert
-     * @return
-     */
-    private LatLon Clark2GRS80(LatLon lambert) {
-        double lat = lambert.lat(); // in radian
-        double lon = lambert.lon();
-        // Lambert geographic => Lambert cartesian
-        double N = Ellipsoid.clarke.a / (Math.sqrt(1.0 - Ellipsoid.clarke.e2 * Math.sin(lat) * Math.sin(lat)));
-        double X = (N/* +height */) * Math.cos(lat) * Math.cos(lon);
-        double Y = (N/* +height */) * Math.cos(lat) * Math.sin(lon);
-        double Z = (N * (1.0 - Ellipsoid.clarke.e2)/* + height */) * Math.sin(lat);
-        // Lambert => WGS84 ellipsoide similarity
-        X += -168.0;
-        Y += -60.0;
-        Z += 320.0;
-        // WGS84 cartesian => WGS84 geographic
-        return Geographic(X, Y, Z, Ellipsoid.GRS80);
-    }
-
-    /**
-     * initializes from cartesian coordinates
-     * 
-     * @param X
-     *            1st coordinate in meters
-     * @param Y
-     *            2nd coordinate in meters
-     * @param Z
-     *            3rd coordinate in meters
-     * @param ell
-     *            reference ellipsoid
-     */
-    private LatLon Geographic(double X, double Y, double Z, Ellipsoid ell) {
-        double norm = Math.sqrt(X * X + Y * Y);
-        double lg = 2.0 * Math.atan(Y / (X + norm));
-        double lt = Math.atan(Z / (norm * (1.0 - (ell.a * ell.e2 / Math.sqrt(X * X + Y * Y + Z * Z)))));
-        double delta = 1.0;
-        while (delta > epsilon) {
-            double s2 = Math.sin(lt);
-            s2 *= s2;
-            double l = Math.atan((Z / norm)
-                    / (1.0 - (ell.a * ell.e2 * Math.cos(lt) / (norm * Math.sqrt(1.0 - ell.e2 * s2)))));
-            delta = Math.abs(l - lt);
-            lt = l;
-        }
-        double s2 = Math.sin(lt);
-        s2 *= s2;
-        // h = norm / Math.cos(lt) - ell.a / Math.sqrt(1.0 - ell.e2 * s2);
-        return new LatLon(lt, lg);
-    }
+	/**
+	 * Lambert I, II, III, and IV projection exponents
+	 */
+	public static final double n[] = { 0.7604059656, 0.7289686274, 0.6959127966, 0.6712679322 };
+
+	/**
+	 * Lambert I, II, III, and IV projection constants
+	 */
+	public static final double c[] = { 11603796.98, 11745793.39, 11947992.52, 12136281.99 };
+
+	/**
+	 * Lambert I, II, III, and IV false east
+	 */
+	public static final double Xs[] = { 600000.0, 600000.0, 600000.0, 234.358 };
+
+	/**
+	 * Lambert I, II, III, and IV false north
+	 */
+	public static final double Ys[] = { 5657616.674, 6199695.768, 6791905.085, 7239161.542 };
+
+	/**
+	 * Lambert I, II, III, and IV longitudinal offset to Greenwich meridian
+	 */
+	public static final double lg0 = 0.04079234433198; // 2deg20'14.025"
+
+	/**
+	 * precision in iterative schema
+	 */
+
+	public static final double epsilon = 1e-11;
+
+	/**
+	 * France is divided in 4 Lambert projection zones (1,2,3 + 4th for Corsica)
+	 */
+	public static final double cMaxLatZone1 = Math.toRadians(57 * 0.9);
+
+	public static final double zoneLimits[] = { Math.toRadians(53.5 * 0.9), // between Zone 1 and Zone 2 (in grad *0.9)
+			Math.toRadians(50.5 * 0.9), // between Zone 2 and Zone 3
+			Math.toRadians(47.51963 * 0.9), // between Zone 3 and Zone 4
+			Math.toRadians(46.17821 * 0.9) };// lowest latitude of Zone 4
+
+	public static final double cMinLonZones = Math.toRadians(-4.9074074074074059 * 0.9);
+
+	public static final double cMaxLonZones = Math.toRadians(10.2 * 0.9);
+
+	/**
+	 *  Because josm cannot work correctly if two zones are displayed, we allow some overlapping
+	 */
+	public static final double cMaxOverlappingZones = Math.toRadians(1.5 * 0.9);
+
+	public static int layoutZone = -1;
+
+	/**
+	 * @param p  WGS84 lat/lon (ellipsoid GRS80) (in degree)
+	 * @return eastnorth projection in Lambert Zone (ellipsoid Clark)
+	 */
+	public EastNorth latlon2eastNorth(LatLon p) {
+		// translate ellipsoid GRS80 (WGS83) => Clark
+		LatLon geo = GRS802Clark(p);
+		double lt = geo.lat(); // in radian
+		double lg = geo.lon();
+
+		// check if longitude and latitude are inside the french Lambert zones
+		int currentZone = 0;
+		boolean outOfLambertZones = false;
+		if (lt >= zoneLimits[3] && lt <= cMaxLatZone1 && lg >= cMinLonZones && lg <= cMaxLonZones) {
+			// zone I
+			if (lt > zoneLimits[0])
+				currentZone = 0;
+			// zone II
+			else if (lt > zoneLimits[1])
+				currentZone = 1;
+			// zone III
+			else if (lt > zoneLimits[2])
+				currentZone = 2;
+			// zone III or IV
+			else if (lt > zoneLimits[3])
+				// Note: zone IV is dedicated to Corsica island and extends from 47.8 to
+				// 45.9 degrees of latitude. There is an overlap with zone III that can be
+				// solved only with longitude (covers Corsica if lon > 7.2 degree)
+				if (lg < Math.toRadians(8 * 0.9))
+					currentZone = 2;
+				else
+					currentZone = 3;
+		} else {
+			outOfLambertZones = true; // possible when MAX_LAT is used
+		}
+		if (!outOfLambertZones) {
+			if (layoutZone == -1)
+				layoutZone = currentZone;
+			else if (layoutZone != currentZone) {
+				if ((currentZone < layoutZone && Math.abs(zoneLimits[currentZone] - lt) > cMaxOverlappingZones)
+						|| (currentZone > layoutZone && Math.abs(zoneLimits[layoutZone] - lt) > cMaxOverlappingZones)) {
+					JOptionPane.showMessageDialog(Main.parent,
+									tr("IMPORTANT : data positionned far away from\n"
+											+ "the current Lambert zone limits.\n"
+											+ "Undo your last action, Save your work \n"
+											+ "and Start a new layer on the new zone."));
+					layoutZone = -1;
+				} else {
+					System.out.println("temporarily extends Lambert zone "
+							+ layoutZone + " projection at lat,lon:" + lt + ","
+							+ lg);
+				}
+			}
+		}
+		if (layoutZone == -1) {
+			return ConicProjection(lt, lg, Xs[currentZone], Ys[currentZone], c[currentZone], n[currentZone]);
+		} // else
+		return ConicProjection(lt, lg, Xs[layoutZone], Ys[layoutZone], c[layoutZone], n[layoutZone]);
+	}
+
+	public LatLon eastNorth2latlon(EastNorth p) {
+		LatLon geo = Geographic(p, Xs[layoutZone], Ys[layoutZone], c[layoutZone], n[layoutZone]);
+		// translate ellipsoid Clark => GRS80 (WGS83)
+		LatLon wgs = Clark2GRS80(geo);
+		return new LatLon(Math.toDegrees(wgs.lat()), Math.toDegrees(wgs.lon()));
+	}
+
+	@Override
+	public String toString() {
+		return "Lambert";
+	}
+
+	public String getCacheDirectoryName() {
+		return "lambert";
+	}
+
+	public double scaleFactor() {
+		return 1.0 / 360;
+	}
+
+	@Override
+	public boolean equals(Object o) {
+		return o instanceof Lambert;
+	}
+
+	@Override
+	public int hashCode() {
+		return Lambert.class.hashCode();
+	}
+
+	/**
+	 * Initializes from geographic coordinates. Note that reference ellipsoid
+	 * used by Lambert is the Clark ellipsoid.
+	 *
+	 * @param lat latitude in grad
+	 * @param lon longitude in grad
+	 * @param Xs  false east (coordinate system origin) in meters
+	 * @param Ys  false north (coordinate system origin) in meters
+	 * @param c   projection constant
+	 * @param n   projection exponent
+	 * @return EastNorth projected coordinates in meter
+	 */
+	private EastNorth ConicProjection(double lat, double lon, double Xs, double Ys, double c, double n) {
+		double eslt = Ellipsoid.clarke.e * Math.sin(lat);
+		double l = Math.log(Math.tan(Math.PI / 4.0 + (lat / 2.0))
+				* Math.pow((1.0 - eslt) / (1.0 + eslt), Ellipsoid.clarke.e / 2.0));
+		double east = Xs + c * Math.exp(-n * l) * Math.sin(n * (lon - lg0));
+		double north = Ys - c * Math.exp(-n * l) * Math.cos(n * (lon - lg0));
+		return new EastNorth(east, north);
+	}
+
+	/**
+	 * Initializes from projected coordinates (conic projection). Note that
+	 * reference ellipsoid used by Lambert is Clark
+	 *
+	 * @param coord projected coordinates pair in meters
+	 * @param Xs    false east (coordinate system origin) in meters
+	 * @param Ys    false north (coordinate system origin) in meters
+	 * @param c     projection constant
+	 * @param n     projection exponent
+	 * @return LatLon in radian
+	 */
+	private LatLon Geographic(EastNorth eastNorth, double Xs, double Ys, double c, double n) {
+		double dx = eastNorth.east() - Xs;
+		double dy = Ys - eastNorth.north();
+		double R = Math.sqrt(dx * dx + dy * dy);
+		double gamma = Math.atan(dx / dy);
+		double l = -1.0 / n * Math.log(Math.abs(R / c));
+		l = Math.exp(l);
+		double lon = lg0 + gamma / n;
+		double lat = 2.0 * Math.atan(l) - Math.PI / 2.0;
+		double delta = 1.0;
+		while (delta > epsilon) {
+			double eslt = Ellipsoid.clarke.e * Math.sin(lat);
+			double nlt = 2.0 * Math.atan(Math.pow((1.0 + eslt) / (1.0 - eslt), Ellipsoid.clarke.e / 2.0) * l) - Math.PI
+					/ 2.0;
+			delta = Math.abs(nlt - lat);
+			lat = nlt;
+		}
+		return new LatLon(lat, lon); // in radian
+	}
+
+	/**
+	 * Translate latitude/longitude in WGS84, (ellipsoid GRS80) to Lambert
+	 * geographic, (ellipsoid Clark)
+	 *
+	 * @param wgs
+	 * @return
+	 */
+	private LatLon GRS802Clark(LatLon wgs) {
+		double lat = Math.toRadians(wgs.lat()); // degree to radian
+		double lon = Math.toRadians(wgs.lon());
+		// WGS84 geographic => WGS84 cartesian
+		double N = Ellipsoid.GRS80.a / (Math.sqrt(1.0 - Ellipsoid.GRS80.e2 * Math.sin(lat) * Math.sin(lat)));
+		double X = (N/* +height */) * Math.cos(lat) * Math.cos(lon);
+		double Y = (N/* +height */) * Math.cos(lat) * Math.sin(lon);
+		double Z = (N * (1.0 - Ellipsoid.GRS80.e2)/* + height */) * Math.sin(lat);
+		// WGS84 => Lambert ellipsoide similarity
+		X += 168.0;
+		Y += 60.0;
+		Z += -320.0;
+		// Lambert cartesian => Lambert geographic
+		return Geographic(X, Y, Z, Ellipsoid.clarke);
+	}
+
+	/**
+	 * @param lambert
+	 * @return
+	 */
+	private LatLon Clark2GRS80(LatLon lambert) {
+		double lat = lambert.lat(); // in radian
+		double lon = lambert.lon();
+		// Lambert geographic => Lambert cartesian
+		double N = Ellipsoid.clarke.a / (Math.sqrt(1.0 - Ellipsoid.clarke.e2 * Math.sin(lat) * Math.sin(lat)));
+		double X = (N/* +height */) * Math.cos(lat) * Math.cos(lon);
+		double Y = (N/* +height */) * Math.cos(lat) * Math.sin(lon);
+		double Z = (N * (1.0 - Ellipsoid.clarke.e2)/* + height */) * Math.sin(lat);
+		// Lambert => WGS84 ellipsoide similarity
+		X += -168.0;
+		Y += -60.0;
+		Z += 320.0;
+		// WGS84 cartesian => WGS84 geographic
+		return Geographic(X, Y, Z, Ellipsoid.GRS80);
+	}
+
+	/**
+	 * initializes from cartesian coordinates
+	 *
+	 * @param X
+	 *            1st coordinate in meters
+	 * @param Y
+	 *            2nd coordinate in meters
+	 * @param Z
+	 *            3rd coordinate in meters
+	 * @param ell
+	 *            reference ellipsoid
+	 */
+	private LatLon Geographic(double X, double Y, double Z, Ellipsoid ell) {
+		double norm = Math.sqrt(X * X + Y * Y);
+		double lg = 2.0 * Math.atan(Y / (X + norm));
+		double lt = Math.atan(Z / (norm * (1.0 - (ell.a * ell.e2 / Math.sqrt(X * X + Y * Y + Z * Z)))));
+		double delta = 1.0;
+		while (delta > epsilon) {
+			double s2 = Math.sin(lt);
+			s2 *= s2;
+			double l = Math.atan((Z / norm)
+					/ (1.0 - (ell.a * ell.e2 * Math.cos(lt) / (norm * Math.sqrt(1.0 - ell.e2 * s2)))));
+			delta = Math.abs(l - lt);
+			lt = l;
+		}
+		double s2 = Math.sin(lt);
+		s2 *= s2;
+		// h = norm / Math.cos(lt) - ell.a / Math.sqrt(1.0 - ell.e2 * s2);
+		return new LatLon(lt, lg);
+	}
 
 }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java	(revision 809)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java	(revision 810)
@@ -3,7 +3,7 @@
 package org.openstreetmap.josm.gui.dialogs;
 
+import static org.openstreetmap.josm.tools.I18n.marktr;
 import static org.openstreetmap.josm.tools.I18n.tr;
 import static org.openstreetmap.josm.tools.I18n.trn;
-import static org.openstreetmap.josm.tools.I18n.marktr;
 
 import java.awt.BorderLayout;
@@ -22,4 +22,5 @@
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Map;
 import java.util.TreeMap;
@@ -45,6 +46,6 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.command.ChangeCommand;
 import org.openstreetmap.josm.command.ChangePropertyCommand;
-import org.openstreetmap.josm.command.ChangeCommand;
 import org.openstreetmap.josm.command.Command;
 import org.openstreetmap.josm.command.SequenceCommand;
@@ -56,9 +57,9 @@
 import org.openstreetmap.josm.data.osm.visitor.NameVisitor;
 import org.openstreetmap.josm.gui.MapFrame;
+import org.openstreetmap.josm.gui.SideButton;
 import org.openstreetmap.josm.gui.preferences.TaggingPresetPreference;
 import org.openstreetmap.josm.gui.tagging.ForwardActionListener;
 import org.openstreetmap.josm.gui.tagging.TaggingCellRenderer;
 import org.openstreetmap.josm.gui.tagging.TaggingPreset;
-import org.openstreetmap.josm.gui.SideButton;
 import org.openstreetmap.josm.tools.AutoCompleteComboBox;
 import org.openstreetmap.josm.tools.GBC;
@@ -272,5 +273,6 @@
 	 */
 	void membershipEdit(int row) {	
-		final RelationEditor editor = new RelationEditor((Relation)membershipData.getValueAt(row, 0));
+		final RelationEditor editor = new RelationEditor((Relation)membershipData.getValueAt(row, 0), 
+				(Collection<RelationMember>) membershipData.getValueAt(row, 1) );
 		editor.setVisible(true);
 	}
@@ -486,4 +488,27 @@
 					nameVisitor.visit((Relation)value);
 					((JLabel)c).setText(nameVisitor.name);
+				}
+				return c;
+			}
+		});
+		
+		membershipTable.getColumnModel().getColumn(1).setCellRenderer(new DefaultTableCellRenderer() {
+			@Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
+				Component c = super.getTableCellRendererComponent(table, value, isSelected, false, row, column);
+				if (c instanceof JLabel) {
+					Collection<RelationMember> col = (Collection<RelationMember>) value;
+					
+					String text = null;
+					for (RelationMember r : col) {
+						if (text == null) {
+							text = r.role;
+						}
+						else if (!text.equals(r.role)) {
+							text = tr("<different>");
+							break;
+						}
+					}
+					
+					((JLabel)c).setText(text);
 				}
 				return c;
@@ -621,17 +646,15 @@
 		membershipData.setRowCount(0);
 		
-		Map<Relation, Integer> valueCountM = new HashMap<Relation, Integer>();
-		TreeMap<Relation, Collection<String>> roles = new TreeMap<Relation, Collection<String>>();
+		TreeMap<Relation, Collection<RelationMember>> roles = new TreeMap<Relation, Collection<RelationMember>>();
 		for (Relation r : Main.ds.relations) {
 			if (!r.deleted && !r.incomplete) {
 				for (RelationMember m : r.members) {
 					if (newSelection.contains(m.member)) {
-						Collection<String> value = roles.get(r);
+						Collection<RelationMember> value = roles.get(r);
 						if (value == null) {
-							value = new TreeSet<String>();
+							value = new HashSet<RelationMember>();
 							roles.put(r, value);
 						}
-						value.add(m.role);
-						valueCountM.put(r, keyCount.containsKey(r) ? keyCount.get(r)+1 : 1);
+						value.add(m);
 					}
 				}
@@ -639,11 +662,8 @@
 		}
 		
-		for (Entry<Relation, Collection<String>> e : roles.entrySet()) {
-			//JComboBox value = new JComboBox(e.getValue().toArray());
-			//value.setEditable(true);
-			//value.getEditor().setItem(e.getValue().size() > 1 || valueCount.get(e.getKey()) != newSelection.size() ? tr("<different>") : e.getValue().iterator().next());
-			String value = e.getValue().size() > 1 || valueCountM.get(e.getKey()) != newSelection.size() ? tr("<different>") : e.getValue().iterator().next();
-			membershipData.addRow(new Object[]{e.getKey(), value});
-		}
+		for (Entry<Relation, Collection<RelationMember>> e : roles.entrySet()) {
+			membershipData.addRow(new Object[]{e.getKey(), e.getValue()});
+		}
+		
 		membershipTable.getTableHeader().setVisible(membershipData.getRowCount() > 0);
 	}
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/RelationEditor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/RelationEditor.java	(revision 809)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/RelationEditor.java	(revision 810)
@@ -16,4 +16,5 @@
 import java.text.Collator;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
@@ -166,10 +167,23 @@
 	 * Creates a new relation editor for the given relation. The relation
 	 * will be saved if the user selects "ok" in the editor.
-	 *
+	 * 
 	 * If no relation is given, will create an editor for a new relation.
-	 *
+	 * 
 	 * @param relation relation to edit, or null to create a new one.
 	 */
 	public RelationEditor(Relation relation)
+	{
+		this(relation, null);
+	}
+
+	/**
+	 * Creates a new relation editor for the given relation. The relation
+	 * will be saved if the user selects "ok" in the editor.
+	 * 
+	 * If no relation is given, will create an editor for a new relation.
+	 * 
+	 * @param relation relation to edit, or null to create a new one.
+	 */
+	public RelationEditor(Relation relation, Collection<RelationMember> selectedMembers )
 	{
 		super(relation == null ? tr("Create new relation") :
@@ -326,4 +340,23 @@
 		refreshTables();
 
+		if (selectedMembers != null) {
+			boolean scrolled = false;
+			for (int i = 0; i < memberData.getRowCount(); i++) {		
+				for (RelationMember m : selectedMembers) {
+					if (m.member == memberData.getValueAt(i, 1)
+					        && m.role.equals(memberData.getValueAt(i, 0))) {
+						memberTable.addRowSelectionInterval(i, i);
+						if (!scrolled) {
+							// Ensure that the first member is visible
+							memberTable.scrollRectToVisible(memberTable.getCellRect(i, 0, true));
+							scrolled = true;
+						}
+						break;
+					}
+				}
+				
+			}	
+		}
+
 		setSize(new Dimension(600, 500));
 		setLocationRelativeTo(Main.parent);
