Index: trunk/src/org/openstreetmap/josm/data/projection/LambertEST.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/projection/LambertEST.java	(revision 2788)
+++ trunk/src/org/openstreetmap/josm/data/projection/LambertEST.java	(revision 2789)
@@ -58,5 +58,5 @@
     }
 
-    public  static double IterateAngle(double e, double t)
+    public static double iterateAngle(double e, double t)
     {
         double a1 = 0.0;
@@ -88,5 +88,5 @@
         double theta = Math.atan((p.getX() - ef) / (rf - p.getY() + nf));
         double y = (theta / n + lonf) ;
-        double x = (IterateAngle(ee, T)) ;
+        double x = iterateAngle(ee, T);
         return new LatLon(Math.toDegrees(x),Math.toDegrees(y));
     }
Index: trunk/src/org/openstreetmap/josm/data/projection/Puwg.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/projection/Puwg.java	(revision 2788)
+++ trunk/src/org/openstreetmap/josm/data/projection/Puwg.java	(revision 2789)
@@ -46,5 +46,5 @@
         double scale = z.getPuwgScaleFactor();
         double center = z.getPuwgCentralMeridian(); /* in radians */
-        EastNorth a = MapLatLonToXY(Math.toRadians(p.lat()), Math.toRadians(p.lon()), center);
+        EastNorth a = mapLatLonToXY(Math.toRadians(p.lat()), Math.toRadians(p.lon()), center);
         return new EastNorth(a.east() * scale + easting, a.north() * scale + northing);
     }
@@ -57,5 +57,5 @@
         double scale = z.getPuwgScaleFactor();
         double center = z.getPuwgCentralMeridian(); /* in radians */
-        return MapXYToLatLon((p.east() - easting)/scale, (p.north() - northing)/scale, center);
+        return mapXYToLatLon((p.east() - easting)/scale, (p.north() - northing)/scale, center);
     }
 
Index: trunk/src/org/openstreetmap/josm/data/projection/UTM.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/projection/UTM.java	(revision 2788)
+++ trunk/src/org/openstreetmap/josm/data/projection/UTM.java	(revision 2789)
@@ -12,5 +12,4 @@
 import javax.swing.JPanel;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -29,29 +28,29 @@
     private int zone = DEFAULT_ZONE;
 
-    final private double UTMScaleFactor = 0.9996;
+    final private static double UTMScaleFactor = 0.9996;
 
     /* Ellipsoid model constants (WGS84) - TODO Use Elliposid class here too */
-    final private double sm_EccSquared = 6.69437999013e-03;
+    //final private double sm_EccSquared = 6.69437999013e-03;
 
     /*
-    * ArcLengthOfMeridian
-    *
-    * Computes the ellipsoidal distance from the equator to a point at a
-    * given latitude.
-    *
-    * Reference: Hoffmann-Wellenhof, B., Lichtenegger, H., and Collins, J.,
-    * GPS: Theory and Practice, 3rd ed.  New York: Springer-Verlag Wien, 1994.
-    *
-    * Inputs:
-    *     phi - Latitude of the point, in radians.
-    *
-    * Globals:
-    *     Ellipsoid.GRS80.a - Ellipsoid model major axis.
-    *     Ellipsoid.GRS80.b - Ellipsoid model minor axis.
-    *
-    * Returns:
-    *     The ellipsoidal distance of the point from the equator, in meters.
-    *
-    */
+     * ArcLengthOfMeridian
+     *
+     * Computes the ellipsoidal distance from the equator to a point at a
+     * given latitude.
+     *
+     * Reference: Hoffmann-Wellenhof, B., Lichtenegger, H., and Collins, J.,
+     * GPS: Theory and Practice, 3rd ed.  New York: Springer-Verlag Wien, 1994.
+     *
+     * Inputs:
+     *     phi - Latitude of the point, in radians.
+     *
+     * Globals:
+     *     Ellipsoid.GRS80.a - Ellipsoid model major axis.
+     *     Ellipsoid.GRS80.b - Ellipsoid model minor axis.
+     *
+     * Returns:
+     *     The ellipsoidal distance of the point from the equator, in meters.
+     *
+     */
     private double ArcLengthOfMeridian(double phi)
     {
@@ -61,17 +60,17 @@
         /* Precalculate alpha */
         double alpha = ((Ellipsoid.GRS80.a + Ellipsoid.GRS80.b) / 2.0)
-           * (1.0 + (Math.pow (n, 2.0) / 4.0) + (Math.pow (n, 4.0) / 64.0));
+        * (1.0 + (Math.pow (n, 2.0) / 4.0) + (Math.pow (n, 4.0) / 64.0));
 
         /* Precalculate beta */
         double beta = (-3.0 * n / 2.0) + (9.0 * Math.pow (n, 3.0) / 16.0)
-           + (-3.0 * Math.pow (n, 5.0) / 32.0);
+        + (-3.0 * Math.pow (n, 5.0) / 32.0);
 
         /* Precalculate gamma */
         double gamma = (15.0 * Math.pow (n, 2.0) / 16.0)
-            + (-15.0 * Math.pow (n, 4.0) / 32.0);
+        + (-15.0 * Math.pow (n, 4.0) / 32.0);
 
         /* Precalculate delta */
         double delta = (-35.0 * Math.pow (n, 3.0) / 48.0)
-            + (105.0 * Math.pow (n, 5.0) / 256.0);
+        + (105.0 * Math.pow (n, 5.0) / 256.0);
 
         /* Precalculate epsilon */
@@ -81,23 +80,23 @@
         return alpha
         * (phi + (beta * Math.sin (2.0 * phi))
-            + (gamma * Math.sin (4.0 * phi))
-            + (delta * Math.sin (6.0 * phi))
-            + (epsilon * Math.sin (8.0 * phi)));
+                + (gamma * Math.sin (4.0 * phi))
+                + (delta * Math.sin (6.0 * phi))
+                + (epsilon * Math.sin (8.0 * phi)));
     }
 
     /*
-    * UTMCentralMeridian
-    *
-    * Determines the central meridian for the given UTM zone.
-    *
-    * Inputs:
-    *     zone - An integer value designating the UTM zone, range [1,60].
-    *
-    * Returns:
-    *   The central meridian for the given UTM zone, in radians, or zero
-    *   if the UTM zone parameter is outside the range [1,60].
-    *   Range of the central meridian is the radian equivalent of [-177,+177].
-    *
-    */
+     * UTMCentralMeridian
+     *
+     * Determines the central meridian for the given UTM zone.
+     *
+     * Inputs:
+     *     zone - An integer value designating the UTM zone, range [1,60].
+     *
+     * Returns:
+     *   The central meridian for the given UTM zone, in radians, or zero
+     *   if the UTM zone parameter is outside the range [1,60].
+     *   Range of the central meridian is the radian equivalent of [-177,+177].
+     *
+     */
     private double UTMCentralMeridian(int zone)
     {
@@ -110,19 +109,19 @@
 
     /*
-    * FootpointLatitude
-    *
-    * Computes the footpoint latitude for use in converting transverse
-    * Mercator coordinates to ellipsoidal coordinates.
-    *
-    * Reference: Hoffmann-Wellenhof, B., Lichtenegger, H., and Collins, J.,
-    *   GPS: Theory and Practice, 3rd ed.  New York: Springer-Verlag Wien, 1994.
-    *
-    * Inputs:
-    *   y - The UTM northing coordinate, in meters.
-    *
-    * Returns:
-    *   The footpoint latitude, in radians.
-    *
-    */
+     * FootpointLatitude
+     *
+     * Computes the footpoint latitude for use in converting transverse
+     * Mercator coordinates to ellipsoidal coordinates.
+     *
+     * Reference: Hoffmann-Wellenhof, B., Lichtenegger, H., and Collins, J.,
+     *   GPS: Theory and Practice, 3rd ed.  New York: Springer-Verlag Wien, 1994.
+     *
+     * Inputs:
+     *   y - The UTM northing coordinate, in meters.
+     *
+     * Returns:
+     *   The footpoint latitude, in radians.
+     *
+     */
     private double FootpointLatitude(double y)
     {
@@ -133,5 +132,5 @@
         /* (Same as alpha in Eq. 10.17) */
         double alpha_ = ((Ellipsoid.GRS80.a + Ellipsoid.GRS80.b) / 2.0)
-            * (1 + (Math.pow (n, 2.0) / 4) + (Math.pow (n, 4.0) / 64));
+        * (1 + (Math.pow (n, 2.0) / 4) + (Math.pow (n, 4.0) / 64));
 
         /* Precalculate y_ (Eq. 10.23) */
@@ -140,13 +139,13 @@
         /* Precalculate beta_ (Eq. 10.22) */
         double beta_ = (3.0 * n / 2.0) + (-27.0 * Math.pow (n, 3.0) / 32.0)
-            + (269.0 * Math.pow (n, 5.0) / 512.0);
+        + (269.0 * Math.pow (n, 5.0) / 512.0);
 
         /* Precalculate gamma_ (Eq. 10.22) */
         double gamma_ = (21.0 * Math.pow (n, 2.0) / 16.0)
-            + (-55.0 * Math.pow (n, 4.0) / 32.0);
+        + (-55.0 * Math.pow (n, 4.0) / 32.0);
 
         /* Precalculate delta_ (Eq. 10.22) */
         double delta_ = (151.0 * Math.pow (n, 3.0) / 96.0)
-            + (-417.0 * Math.pow (n, 5.0) / 128.0);
+        + (-417.0 * Math.pow (n, 5.0) / 128.0);
 
         /* Precalculate epsilon_ (Eq. 10.22) */
@@ -155,33 +154,33 @@
         /* Now calculate the sum of the series (Eq. 10.21) */
         return y_ + (beta_ * Math.sin (2.0 * y_))
-            + (gamma_ * Math.sin (4.0 * y_))
-            + (delta_ * Math.sin (6.0 * y_))
-            + (epsilon_ * Math.sin (8.0 * y_));
+        + (gamma_ * Math.sin (4.0 * y_))
+        + (delta_ * Math.sin (6.0 * y_))
+        + (epsilon_ * Math.sin (8.0 * y_));
     }
 
     /*
-    * MapLatLonToXY
-    *
-    * Converts a latitude/longitude pair to x and y coordinates in the
-    * Transverse Mercator projection.  Note that Transverse Mercator is not
-    * the same as UTM; a scale factor is required to convert between them.
-    *
-    * Reference: Hoffmann-Wellenhof, B., Lichtenegger, H., and Collins, J.,
-    * GPS: Theory and Practice, 3rd ed.  New York: Springer-Verlag Wien, 1994.
-    *
-    * Inputs:
-    *    phi - Latitude of the point, in radians.
-    *    lambda - Longitude of the point, in radians.
-    *    lambda0 - Longitude of the central meridian to be used, in radians.
-    *
-    * Outputs:
-    *    xy - A 2-element array containing the x and y coordinates
-    *         of the computed point.
-    *
-    * Returns:
-    *    The function does not return a value.
-    *
-    */
-    public EastNorth MapLatLonToXY(double phi, double lambda, double lambda0)
+     * MapLatLonToXY
+     *
+     * Converts a latitude/longitude pair to x and y coordinates in the
+     * Transverse Mercator projection.  Note that Transverse Mercator is not
+     * the same as UTM; a scale factor is required to convert between them.
+     *
+     * Reference: Hoffmann-Wellenhof, B., Lichtenegger, H., and Collins, J.,
+     * GPS: Theory and Practice, 3rd ed.  New York: Springer-Verlag Wien, 1994.
+     *
+     * Inputs:
+     *    phi - Latitude of the point, in radians.
+     *    lambda - Longitude of the point, in radians.
+     *    lambda0 - Longitude of the central meridian to be used, in radians.
+     *
+     * Outputs:
+     *    xy - A 2-element array containing the x and y coordinates
+     *         of the computed point.
+     *
+     * Returns:
+     *    The function does not return a value.
+     *
+     */
+    public EastNorth mapLatLonToXY(double phi, double lambda, double lambda0)
     {
         /* Precalculate ep2 */
@@ -197,5 +196,4 @@
         double t = Math.tan (phi);
         double t2 = t * t;
-        double tmp = (t2 * t2 * t2) - Math.pow (t, 6.0);
 
         /* Precalculate l */
@@ -211,8 +209,8 @@
 
         double l5coef = 5.0 - 18.0 * t2 + (t2 * t2) + 14.0 * nu2
-            - 58.0 * t2 * nu2;
+        - 58.0 * t2 * nu2;
 
         double l6coef = 61.0 - 58.0 * t2 + (t2 * t2) + 270.0 * nu2
-            - 330.0 * t2 * nu2;
+        - 330.0 * t2 * nu2;
 
         double l7coef = 61.0 - 479.0 * t2 + 179.0 * (t2 * t2) - (t2 * t2 * t2);
@@ -221,49 +219,49 @@
 
         return new EastNorth(
-        /* Calculate easting (x) */
-        N * Math.cos (phi) * l
-            + (N / 6.0 * Math.pow (Math.cos (phi), 3.0) * l3coef * Math.pow (l, 3.0))
-            + (N / 120.0 * Math.pow (Math.cos (phi), 5.0) * l5coef * Math.pow (l, 5.0))
-            + (N / 5040.0 * Math.pow (Math.cos (phi), 7.0) * l7coef * Math.pow (l, 7.0)),
-        /* Calculate northing (y) */
-        ArcLengthOfMeridian (phi)
-            + (t / 2.0 * N * Math.pow (Math.cos (phi), 2.0) * Math.pow (l, 2.0))
-            + (t / 24.0 * N * Math.pow (Math.cos (phi), 4.0) * l4coef * Math.pow (l, 4.0))
-            + (t / 720.0 * N * Math.pow (Math.cos (phi), 6.0) * l6coef * Math.pow (l, 6.0))
-            + (t / 40320.0 * N * Math.pow (Math.cos (phi), 8.0) * l8coef * Math.pow (l, 8.0)));
+                /* Calculate easting (x) */
+                N * Math.cos (phi) * l
+                + (N / 6.0 * Math.pow (Math.cos (phi), 3.0) * l3coef * Math.pow (l, 3.0))
+                + (N / 120.0 * Math.pow (Math.cos (phi), 5.0) * l5coef * Math.pow (l, 5.0))
+                + (N / 5040.0 * Math.pow (Math.cos (phi), 7.0) * l7coef * Math.pow (l, 7.0)),
+                /* Calculate northing (y) */
+                ArcLengthOfMeridian (phi)
+                + (t / 2.0 * N * Math.pow (Math.cos (phi), 2.0) * Math.pow (l, 2.0))
+                + (t / 24.0 * N * Math.pow (Math.cos (phi), 4.0) * l4coef * Math.pow (l, 4.0))
+                + (t / 720.0 * N * Math.pow (Math.cos (phi), 6.0) * l6coef * Math.pow (l, 6.0))
+                + (t / 40320.0 * N * Math.pow (Math.cos (phi), 8.0) * l8coef * Math.pow (l, 8.0)));
     }
 
     /*
-    * MapXYToLatLon
-    *
-    * Converts x and y coordinates in the Transverse Mercator projection to
-    * a latitude/longitude pair.  Note that Transverse Mercator is not
-    * the same as UTM; a scale factor is required to convert between them.
-    *
-    * Reference: Hoffmann-Wellenhof, B., Lichtenegger, H., and Collins, J.,
-    *   GPS: Theory and Practice, 3rd ed.  New York: Springer-Verlag Wien, 1994.
-    *
-    * Inputs:
-    *   x - The easting of the point, in meters.
-    *   y - The northing of the point, in meters.
-    *   lambda0 - Longitude of the central meridian to be used, in radians.
-    *
-    * Outputs:
-    *   philambda - A 2-element containing the latitude and longitude
-    *               in radians.
-    *
-    * Returns:
-    *   The function does not return a value.
-    *
-    * Remarks:
-    *   The local variables Nf, nuf2, tf, and tf2 serve the same purpose as
-    *   N, nu2, t, and t2 in MapLatLonToXY, but they are computed with respect
-    *   to the footpoint latitude phif.
-    *
-    *   x1frac, x2frac, x2poly, x3poly, etc. are to enhance readability and
-    *   to optimize computations.
-    *
-    */
-    public LatLon MapXYToLatLon(double x, double y, double lambda0)
+     * MapXYToLatLon
+     *
+     * Converts x and y coordinates in the Transverse Mercator projection to
+     * a latitude/longitude pair.  Note that Transverse Mercator is not
+     * the same as UTM; a scale factor is required to convert between them.
+     *
+     * Reference: Hoffmann-Wellenhof, B., Lichtenegger, H., and Collins, J.,
+     *   GPS: Theory and Practice, 3rd ed.  New York: Springer-Verlag Wien, 1994.
+     *
+     * Inputs:
+     *   x - The easting of the point, in meters.
+     *   y - The northing of the point, in meters.
+     *   lambda0 - Longitude of the central meridian to be used, in radians.
+     *
+     * Outputs:
+     *   philambda - A 2-element containing the latitude and longitude
+     *               in radians.
+     *
+     * Returns:
+     *   The function does not return a value.
+     *
+     * Remarks:
+     *   The local variables Nf, nuf2, tf, and tf2 serve the same purpose as
+     *   N, nu2, t, and t2 in MapLatLonToXY, but they are computed with respect
+     *   to the footpoint latitude phif.
+     *
+     *   x1frac, x2frac, x2poly, x3poly, etc. are to enhance readability and
+     *   to optimize computations.
+     *
+     */
+    public LatLon mapXYToLatLon(double x, double y, double lambda0)
     {
         /* Get the value of phif, the footpoint latitude. */
@@ -272,5 +270,5 @@
         /* Precalculate ep2 */
         double ep2 = (Math.pow (Ellipsoid.GRS80.a, 2.0) - Math.pow (Ellipsoid.GRS80.b, 2.0))
-              / Math.pow (Ellipsoid.GRS80.b, 2.0);
+        / Math.pow (Ellipsoid.GRS80.b, 2.0);
 
         /* Precalculate cos (phif) */
@@ -325,25 +323,25 @@
 
         return new LatLon(
-        /* Calculate latitude */
-        Math.toDegrees(
-        phif + x2frac * x2poly * (x * x)
-        + x4frac * x4poly * Math.pow (x, 4.0)
-        + x6frac * x6poly * Math.pow (x, 6.0)
-        + x8frac * x8poly * Math.pow (x, 8.0)),
-        Math.toDegrees(
-        /* Calculate longitude */
-        lambda0 + x1frac * x
-        + x3frac * x3poly * Math.pow (x, 3.0)
-        + x5frac * x5poly * Math.pow (x, 5.0)
-        + x7frac * x7poly * Math.pow (x, 7.0)));
+                /* Calculate latitude */
+                Math.toDegrees(
+                        phif + x2frac * x2poly * (x * x)
+                        + x4frac * x4poly * Math.pow (x, 4.0)
+                        + x6frac * x6poly * Math.pow (x, 6.0)
+                        + x8frac * x8poly * Math.pow (x, 8.0)),
+                        Math.toDegrees(
+                                /* Calculate longitude */
+                                lambda0 + x1frac * x
+                                + x3frac * x3poly * Math.pow (x, 3.0)
+                                + x5frac * x5poly * Math.pow (x, 5.0)
+                                + x7frac * x7poly * Math.pow (x, 7.0)));
     }
 
     public EastNorth latlon2eastNorth(LatLon p) {
-        EastNorth a = MapLatLonToXY(Math.toRadians(p.lat()), Math.toRadians(p.lon()), UTMCentralMeridian(getzone()));
+        EastNorth a = mapLatLonToXY(Math.toRadians(p.lat()), Math.toRadians(p.lon()), UTMCentralMeridian(getzone()));
         return new EastNorth(a.east() * UTMScaleFactor + 3500000.0, a.north() * UTMScaleFactor);
     }
 
     public LatLon eastNorth2latlon(EastNorth p) {
-        return MapXYToLatLon((p.east()-3500000.0)/UTMScaleFactor, p.north()/UTMScaleFactor, UTMCentralMeridian(getzone()));
+        return mapXYToLatLon((p.east()-3500000.0)/UTMScaleFactor, p.north()/UTMScaleFactor, UTMCentralMeridian(getzone()));
     }
 
@@ -414,6 +412,7 @@
                 {
                     zone = Integer.parseInt(s);
-                    if(zone <= 0 || zone > 60)
+                    if(zone <= 0 || zone > 60) {
                         zone = DEFAULT_ZONE;
+                    }
                     break;
                 }
@@ -430,7 +429,5 @@
                 int zoneval = Integer.parseInt(zonestring);
                 if(zoneval > 0 && zoneval <= 60)
-                {
                     return Collections.singleton(zonestring);
-                }
             } catch(NumberFormatException e) {}
         }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManager.java	(revision 2788)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManager.java	(revision 2789)
@@ -333,5 +333,5 @@
      * the cancel / close action
      */
-    class CancelAction extends AbstractAction {
+    static class CancelAction extends AbstractAction {
         public CancelAction() {
             putValue(NAME, tr("Close"));
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java	(revision 2788)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java	(revision 2789)
@@ -67,14 +67,14 @@
         HtmlPanel pnl = new HtmlPanel();
         pnl.setText(
-                "<html><body>" 
-                 + tr("Please enter or paste an URL to retrieve changesets from the OSM API.") 
-                 + "<p><strong>" + tr("Examples") + "</strong></p>"
-                 + "<ul>"
-                 + "<li><a href=\"http://www.openstreetmap.org/browse/changesets?open=true\">http://www.openstreetmap.org/browse/changesets?open=true</a></li>"
-                 + "<li><a href=\"http://api.openstreetmap.org/api/0.6/changesets?open=true\">http://api.openstreetmap.org/api/0.6/changesets?open=true</a></li>"
-                 + "</ul>"
-                 + tr("Note that changeset queries are currently always submitted to ''{0}'', regardless of the "
-                    + "host, port and path of the URL entered below.", OsmApi.getOsmApi().getBaseUrl())
-                 + "</body></html>"
+                "<html><body>"
+                + tr("Please enter or paste an URL to retrieve changesets from the OSM API.")
+                + "<p><strong>" + tr("Examples") + "</strong></p>"
+                + "<ul>"
+                + "<li><a href=\"http://www.openstreetmap.org/browse/changesets?open=true\">http://www.openstreetmap.org/browse/changesets?open=true</a></li>"
+                + "<li><a href=\"http://api.openstreetmap.org/api/0.6/changesets?open=true\">http://api.openstreetmap.org/api/0.6/changesets?open=true</a></li>"
+                + "</ul>"
+                + tr("Note that changeset queries are currently always submitted to ''{0}'', regardless of the "
+                        + "host, port and path of the URL entered below.", OsmApi.getOsmApi().getBaseUrl())
+                        + "</body></html>"
         );
         pnl.getEditorPane().addHyperlinkListener(
@@ -91,11 +91,4 @@
     }
 
-    protected ChangesetQuery buildChangesetQueryFromUrlQuery(String query) {
-        if (query == null)
-            return new ChangesetQuery();
-        query = query.trim();
-        return null;
-    }
-
     protected void build() {
         setLayout(new GridBagLayout());
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationMemberTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationMemberTask.java	(revision 2788)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationMemberTask.java	(revision 2789)
@@ -35,5 +35,4 @@
     private Collection<OsmPrimitive> children;
     private OsmDataLayer curLayer;
-    private MemberTableModel memberTableModel;
     private MultiFetchServerObjectReader objectReader;
 
@@ -43,5 +42,4 @@
         this.children = children;
         this.curLayer = curLayer;
-        this.memberTableModel = memberTableModel;
     }
 
@@ -51,5 +49,4 @@
         this.children = children;
         this.curLayer = curLayer;
-        this.memberTableModel = memberTableModel;
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTask.java	(revision 2788)
+++ trunk/src/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTask.java	(revision 2789)
@@ -103,7 +103,7 @@
         JosmUserIdentityManager im = null;
         try {
+            im = JosmUserIdentityManager.getInstance();
             OsmServerUserInfoReader reader = new OsmServerUserInfoReader();
             UserInfo info = reader.fetchUserInfo(getProgressMonitor().createSubTaskMonitor(1, false));
-            im = JosmUserIdentityManager.getInstance();
             im.setFullyIdentified(info.getDisplayName(), info);
         } catch(OsmTransferException e) {
Index: trunk/src/org/openstreetmap/josm/gui/io/SaveLayersTable.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/SaveLayersTable.java	(revision 2788)
+++ trunk/src/org/openstreetmap/josm/gui/io/SaveLayersTable.java	(revision 2789)
@@ -19,6 +19,8 @@
             Mode mode = (Mode)evt.getNewValue();
             switch(mode) {
-                case EDITING_DATA: setEnabled(true);
-                case UPLOADING_AND_SAVING: setEnabled(false);
+            case EDITING_DATA: setEnabled(true);
+            break;
+            case UPLOADING_AND_SAVING: setEnabled(false);
+            break;
             }
         }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/PrefJPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/PrefJPanel.java	(revision 2789)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/PrefJPanel.java	(revision 2789)
@@ -0,0 +1,555 @@
+/*
+ * prefJPanel.java
+ *
+ * Created on 28. September 2008, 17:47
+ */
+
+package org.openstreetmap.josm.gui.preferences;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.event.KeyEvent;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import javax.swing.JEditorPane;
+import javax.swing.JScrollPane;
+import javax.swing.ListSelectionModel;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.table.TableModel;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.Shortcut;
+
+/**
+ * This is the keyboard preferences content.
+ * If someone wants to merge it with ShortcutPreference.java, feel free.
+ */
+public class PrefJPanel extends javax.swing.JPanel {
+
+        // table of shortcuts
+        private TableModel model;
+        // comboboxes of modifier groups, mapping selectedIndex to real data
+        private static int[] modifInts = new int[]{
+            -1,
+            0,
+            KeyEvent.SHIFT_DOWN_MASK,
+            KeyEvent.CTRL_DOWN_MASK,
+            KeyEvent.ALT_DOWN_MASK,
+            KeyEvent.META_DOWN_MASK,
+            KeyEvent.CTRL_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK,
+            KeyEvent.ALT_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK,
+            KeyEvent.META_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK,
+            KeyEvent.CTRL_DOWN_MASK | KeyEvent.ALT_DOWN_MASK,
+            KeyEvent.CTRL_DOWN_MASK | KeyEvent.META_DOWN_MASK,
+            KeyEvent.ALT_DOWN_MASK | KeyEvent.META_DOWN_MASK,
+            KeyEvent.CTRL_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK | KeyEvent.ALT_DOWN_MASK,
+            KeyEvent.META_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK | KeyEvent.ALT_DOWN_MASK
+        };
+        // and here are the texts fro the comboboxes
+        private static String[] modifList = new String[] {
+            tr("disabled"),
+            tr("no modifier"),
+            KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[2]).getModifiers()),
+            KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[3]).getModifiers()),
+            KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[4]).getModifiers()),
+            KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[5]).getModifiers()),
+            KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[6]).getModifiers()),
+            KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[7]).getModifiers()),
+            KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[8]).getModifiers()),
+            KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[9]).getModifiers()),
+            KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[10]).getModifiers()),
+            KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[11]).getModifiers()),
+            KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[12]).getModifiers()),
+            KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[13]).getModifiers())
+        };
+        // this are the display(!) texts for the checkboxes. Let the JVM do the i18n for us <g>.
+        // Ok, there's a real reason for this: The JVM should know best how the keys are labelled
+        // on the physical keyboard. What language pack is installed in JOSM is completely
+        // independent from the keyboard's labelling. But the operation system's locale
+        // usually matches the keyboard. This even works with my English Windows and my German
+        // keyboard.
+        private static String SHIFT = KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.SHIFT_DOWN_MASK).getModifiers());
+        private static String CTRL  = KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.CTRL_DOWN_MASK).getModifiers());
+        private static String ALT   = KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.ALT_DOWN_MASK).getModifiers());
+        private static String META  = KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.META_DOWN_MASK).getModifiers());
+
+        // A list of keys to present the user. Sadly this really is a list of keys Java knows about,
+        // not a list of real physical keys. If someone knows how to get that list?
+        private static Map<Integer, String> keyList = setKeyList();
+
+        private static Map<Integer, String> setKeyList() {
+            Map<Integer, String> list = new LinkedHashMap<Integer, String>();
+            // I hate this, but I found no alternative...
+            for (int i = 0; i < 65534; i++) {
+                String s = KeyEvent.getKeyText(i);
+                if (s != null && s.length() > 0 && !s.contains("Unknown")) {
+                    list.put(Integer.valueOf(i), s);
+                    //System.out.println(i+": "+s);
+                }
+            }
+            list.put(Integer.valueOf(-1), "");
+            return list;
+        }
+
+    /** Creates new form prefJPanel */
+    // Ain't those auto-generated comments helpful or what? <g>
+    public PrefJPanel(TableModel model) {
+        this.model = model;
+        initComponents();
+    }
+
+    private void initComponents() {
+
+        // Did I mention auto-generated? That's the reason we
+        // have lots of properties here and not some arrays...
+        prefTabPane = new javax.swing.JTabbedPane();
+        shortcutTab = new javax.swing.JPanel();
+        listPane = new javax.swing.JPanel();
+        listScrollPane = new javax.swing.JScrollPane();
+        shortcutTable = new javax.swing.JTable();
+        shortcutEditPane = new javax.swing.JPanel();
+        cbDefault = new javax.swing.JCheckBox();
+        jLabel4 = new javax.swing.JLabel();
+        cbShift = new javax.swing.JCheckBox();
+        cbDisable = new javax.swing.JCheckBox();
+        cbCtrl = new javax.swing.JCheckBox();
+        tfKeyLabel = new javax.swing.JLabel();
+        cbAlt = new javax.swing.JCheckBox();
+        tfKey = new javax.swing.JComboBox();
+        cbMeta = new javax.swing.JCheckBox();
+        jLabel6 = new javax.swing.JLabel();
+        modifierTab = new javax.swing.JPanel();
+        editGroupPane = new javax.swing.JPanel();
+        jLabel1 = new javax.swing.JLabel();
+        bxPrim1 = new javax.swing.JComboBox();
+        jLabel2 = new javax.swing.JLabel();
+        bxSec1 = new javax.swing.JComboBox();
+        jLabel3 = new javax.swing.JLabel();
+        bxTer1 = new javax.swing.JComboBox();
+        menuGroupPane = new javax.swing.JPanel();
+        jLabel7 = new javax.swing.JLabel();
+        bxPrim2 = new javax.swing.JComboBox();
+        jLabel8 = new javax.swing.JLabel();
+        bxSec2 = new javax.swing.JComboBox();
+        jLabel9 = new javax.swing.JLabel();
+        bxTer2 = new javax.swing.JComboBox();
+        hotkeyGroupPane = new javax.swing.JPanel();
+        jLabel10 = new javax.swing.JLabel();
+        bxPrim3 = new javax.swing.JComboBox();
+        jLabel11 = new javax.swing.JLabel();
+        bxSec3 = new javax.swing.JComboBox();
+        jLabel12 = new javax.swing.JLabel();
+        bxTer3 = new javax.swing.JComboBox();
+        subwindowGroupPane = new javax.swing.JPanel();
+        jLabel13 = new javax.swing.JLabel();
+        bxPrim4 = new javax.swing.JComboBox();
+        jLabel14 = new javax.swing.JLabel();
+        bxSec4 = new javax.swing.JComboBox();
+        jLabel15 = new javax.swing.JLabel();
+        bxTer4 = new javax.swing.JComboBox();
+        infoTab = new javax.swing.JPanel();
+        cbAction action = new cbAction(this);
+        bxAction action2 = new bxAction();
+
+        setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.Y_AXIS));
+
+                // If someone wants to move this text into some resource, feel free.
+                infoTab.setLayout(new javax.swing.BoxLayout(shortcutTab, javax.swing.BoxLayout.Y_AXIS));
+                JEditorPane editor = new JEditorPane();
+                editor.setEditable(false);
+                editor.setContentType("text/html");
+                editor.setText(
+                    tr("<h1><a name=\"top\">Keyboard Shortcuts</a></h1>")+
+                    tr("<p>Please note that shortcuts keys are assigned to the actions when JOSM is started. So you need to <b>restart</b> "
+                      +"JOSM to see your changes.</p>")+
+                    tr("<p>Furthermore, the shortcuts are activated when the actions are assigned to a menu entry of button for the first "
+                      +"time. So some of your changes may become active even without restart --- but also without collistion handling. "
+                      +"This is another reason to <b>restart</b> JOSM after making any changes here.</p>")+
+                    tr("<p>You may notice that the key selection list on the next page lists all keys that exist on all kinds of keyboards "
+                      +"Java knows about, not just those keys that exist on your keyboard. Please use only those values that correspond to "
+                      +"a real key on your keyboard. So if your keyboard has no 'Copy' key (PC keyboard don't have them, Sun keyboards do), "
+                      +"the do not use it. Also there will be 'keys' listed that correspond to a shortcut on your keyboard (e.g. ':'/Colon). "
+                      +"Please also do not use them, use the base key (';'/Semicolon on US keyboards, '.'/Period on German keyboards, ...) "
+                      +"instead. Not doing so may result in conflicts, as there is no way for JOSM to know that Ctrl+Shift+; and Ctrl+: "
+                      +"actually is the same thing on an US keyboard...</p>")+
+                    tr("<p>Thank you for your understanding</p>")+
+                    tr("<h1>Modifier Groups</h1>")+
+                    tr("<p>The last page lists the modifier keys JOSM will automatically assign to shortcuts. For every of the four kinds "
+                      +"of shortcuts there are three alternatives. JOSM will try those alternative in the listed order when managing a "
+                      +"conflict. If all alternatives would result in shortcuts that are already taken, it will assign a random shortcut "
+                      +"instead.</p>")+
+                    tr("<p>The pseudo-modifier 'disabled' will disable the shortcut when encountered.</p>")
+                );
+                editor.setCaretPosition(0); // scroll up
+                prefTabPane.addTab(tr("Read First"), new JScrollPane(editor));
+
+        shortcutTab.setLayout(new javax.swing.BoxLayout(shortcutTab, javax.swing.BoxLayout.Y_AXIS));
+
+        listPane.setLayout(new java.awt.GridLayout());
+
+        // This is the list of shortcuts:
+        shortcutTable.setModel(model);
+        shortcutTable.getSelectionModel().addListSelectionListener(new cbAction(this));
+        //shortcutTable.setFillsViewportHeight(true); Java 1.6
+        shortcutTable.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
+        listScrollPane.setViewportView(shortcutTable);
+
+        listPane.add(listScrollPane);
+
+        shortcutTab.add(listPane);
+
+        // and here follows the edit area. I won't object to someone re-designing it, it looks, um, "minimalistic" ;)
+        shortcutEditPane.setLayout(new java.awt.GridLayout(5, 2));
+
+        cbDefault.setAction(action);
+        cbDefault.setText(tr("Use default"));
+        shortcutEditPane.add(cbDefault);
+
+        shortcutEditPane.add(jLabel4);
+
+        cbShift.setAction(action);
+        cbShift.setText(SHIFT); // see above for why no tr()
+        shortcutEditPane.add(cbShift);
+
+        cbDisable.setAction(action);
+        cbDisable.setText(tr("Disable"));
+        shortcutEditPane.add(cbDisable);
+
+        cbCtrl.setAction(action);
+        cbCtrl.setText(CTRL); // see above for why no tr()
+        shortcutEditPane.add(cbCtrl);
+
+        tfKeyLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
+        tfKeyLabel.setText(tr("Key:"));
+        shortcutEditPane.add(tfKeyLabel);
+
+        cbAlt.setAction(action);
+        cbAlt.setText(ALT); // see above for why no tr()
+        shortcutEditPane.add(cbAlt);
+
+        tfKey.setAction(action);
+        tfKey.setModel(new javax.swing.DefaultComboBoxModel(keyList.values().toArray()));
+        shortcutEditPane.add(tfKey);
+
+        cbMeta.setAction(action);
+        cbMeta.setText(META); // see above for why no tr()
+        shortcutEditPane.add(cbMeta);
+
+        jLabel6.setText(tr("Attention: Use real keyboard keys only!"));
+        shortcutEditPane.add(jLabel6);
+
+        action.actionPerformed(null); // init checkboxes
+
+        shortcutTab.add(shortcutEditPane);
+
+        prefTabPane.addTab(tr("Keyboard Shortcuts"), shortcutTab);
+
+        // next is the modfier group tab.
+        // Would be a nice array if I had done it by hand. But then, it would be finished next year or so...
+        modifierTab.setLayout(new java.awt.GridLayout(0, 1));
+        JScrollPane modifierScroller = new JScrollPane(modifierTab);
+
+        editGroupPane.setBorder(javax.swing.BorderFactory.createTitledBorder(tr("Edit Shortcuts")));
+        editGroupPane.setLayout(new java.awt.GridLayout(3, 5));
+
+        jLabel1.setText(tr("Primary modifier:"));
+        editGroupPane.add(jLabel1);
+
+        bxPrim1.setModel(new javax.swing.DefaultComboBoxModel(modifList));
+        editGroupPane.add(bxPrim1);
+
+        jLabel2.setText(tr("Secondary modifier:"));
+        editGroupPane.add(jLabel2);
+
+        bxSec1.setModel(new javax.swing.DefaultComboBoxModel(modifList));
+        editGroupPane.add(bxSec1);
+
+        jLabel3.setText(tr("Tertiary modifier:"));
+        editGroupPane.add(jLabel3);
+
+        bxTer1.setModel(new javax.swing.DefaultComboBoxModel(modifList));
+        editGroupPane.add(bxTer1);
+
+        modifierTab.add(editGroupPane);
+
+        menuGroupPane.setBorder(javax.swing.BorderFactory.createTitledBorder(tr("Menu Shortcuts")));
+        menuGroupPane.setLayout(new java.awt.GridLayout(3, 5));
+
+        jLabel7.setText(tr("Primary modifier:"));
+        menuGroupPane.add(jLabel7);
+
+        bxPrim2.setModel(new javax.swing.DefaultComboBoxModel(modifList));
+        menuGroupPane.add(bxPrim2);
+
+        jLabel8.setText(tr("Secondary modifier:"));
+        menuGroupPane.add(jLabel8);
+
+        bxSec2.setModel(new javax.swing.DefaultComboBoxModel(modifList));
+        menuGroupPane.add(bxSec2);
+
+        jLabel9.setText(tr("Tertiary modifier:"));
+        menuGroupPane.add(jLabel9);
+
+        bxTer2.setModel(new javax.swing.DefaultComboBoxModel(modifList));
+        menuGroupPane.add(bxTer2);
+
+        modifierTab.add(menuGroupPane);
+
+        hotkeyGroupPane.setBorder(javax.swing.BorderFactory.createTitledBorder(tr("Hotkey Shortcuts")));
+        hotkeyGroupPane.setLayout(new java.awt.GridLayout(3, 5));
+
+        jLabel10.setText(tr("Primary modifier:"));
+        hotkeyGroupPane.add(jLabel10);
+
+        bxPrim3.setModel(new javax.swing.DefaultComboBoxModel(modifList));
+        hotkeyGroupPane.add(bxPrim3);
+
+        jLabel11.setText(tr("Secondary modifier:"));
+        hotkeyGroupPane.add(jLabel11);
+
+        bxSec3.setModel(new javax.swing.DefaultComboBoxModel(modifList));
+        hotkeyGroupPane.add(bxSec3);
+
+        jLabel12.setText(tr("Tertiary modifier:"));
+        hotkeyGroupPane.add(jLabel12);
+
+        bxTer3.setModel(new javax.swing.DefaultComboBoxModel(modifList));
+        hotkeyGroupPane.add(bxTer3);
+
+        modifierTab.add(hotkeyGroupPane);
+
+        subwindowGroupPane.setBorder(javax.swing.BorderFactory.createTitledBorder(tr("Subwindow Shortcuts")));
+        subwindowGroupPane.setLayout(new java.awt.GridLayout(3, 5));
+
+        jLabel13.setText(tr("Primary modifier:"));
+        subwindowGroupPane.add(jLabel13);
+
+        bxPrim4.setModel(new javax.swing.DefaultComboBoxModel(modifList));
+        subwindowGroupPane.add(bxPrim4);
+
+        jLabel14.setText(tr("Secondary modifier:"));
+        subwindowGroupPane.add(jLabel14);
+
+        bxSec4.setModel(new javax.swing.DefaultComboBoxModel(modifList));
+        subwindowGroupPane.add(bxSec4);
+
+        jLabel15.setText(tr("Tertiary modifier:"));
+        subwindowGroupPane.add(jLabel15);
+
+        bxTer4.setModel(new javax.swing.DefaultComboBoxModel(modifList));
+        subwindowGroupPane.add(bxTer4);
+
+                initbx();
+                bxPrim1.setAction(action2);
+                bxSec1.setAction(action2);
+                bxTer1.setAction(action2);
+                bxPrim2.setAction(action2);
+                bxSec2.setAction(action2);
+                bxTer2.setAction(action2);
+                bxPrim3.setAction(action2);
+                bxSec3.setAction(action2);
+                bxTer3.setAction(action2);
+                bxPrim4.setAction(action2);
+                bxSec4.setAction(action2);
+                bxTer4.setAction(action2);
+
+        modifierTab.add(subwindowGroupPane);
+
+        prefTabPane.addTab(tr("Modifier Groups"), modifierScroller);
+
+        add(prefTabPane);
+    }
+
+    // this allows to edit shortcuts. it:
+    //  * sets the edit controls to the selected shortcut
+    //  * enabled/disables the controls as needed
+    //  * writes the user's changes to the shortcut
+    // And after I finally had it working, I realized that those two methods
+    // are playing ping-pong (politically correct: table tennis, I know) and
+    // even have some duplicated code. Feel free to refactor, If you have
+    // more expirience with GUI coding than I have.
+    private class cbAction extends javax.swing.AbstractAction implements ListSelectionListener {
+        private PrefJPanel panel;
+            public cbAction (PrefJPanel panel) {
+                this.panel = panel;
+        }
+        public void valueChanged(ListSelectionEvent e) {
+            ListSelectionModel lsm = panel.shortcutTable.getSelectionModel(); // can't use e here
+            if (!lsm.isSelectionEmpty()) {
+                int row = lsm.getMinSelectionIndex();
+                Shortcut sc = (Shortcut)panel.model.getValueAt(row, -1);
+                panel.cbDefault.setSelected(!sc.getAssignedUser());
+                panel.cbDisable.setSelected(sc.getKeyStroke() == null);
+                panel.cbShift.setSelected(sc.getAssignedModifier() != -1 && (sc.getAssignedModifier() & KeyEvent.SHIFT_DOWN_MASK) != 0);
+                panel.cbCtrl.setSelected(sc.getAssignedModifier() != -1 && (sc.getAssignedModifier() & KeyEvent.CTRL_DOWN_MASK) != 0);
+                panel.cbAlt.setSelected(sc.getAssignedModifier() != -1 && (sc.getAssignedModifier() & KeyEvent.ALT_DOWN_MASK) != 0);
+                panel.cbMeta.setSelected(sc.getAssignedModifier() != -1 && (sc.getAssignedModifier() & KeyEvent.META_DOWN_MASK) != 0);
+                if (sc.getKeyStroke() != null) {
+                    tfKey.setSelectedItem(keyList.get(sc.getKeyStroke().getKeyCode()));
+                } else {
+                    tfKey.setSelectedItem(keyList.get(-1));
+                }
+                if (!sc.isChangeable()) {
+                    panel.cbDefault.setEnabled(false);
+                    panel.cbDisable.setEnabled(false);
+                    panel.cbShift.setEnabled(false);
+                    panel.cbCtrl.setEnabled(false);
+                    panel.cbAlt.setEnabled(false);
+                    panel.cbMeta.setEnabled(false);
+                    panel.tfKey.setEnabled(false);
+                } else {
+                    panel.cbDefault.setEnabled(true);
+                    actionPerformed(null);
+                }
+            } else {
+                panel.cbDefault.setEnabled(false);
+                panel.cbDisable.setEnabled(false);
+                panel.cbShift.setEnabled(false);
+                panel.cbCtrl.setEnabled(false);
+                panel.cbAlt.setEnabled(false);
+                panel.cbMeta.setEnabled(false);
+                panel.tfKey.setEnabled(false);
+            }
+        }
+        public void actionPerformed(java.awt.event.ActionEvent e) {
+            ListSelectionModel lsm = panel.shortcutTable.getSelectionModel();
+            if (lsm != null && !lsm.isSelectionEmpty()) {
+                if (e != null) { // only if we've been called by a user action
+                    int row = lsm.getMinSelectionIndex();
+                    Shortcut sc = (Shortcut)panel.model.getValueAt(row, -1);
+                    sc.setAssignedUser(!panel.cbDefault.isSelected());
+                    if (panel.cbDisable.isSelected()) {
+                        sc.setAssignedModifier(-1);
+                    } else if (panel.tfKey.getSelectedItem().equals("")) {
+                        sc.setAssignedModifier(KeyEvent.VK_CANCEL);
+                    } else {
+                        sc.setAssignedModifier(
+                            (panel.cbShift.isSelected() ? KeyEvent.SHIFT_DOWN_MASK : 0) |
+                            (panel.cbCtrl.isSelected() ? KeyEvent.CTRL_DOWN_MASK : 0) |
+                            (panel.cbAlt.isSelected() ? KeyEvent.ALT_DOWN_MASK : 0) |
+                            (panel.cbMeta.isSelected() ? KeyEvent.META_DOWN_MASK : 0)
+                        );
+                        for (Map.Entry<Integer, String> entry : keyList.entrySet()) {
+                            if (entry.getValue().equals(panel.tfKey.getSelectedItem())) {
+                                sc.setAssignedKey(entry.getKey());
+                            }
+                        }
+                    }
+                    valueChanged(null);
+                }
+                boolean state = !panel.cbDefault.isSelected();
+                panel.cbDisable.setEnabled(state);
+                state = state && !panel.cbDisable.isSelected();
+                panel.cbShift.setEnabled(state);
+                panel.cbCtrl.setEnabled(state);
+                panel.cbAlt.setEnabled(state);
+                panel.cbMeta.setEnabled(state);
+                panel.tfKey.setEnabled(state);
+            } else {
+                panel.cbDefault.setEnabled(false);
+                panel.cbDisable.setEnabled(false);
+                panel.cbShift.setEnabled(false);
+                panel.cbCtrl.setEnabled(false);
+                panel.cbAlt.setEnabled(false);
+                panel.cbMeta.setEnabled(false);
+                panel.tfKey.setEnabled(false);
+            }
+        }
+    }
+
+    // this handles the modifier groups
+    private class bxAction extends javax.swing.AbstractAction {
+        public void actionPerformed(java.awt.event.ActionEvent e) {
+            Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_DEFAULT+Shortcut.GROUP_EDIT),    Integer.toString( modifInts[bxPrim1.getSelectedIndex()] ));
+            Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_ALT1   +Shortcut.GROUP_EDIT),    Integer.toString( modifInts[ bxSec1.getSelectedIndex()] ));
+            Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_ALT2   +Shortcut.GROUP_EDIT),    Integer.toString( modifInts[ bxTer1.getSelectedIndex()] ));
+
+            Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_DEFAULT+Shortcut.GROUP_MENU),    Integer.toString( modifInts[bxPrim2.getSelectedIndex()] ));
+            Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_ALT1   +Shortcut.GROUP_MENU),    Integer.toString( modifInts[ bxSec2.getSelectedIndex()] ));
+            Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_ALT2   +Shortcut.GROUP_MENU),    Integer.toString( modifInts[ bxTer2.getSelectedIndex()] ));
+
+            Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_DEFAULT+Shortcut.GROUP_HOTKEY),  Integer.toString( modifInts[bxPrim3.getSelectedIndex()] ));
+            Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_ALT1   +Shortcut.GROUP_HOTKEY),  Integer.toString( modifInts[ bxSec3.getSelectedIndex()] ));
+            Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_ALT2   +Shortcut.GROUP_HOTKEY),  Integer.toString( modifInts[ bxTer3.getSelectedIndex()] ));
+
+            Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_DEFAULT+Shortcut.GROUP_LAYER),   Integer.toString( modifInts[bxPrim4.getSelectedIndex()] ));
+            Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_ALT1   +Shortcut.GROUP_LAYER),   Integer.toString( modifInts[ bxSec4.getSelectedIndex()] ));
+            Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_ALT2   +Shortcut.GROUP_LAYER),   Integer.toString( modifInts[ bxTer4.getSelectedIndex()] ));
+        }
+    }
+
+    private void initbx() {
+        setBx(bxPrim1, "shortcut.groups."+(Shortcut.GROUPS_DEFAULT+Shortcut.GROUP_EDIT));
+        setBx(bxSec1,  "shortcut.groups."+(Shortcut.GROUPS_ALT1   +Shortcut.GROUP_EDIT));
+        setBx(bxTer1,  "shortcut.groups."+(Shortcut.GROUPS_ALT2   +Shortcut.GROUP_EDIT));
+
+        setBx(bxPrim2, "shortcut.groups."+(Shortcut.GROUPS_DEFAULT+Shortcut.GROUP_MENU));
+        setBx(bxSec2,  "shortcut.groups."+(Shortcut.GROUPS_ALT1   +Shortcut.GROUP_MENU));
+        setBx(bxTer2,  "shortcut.groups."+(Shortcut.GROUPS_ALT2   +Shortcut.GROUP_MENU));
+
+        setBx(bxPrim3, "shortcut.groups."+(Shortcut.GROUPS_DEFAULT+Shortcut.GROUP_HOTKEY));
+        setBx(bxSec3,  "shortcut.groups."+(Shortcut.GROUPS_ALT1   +Shortcut.GROUP_HOTKEY));
+        setBx(bxTer3,  "shortcut.groups."+(Shortcut.GROUPS_ALT2   +Shortcut.GROUP_HOTKEY));
+
+        setBx(bxPrim4, "shortcut.groups."+(Shortcut.GROUPS_DEFAULT+Shortcut.GROUP_LAYER));
+        setBx(bxSec4,  "shortcut.groups."+(Shortcut.GROUPS_ALT1   +Shortcut.GROUP_LAYER));
+        setBx(bxTer4,  "shortcut.groups."+(Shortcut.GROUPS_ALT2   +Shortcut.GROUP_LAYER));
+    }
+    private void setBx(javax.swing.JComboBox bx, String key) {
+        int target = Main.pref.getInteger(key, -1);
+        for (int i = 0; i < modifInts.length; i++) {
+            if (modifInts[i] == target) {
+                bx.setSelectedIndex(i);
+            }
+        }
+    }
+
+    private javax.swing.JComboBox bxPrim1;
+    private javax.swing.JComboBox bxPrim2;
+    private javax.swing.JComboBox bxPrim3;
+    private javax.swing.JComboBox bxPrim4;
+    private javax.swing.JComboBox bxSec1;
+    private javax.swing.JComboBox bxSec2;
+    private javax.swing.JComboBox bxSec3;
+    private javax.swing.JComboBox bxSec4;
+    private javax.swing.JComboBox bxTer1;
+    private javax.swing.JComboBox bxTer2;
+    private javax.swing.JComboBox bxTer3;
+    private javax.swing.JComboBox bxTer4;
+    private javax.swing.JCheckBox cbAlt;
+    private javax.swing.JCheckBox cbCtrl;
+    private javax.swing.JCheckBox cbDefault;
+    private javax.swing.JCheckBox cbDisable;
+    private javax.swing.JCheckBox cbMeta;
+    private javax.swing.JCheckBox cbShift;
+    private javax.swing.JPanel editGroupPane;
+    private javax.swing.JPanel hotkeyGroupPane;
+    private javax.swing.JLabel jLabel1;
+    private javax.swing.JLabel jLabel10;
+    private javax.swing.JLabel jLabel11;
+    private javax.swing.JLabel jLabel12;
+    private javax.swing.JLabel jLabel13;
+    private javax.swing.JLabel jLabel14;
+    private javax.swing.JLabel jLabel15;
+    private javax.swing.JLabel jLabel2;
+    private javax.swing.JLabel jLabel3;
+    private javax.swing.JLabel jLabel4;
+    private javax.swing.JLabel jLabel6;
+    private javax.swing.JLabel jLabel7;
+    private javax.swing.JLabel jLabel8;
+    private javax.swing.JLabel jLabel9;
+    private javax.swing.JPanel listPane;
+    private javax.swing.JScrollPane listScrollPane;
+    private javax.swing.JPanel menuGroupPane;
+    private javax.swing.JPanel modifierTab;
+    private javax.swing.JTabbedPane prefTabPane;
+    private javax.swing.JPanel shortcutEditPane;
+    private javax.swing.JPanel shortcutTab;
+    private javax.swing.JTable shortcutTable;
+    private javax.swing.JPanel subwindowGroupPane;
+    private javax.swing.JComboBox tfKey;
+    private javax.swing.JLabel tfKeyLabel;
+    private javax.swing.JPanel infoTab;
+}
Index: trunk/src/org/openstreetmap/josm/gui/preferences/ShortcutPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/ShortcutPreference.java	(revision 2788)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/ShortcutPreference.java	(revision 2789)
@@ -30,5 +30,5 @@
                 tr("Changing keyboard shortcuts manually."), false);
 
-        prefJPanel prefpanel = new prefJPanel(new scListModel());
+        PrefJPanel prefpanel = new PrefJPanel(new scListModel());
         p.add(prefpanel, GBC.eol().fill(GBC.BOTH));
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/prefJPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/prefJPanel.java	(revision 2788)
+++ 	(revision )
@@ -1,555 +1,0 @@
-/*
- * prefJPanel.java
- *
- * Created on 28. September 2008, 17:47
- */
-
-package org.openstreetmap.josm.gui.preferences;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-import java.awt.event.KeyEvent;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-import javax.swing.JEditorPane;
-import javax.swing.JScrollPane;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.table.TableModel;
-
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.tools.Shortcut;
-
-/**
- * This is the keyboard preferences content.
- * If someone wants to merge it with ShortcutPreference.java, feel free.
- */
-public class prefJPanel extends javax.swing.JPanel {
-
-        // table of shortcuts
-        private TableModel model;
-        // comboboxes of modifier groups, mapping selectedIndex to real data
-        private static int[] modifInts = new int[]{
-            -1,
-            0,
-            KeyEvent.SHIFT_DOWN_MASK,
-            KeyEvent.CTRL_DOWN_MASK,
-            KeyEvent.ALT_DOWN_MASK,
-            KeyEvent.META_DOWN_MASK,
-            KeyEvent.CTRL_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK,
-            KeyEvent.ALT_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK,
-            KeyEvent.META_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK,
-            KeyEvent.CTRL_DOWN_MASK | KeyEvent.ALT_DOWN_MASK,
-            KeyEvent.CTRL_DOWN_MASK | KeyEvent.META_DOWN_MASK,
-            KeyEvent.ALT_DOWN_MASK | KeyEvent.META_DOWN_MASK,
-            KeyEvent.CTRL_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK | KeyEvent.ALT_DOWN_MASK,
-            KeyEvent.META_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK | KeyEvent.ALT_DOWN_MASK
-        };
-        // and here are the texts fro the comboboxes
-        private static String[] modifList = new String[] {
-            tr("disabled"),
-            tr("no modifier"),
-            KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[2]).getModifiers()),
-            KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[3]).getModifiers()),
-            KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[4]).getModifiers()),
-            KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[5]).getModifiers()),
-            KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[6]).getModifiers()),
-            KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[7]).getModifiers()),
-            KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[8]).getModifiers()),
-            KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[9]).getModifiers()),
-            KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[10]).getModifiers()),
-            KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[11]).getModifiers()),
-            KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[12]).getModifiers()),
-            KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, modifInts[13]).getModifiers())
-        };
-        // this are the display(!) texts for the checkboxes. Let the JVM do the i18n for us <g>.
-        // Ok, there's a real reason for this: The JVM should know best how the keys are labelled
-        // on the physical keyboard. What language pack is installed in JOSM is completely
-        // independent from the keyboard's labelling. But the operation system's locale
-        // usually matches the keyboard. This even works with my English Windows and my German
-        // keyboard.
-        private static String SHIFT = KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.SHIFT_DOWN_MASK).getModifiers());
-        private static String CTRL  = KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.CTRL_DOWN_MASK).getModifiers());
-        private static String ALT   = KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.ALT_DOWN_MASK).getModifiers());
-        private static String META  = KeyEvent.getKeyModifiersText(javax.swing.KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.META_DOWN_MASK).getModifiers());
-
-        // A list of keys to present the user. Sadly this really is a list of keys Java knows about,
-        // not a list of real physical keys. If someone knows how to get that list?
-        private static Map<Integer, String> keyList = setKeyList();
-
-        private static Map<Integer, String> setKeyList() {
-            Map<Integer, String> list = new LinkedHashMap<Integer, String>();
-            // I hate this, but I found no alternative...
-            for (int i = 0; i < 65534; i++) {
-                String s = KeyEvent.getKeyText(i);
-                if (s != null && s.length() > 0 && !s.contains("Unknown")) {
-                    list.put(Integer.valueOf(i), s);
-                    //System.out.println(i+": "+s);
-                }
-            }
-            list.put(Integer.valueOf(-1), "");
-            return list;
-        }
-
-    /** Creates new form prefJPanel */
-    // Ain't those auto-generated comments helpful or what? <g>
-    public prefJPanel(TableModel model) {
-        this.model = model;
-        initComponents();
-    }
-
-    private void initComponents() {
-
-        // Did I mention auto-generated? That's the reason we
-        // have lots of properties here and not some arrays...
-        prefTabPane = new javax.swing.JTabbedPane();
-        shortcutTab = new javax.swing.JPanel();
-        listPane = new javax.swing.JPanel();
-        listScrollPane = new javax.swing.JScrollPane();
-        shortcutTable = new javax.swing.JTable();
-        shortcutEditPane = new javax.swing.JPanel();
-        cbDefault = new javax.swing.JCheckBox();
-        jLabel4 = new javax.swing.JLabel();
-        cbShift = new javax.swing.JCheckBox();
-        cbDisable = new javax.swing.JCheckBox();
-        cbCtrl = new javax.swing.JCheckBox();
-        tfKeyLabel = new javax.swing.JLabel();
-        cbAlt = new javax.swing.JCheckBox();
-        tfKey = new javax.swing.JComboBox();
-        cbMeta = new javax.swing.JCheckBox();
-        jLabel6 = new javax.swing.JLabel();
-        modifierTab = new javax.swing.JPanel();
-        editGroupPane = new javax.swing.JPanel();
-        jLabel1 = new javax.swing.JLabel();
-        bxPrim1 = new javax.swing.JComboBox();
-        jLabel2 = new javax.swing.JLabel();
-        bxSec1 = new javax.swing.JComboBox();
-        jLabel3 = new javax.swing.JLabel();
-        bxTer1 = new javax.swing.JComboBox();
-        menuGroupPane = new javax.swing.JPanel();
-        jLabel7 = new javax.swing.JLabel();
-        bxPrim2 = new javax.swing.JComboBox();
-        jLabel8 = new javax.swing.JLabel();
-        bxSec2 = new javax.swing.JComboBox();
-        jLabel9 = new javax.swing.JLabel();
-        bxTer2 = new javax.swing.JComboBox();
-        hotkeyGroupPane = new javax.swing.JPanel();
-        jLabel10 = new javax.swing.JLabel();
-        bxPrim3 = new javax.swing.JComboBox();
-        jLabel11 = new javax.swing.JLabel();
-        bxSec3 = new javax.swing.JComboBox();
-        jLabel12 = new javax.swing.JLabel();
-        bxTer3 = new javax.swing.JComboBox();
-        subwindowGroupPane = new javax.swing.JPanel();
-        jLabel13 = new javax.swing.JLabel();
-        bxPrim4 = new javax.swing.JComboBox();
-        jLabel14 = new javax.swing.JLabel();
-        bxSec4 = new javax.swing.JComboBox();
-        jLabel15 = new javax.swing.JLabel();
-        bxTer4 = new javax.swing.JComboBox();
-        infoTab = new javax.swing.JPanel();
-        cbAction action = new cbAction(this);
-        bxAction action2 = new bxAction();
-
-        setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.Y_AXIS));
-
-                // If someone wants to move this text into some resource, feel free.
-                infoTab.setLayout(new javax.swing.BoxLayout(shortcutTab, javax.swing.BoxLayout.Y_AXIS));
-                JEditorPane editor = new JEditorPane();
-                editor.setEditable(false);
-                editor.setContentType("text/html");
-                editor.setText(
-                    tr("<h1><a name=\"top\">Keyboard Shortcuts</a></h1>")+
-                    tr("<p>Please note that shortcuts keys are assigned to the actions when JOSM is started. So you need to <b>restart</b> "
-                      +"JOSM to see your changes.</p>")+
-                    tr("<p>Furthermore, the shortcuts are activated when the actions are assigned to a menu entry of button for the first "
-                      +"time. So some of your changes may become active even without restart --- but also without collistion handling. "
-                      +"This is another reason to <b>restart</b> JOSM after making any changes here.</p>")+
-                    tr("<p>You may notice that the key selection list on the next page lists all keys that exist on all kinds of keyboards "
-                      +"Java knows about, not just those keys that exist on your keyboard. Please use only those values that correspond to "
-                      +"a real key on your keyboard. So if your keyboard has no 'Copy' key (PC keyboard don't have them, Sun keyboards do), "
-                      +"the do not use it. Also there will be 'keys' listed that correspond to a shortcut on your keyboard (e.g. ':'/Colon). "
-                      +"Please also do not use them, use the base key (';'/Semicolon on US keyboards, '.'/Period on German keyboards, ...) "
-                      +"instead. Not doing so may result in conflicts, as there is no way for JOSM to know that Ctrl+Shift+; and Ctrl+: "
-                      +"actually is the same thing on an US keyboard...</p>")+
-                    tr("<p>Thank you for your understanding</p>")+
-                    tr("<h1>Modifier Groups</h1>")+
-                    tr("<p>The last page lists the modifier keys JOSM will automatically assign to shortcuts. For every of the four kinds "
-                      +"of shortcuts there are three alternatives. JOSM will try those alternative in the listed order when managing a "
-                      +"conflict. If all alternatives would result in shortcuts that are already taken, it will assign a random shortcut "
-                      +"instead.</p>")+
-                    tr("<p>The pseudo-modifier 'disabled' will disable the shortcut when encountered.</p>")
-                );
-                editor.setCaretPosition(0); // scroll up
-                prefTabPane.addTab(tr("Read First"), new JScrollPane(editor));
-
-        shortcutTab.setLayout(new javax.swing.BoxLayout(shortcutTab, javax.swing.BoxLayout.Y_AXIS));
-
-        listPane.setLayout(new java.awt.GridLayout());
-
-        // This is the list of shortcuts:
-        shortcutTable.setModel(model);
-        shortcutTable.getSelectionModel().addListSelectionListener(new cbAction(this));
-        //shortcutTable.setFillsViewportHeight(true); Java 1.6
-        shortcutTable.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
-        listScrollPane.setViewportView(shortcutTable);
-
-        listPane.add(listScrollPane);
-
-        shortcutTab.add(listPane);
-
-        // and here follows the edit area. I won't object to someone re-designing it, it looks, um, "minimalistic" ;)
-        shortcutEditPane.setLayout(new java.awt.GridLayout(5, 2));
-
-        cbDefault.setAction(action);
-        cbDefault.setText(tr("Use default"));
-        shortcutEditPane.add(cbDefault);
-
-        shortcutEditPane.add(jLabel4);
-
-        cbShift.setAction(action);
-        cbShift.setText(SHIFT); // see above for why no tr()
-        shortcutEditPane.add(cbShift);
-
-        cbDisable.setAction(action);
-        cbDisable.setText(tr("Disable"));
-        shortcutEditPane.add(cbDisable);
-
-        cbCtrl.setAction(action);
-        cbCtrl.setText(CTRL); // see above for why no tr()
-        shortcutEditPane.add(cbCtrl);
-
-        tfKeyLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
-        tfKeyLabel.setText(tr("Key:"));
-        shortcutEditPane.add(tfKeyLabel);
-
-        cbAlt.setAction(action);
-        cbAlt.setText(ALT); // see above for why no tr()
-        shortcutEditPane.add(cbAlt);
-
-        tfKey.setAction(action);
-        tfKey.setModel(new javax.swing.DefaultComboBoxModel(keyList.values().toArray()));
-        shortcutEditPane.add(tfKey);
-
-        cbMeta.setAction(action);
-        cbMeta.setText(META); // see above for why no tr()
-        shortcutEditPane.add(cbMeta);
-
-        jLabel6.setText(tr("Attention: Use real keyboard keys only!"));
-        shortcutEditPane.add(jLabel6);
-
-        action.actionPerformed(null); // init checkboxes
-
-        shortcutTab.add(shortcutEditPane);
-
-        prefTabPane.addTab(tr("Keyboard Shortcuts"), shortcutTab);
-
-        // next is the modfier group tab.
-        // Would be a nice array if I had done it by hand. But then, it would be finished next year or so...
-        modifierTab.setLayout(new java.awt.GridLayout(0, 1));
-        JScrollPane modifierScroller = new JScrollPane(modifierTab);
-
-        editGroupPane.setBorder(javax.swing.BorderFactory.createTitledBorder(tr("Edit Shortcuts")));
-        editGroupPane.setLayout(new java.awt.GridLayout(3, 5));
-
-        jLabel1.setText(tr("Primary modifier:"));
-        editGroupPane.add(jLabel1);
-
-        bxPrim1.setModel(new javax.swing.DefaultComboBoxModel(modifList));
-        editGroupPane.add(bxPrim1);
-
-        jLabel2.setText(tr("Secondary modifier:"));
-        editGroupPane.add(jLabel2);
-
-        bxSec1.setModel(new javax.swing.DefaultComboBoxModel(modifList));
-        editGroupPane.add(bxSec1);
-
-        jLabel3.setText(tr("Tertiary modifier:"));
-        editGroupPane.add(jLabel3);
-
-        bxTer1.setModel(new javax.swing.DefaultComboBoxModel(modifList));
-        editGroupPane.add(bxTer1);
-
-        modifierTab.add(editGroupPane);
-
-        menuGroupPane.setBorder(javax.swing.BorderFactory.createTitledBorder(tr("Menu Shortcuts")));
-        menuGroupPane.setLayout(new java.awt.GridLayout(3, 5));
-
-        jLabel7.setText(tr("Primary modifier:"));
-        menuGroupPane.add(jLabel7);
-
-        bxPrim2.setModel(new javax.swing.DefaultComboBoxModel(modifList));
-        menuGroupPane.add(bxPrim2);
-
-        jLabel8.setText(tr("Secondary modifier:"));
-        menuGroupPane.add(jLabel8);
-
-        bxSec2.setModel(new javax.swing.DefaultComboBoxModel(modifList));
-        menuGroupPane.add(bxSec2);
-
-        jLabel9.setText(tr("Tertiary modifier:"));
-        menuGroupPane.add(jLabel9);
-
-        bxTer2.setModel(new javax.swing.DefaultComboBoxModel(modifList));
-        menuGroupPane.add(bxTer2);
-
-        modifierTab.add(menuGroupPane);
-
-        hotkeyGroupPane.setBorder(javax.swing.BorderFactory.createTitledBorder(tr("Hotkey Shortcuts")));
-        hotkeyGroupPane.setLayout(new java.awt.GridLayout(3, 5));
-
-        jLabel10.setText(tr("Primary modifier:"));
-        hotkeyGroupPane.add(jLabel10);
-
-        bxPrim3.setModel(new javax.swing.DefaultComboBoxModel(modifList));
-        hotkeyGroupPane.add(bxPrim3);
-
-        jLabel11.setText(tr("Secondary modifier:"));
-        hotkeyGroupPane.add(jLabel11);
-
-        bxSec3.setModel(new javax.swing.DefaultComboBoxModel(modifList));
-        hotkeyGroupPane.add(bxSec3);
-
-        jLabel12.setText(tr("Tertiary modifier:"));
-        hotkeyGroupPane.add(jLabel12);
-
-        bxTer3.setModel(new javax.swing.DefaultComboBoxModel(modifList));
-        hotkeyGroupPane.add(bxTer3);
-
-        modifierTab.add(hotkeyGroupPane);
-
-        subwindowGroupPane.setBorder(javax.swing.BorderFactory.createTitledBorder(tr("Subwindow Shortcuts")));
-        subwindowGroupPane.setLayout(new java.awt.GridLayout(3, 5));
-
-        jLabel13.setText(tr("Primary modifier:"));
-        subwindowGroupPane.add(jLabel13);
-
-        bxPrim4.setModel(new javax.swing.DefaultComboBoxModel(modifList));
-        subwindowGroupPane.add(bxPrim4);
-
-        jLabel14.setText(tr("Secondary modifier:"));
-        subwindowGroupPane.add(jLabel14);
-
-        bxSec4.setModel(new javax.swing.DefaultComboBoxModel(modifList));
-        subwindowGroupPane.add(bxSec4);
-
-        jLabel15.setText(tr("Tertiary modifier:"));
-        subwindowGroupPane.add(jLabel15);
-
-        bxTer4.setModel(new javax.swing.DefaultComboBoxModel(modifList));
-        subwindowGroupPane.add(bxTer4);
-
-                initbx();
-                bxPrim1.setAction(action2);
-                bxSec1.setAction(action2);
-                bxTer1.setAction(action2);
-                bxPrim2.setAction(action2);
-                bxSec2.setAction(action2);
-                bxTer2.setAction(action2);
-                bxPrim3.setAction(action2);
-                bxSec3.setAction(action2);
-                bxTer3.setAction(action2);
-                bxPrim4.setAction(action2);
-                bxSec4.setAction(action2);
-                bxTer4.setAction(action2);
-
-        modifierTab.add(subwindowGroupPane);
-
-        prefTabPane.addTab(tr("Modifier Groups"), modifierScroller);
-
-        add(prefTabPane);
-    }
-
-    // this allows to edit shortcuts. it:
-    //  * sets the edit controls to the selected shortcut
-    //  * enabled/disables the controls as needed
-    //  * writes the user's changes to the shortcut
-    // And after I finally had it working, I realized that those two methods
-    // are playing ping-pong (politically correct: table tennis, I know) and
-    // even have some duplicated code. Feel free to refactor, If you have
-    // more expirience with GUI coding than I have.
-    private class cbAction extends javax.swing.AbstractAction implements ListSelectionListener {
-        private prefJPanel panel;
-            public cbAction (prefJPanel panel) {
-                this.panel = panel;
-        }
-        public void valueChanged(ListSelectionEvent e) {
-            ListSelectionModel lsm = panel.shortcutTable.getSelectionModel(); // can't use e here
-            if (!lsm.isSelectionEmpty()) {
-                int row = lsm.getMinSelectionIndex();
-                Shortcut sc = (Shortcut)panel.model.getValueAt(row, -1);
-                panel.cbDefault.setSelected(!sc.getAssignedUser());
-                panel.cbDisable.setSelected(sc.getKeyStroke() == null);
-                panel.cbShift.setSelected(sc.getAssignedModifier() != -1 && (sc.getAssignedModifier() & KeyEvent.SHIFT_DOWN_MASK) != 0);
-                panel.cbCtrl.setSelected(sc.getAssignedModifier() != -1 && (sc.getAssignedModifier() & KeyEvent.CTRL_DOWN_MASK) != 0);
-                panel.cbAlt.setSelected(sc.getAssignedModifier() != -1 && (sc.getAssignedModifier() & KeyEvent.ALT_DOWN_MASK) != 0);
-                panel.cbMeta.setSelected(sc.getAssignedModifier() != -1 && (sc.getAssignedModifier() & KeyEvent.META_DOWN_MASK) != 0);
-                if (sc.getKeyStroke() != null) {
-                    tfKey.setSelectedItem(keyList.get(sc.getKeyStroke().getKeyCode()));
-                } else {
-                    tfKey.setSelectedItem(keyList.get(-1));
-                }
-                if (!sc.isChangeable()) {
-                    panel.cbDefault.setEnabled(false);
-                    panel.cbDisable.setEnabled(false);
-                    panel.cbShift.setEnabled(false);
-                    panel.cbCtrl.setEnabled(false);
-                    panel.cbAlt.setEnabled(false);
-                    panel.cbMeta.setEnabled(false);
-                    panel.tfKey.setEnabled(false);
-                } else {
-                    panel.cbDefault.setEnabled(true);
-                    actionPerformed(null);
-                }
-            } else {
-                panel.cbDefault.setEnabled(false);
-                panel.cbDisable.setEnabled(false);
-                panel.cbShift.setEnabled(false);
-                panel.cbCtrl.setEnabled(false);
-                panel.cbAlt.setEnabled(false);
-                panel.cbMeta.setEnabled(false);
-                panel.tfKey.setEnabled(false);
-            }
-        }
-        public void actionPerformed(java.awt.event.ActionEvent e) {
-            ListSelectionModel lsm = panel.shortcutTable.getSelectionModel();
-            if (lsm != null && !lsm.isSelectionEmpty()) {
-                if (e != null) { // only if we've been called by a user action
-                    int row = lsm.getMinSelectionIndex();
-                    Shortcut sc = (Shortcut)panel.model.getValueAt(row, -1);
-                    sc.setAssignedUser(!panel.cbDefault.isSelected());
-                    if (panel.cbDisable.isSelected()) {
-                        sc.setAssignedModifier(-1);
-                    } else if (panel.tfKey.getSelectedItem().equals("")) {
-                        sc.setAssignedModifier(KeyEvent.VK_CANCEL);
-                    } else {
-                        sc.setAssignedModifier(
-                            (panel.cbShift.isSelected() ? KeyEvent.SHIFT_DOWN_MASK : 0) |
-                            (panel.cbCtrl.isSelected() ? KeyEvent.CTRL_DOWN_MASK : 0) |
-                            (panel.cbAlt.isSelected() ? KeyEvent.ALT_DOWN_MASK : 0) |
-                            (panel.cbMeta.isSelected() ? KeyEvent.META_DOWN_MASK : 0)
-                        );
-                        for (Map.Entry<Integer, String> entry : keyList.entrySet()) {
-                            if (entry.getValue().equals(panel.tfKey.getSelectedItem())) {
-                                sc.setAssignedKey(entry.getKey());
-                            }
-                        }
-                    }
-                    valueChanged(null);
-                }
-                boolean state = !panel.cbDefault.isSelected();
-                panel.cbDisable.setEnabled(state);
-                state = state && !panel.cbDisable.isSelected();
-                panel.cbShift.setEnabled(state);
-                panel.cbCtrl.setEnabled(state);
-                panel.cbAlt.setEnabled(state);
-                panel.cbMeta.setEnabled(state);
-                panel.tfKey.setEnabled(state);
-            } else {
-                panel.cbDefault.setEnabled(false);
-                panel.cbDisable.setEnabled(false);
-                panel.cbShift.setEnabled(false);
-                panel.cbCtrl.setEnabled(false);
-                panel.cbAlt.setEnabled(false);
-                panel.cbMeta.setEnabled(false);
-                panel.tfKey.setEnabled(false);
-            }
-        }
-    }
-
-    // this handles the modifier groups
-    private class bxAction extends javax.swing.AbstractAction {
-        public void actionPerformed(java.awt.event.ActionEvent e) {
-            Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_DEFAULT+Shortcut.GROUP_EDIT),    Integer.toString( modifInts[bxPrim1.getSelectedIndex()] ));
-            Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_ALT1   +Shortcut.GROUP_EDIT),    Integer.toString( modifInts[ bxSec1.getSelectedIndex()] ));
-            Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_ALT2   +Shortcut.GROUP_EDIT),    Integer.toString( modifInts[ bxTer1.getSelectedIndex()] ));
-
-            Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_DEFAULT+Shortcut.GROUP_MENU),    Integer.toString( modifInts[bxPrim2.getSelectedIndex()] ));
-            Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_ALT1   +Shortcut.GROUP_MENU),    Integer.toString( modifInts[ bxSec2.getSelectedIndex()] ));
-            Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_ALT2   +Shortcut.GROUP_MENU),    Integer.toString( modifInts[ bxTer2.getSelectedIndex()] ));
-
-            Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_DEFAULT+Shortcut.GROUP_HOTKEY),  Integer.toString( modifInts[bxPrim3.getSelectedIndex()] ));
-            Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_ALT1   +Shortcut.GROUP_HOTKEY),  Integer.toString( modifInts[ bxSec3.getSelectedIndex()] ));
-            Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_ALT2   +Shortcut.GROUP_HOTKEY),  Integer.toString( modifInts[ bxTer3.getSelectedIndex()] ));
-
-            Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_DEFAULT+Shortcut.GROUP_LAYER),   Integer.toString( modifInts[bxPrim4.getSelectedIndex()] ));
-            Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_ALT1   +Shortcut.GROUP_LAYER),   Integer.toString( modifInts[ bxSec4.getSelectedIndex()] ));
-            Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_ALT2   +Shortcut.GROUP_LAYER),   Integer.toString( modifInts[ bxTer4.getSelectedIndex()] ));
-        }
-    }
-
-    private void initbx() {
-        setBx(bxPrim1, "shortcut.groups."+(Shortcut.GROUPS_DEFAULT+Shortcut.GROUP_EDIT));
-        setBx(bxSec1,  "shortcut.groups."+(Shortcut.GROUPS_ALT1   +Shortcut.GROUP_EDIT));
-        setBx(bxTer1,  "shortcut.groups."+(Shortcut.GROUPS_ALT2   +Shortcut.GROUP_EDIT));
-
-        setBx(bxPrim2, "shortcut.groups."+(Shortcut.GROUPS_DEFAULT+Shortcut.GROUP_MENU));
-        setBx(bxSec2,  "shortcut.groups."+(Shortcut.GROUPS_ALT1   +Shortcut.GROUP_MENU));
-        setBx(bxTer2,  "shortcut.groups."+(Shortcut.GROUPS_ALT2   +Shortcut.GROUP_MENU));
-
-        setBx(bxPrim3, "shortcut.groups."+(Shortcut.GROUPS_DEFAULT+Shortcut.GROUP_HOTKEY));
-        setBx(bxSec3,  "shortcut.groups."+(Shortcut.GROUPS_ALT1   +Shortcut.GROUP_HOTKEY));
-        setBx(bxTer3,  "shortcut.groups."+(Shortcut.GROUPS_ALT2   +Shortcut.GROUP_HOTKEY));
-
-        setBx(bxPrim4, "shortcut.groups."+(Shortcut.GROUPS_DEFAULT+Shortcut.GROUP_LAYER));
-        setBx(bxSec4,  "shortcut.groups."+(Shortcut.GROUPS_ALT1   +Shortcut.GROUP_LAYER));
-        setBx(bxTer4,  "shortcut.groups."+(Shortcut.GROUPS_ALT2   +Shortcut.GROUP_LAYER));
-    }
-    private void setBx(javax.swing.JComboBox bx, String key) {
-        int target = Main.pref.getInteger(key, -1);
-        for (int i = 0; i < modifInts.length; i++) {
-            if (modifInts[i] == target) {
-                bx.setSelectedIndex(i);
-            }
-        }
-    }
-
-    private javax.swing.JComboBox bxPrim1;
-    private javax.swing.JComboBox bxPrim2;
-    private javax.swing.JComboBox bxPrim3;
-    private javax.swing.JComboBox bxPrim4;
-    private javax.swing.JComboBox bxSec1;
-    private javax.swing.JComboBox bxSec2;
-    private javax.swing.JComboBox bxSec3;
-    private javax.swing.JComboBox bxSec4;
-    private javax.swing.JComboBox bxTer1;
-    private javax.swing.JComboBox bxTer2;
-    private javax.swing.JComboBox bxTer3;
-    private javax.swing.JComboBox bxTer4;
-    private javax.swing.JCheckBox cbAlt;
-    private javax.swing.JCheckBox cbCtrl;
-    private javax.swing.JCheckBox cbDefault;
-    private javax.swing.JCheckBox cbDisable;
-    private javax.swing.JCheckBox cbMeta;
-    private javax.swing.JCheckBox cbShift;
-    private javax.swing.JPanel editGroupPane;
-    private javax.swing.JPanel hotkeyGroupPane;
-    private javax.swing.JLabel jLabel1;
-    private javax.swing.JLabel jLabel10;
-    private javax.swing.JLabel jLabel11;
-    private javax.swing.JLabel jLabel12;
-    private javax.swing.JLabel jLabel13;
-    private javax.swing.JLabel jLabel14;
-    private javax.swing.JLabel jLabel15;
-    private javax.swing.JLabel jLabel2;
-    private javax.swing.JLabel jLabel3;
-    private javax.swing.JLabel jLabel4;
-    private javax.swing.JLabel jLabel6;
-    private javax.swing.JLabel jLabel7;
-    private javax.swing.JLabel jLabel8;
-    private javax.swing.JLabel jLabel9;
-    private javax.swing.JPanel listPane;
-    private javax.swing.JScrollPane listScrollPane;
-    private javax.swing.JPanel menuGroupPane;
-    private javax.swing.JPanel modifierTab;
-    private javax.swing.JTabbedPane prefTabPane;
-    private javax.swing.JPanel shortcutEditPane;
-    private javax.swing.JPanel shortcutTab;
-    private javax.swing.JTable shortcutTable;
-    private javax.swing.JPanel subwindowGroupPane;
-    private javax.swing.JComboBox tfKey;
-    private javax.swing.JLabel tfKeyLabel;
-    private javax.swing.JPanel infoTab;
-}
Index: trunk/src/org/openstreetmap/josm/io/ChangesetQuery.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/ChangesetQuery.java	(revision 2788)
+++ trunk/src/org/openstreetmap/josm/io/ChangesetQuery.java	(revision 2789)
@@ -334,6 +334,5 @@
                 value = value.substring(0,value.length() - 1) + "GMT+00:00";
             }
-            DateFormat formatter = new SimpleDateFormat("MM/dd/yy");
-            formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssz");
+            DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssz");
             try {
                 return formatter.parse(value);
Index: trunk/src/org/openstreetmap/josm/io/GpxReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/GpxReader.java	(revision 2788)
+++ trunk/src/org/openstreetmap/josm/io/GpxReader.java	(revision 2789)
@@ -41,5 +41,5 @@
      */
     public GpxData data;
-    public enum state { init, metadata, wpt, rte, trk, ext, author, link, trkseg, copyright}
+    public enum State { init, metadata, wpt, rte, trk, ext, author, link, trkseg, copyright}
 
     private class Parser extends DefaultHandler {
@@ -51,8 +51,8 @@
         private WayPoint currentWayPoint;
 
-        private state currentState = state.init;
+        private State currentState = State.init;
 
         private GpxLink currentLink;
-        private Stack<state> states;
+        private Stack<State> states;
 
         private StringBuffer accumulator = new StringBuffer();
@@ -62,5 +62,5 @@
         @Override public void startDocument() {
             accumulator = new StringBuffer();
-            states = new Stack<state>();
+            states = new Stack<State>();
             currentData = new GpxData();
         }
@@ -82,99 +82,99 @@
         @Override public void startElement(String namespaceURI, String qName, String rqName, Attributes atts) throws SAXException {
             switch(currentState) {
-                case init:
-                    if (qName.equals("metadata")) {
-                        states.push(currentState);
-                        currentState = state.metadata;
-                    } else if (qName.equals("wpt")) {
-                        states.push(currentState);
-                        currentState = state.wpt;
-                        currentWayPoint = new WayPoint(parseLatLon(atts));
-                    } else if (qName.equals("rte")) {
-                        states.push(currentState);
-                        currentState = state.rte;
-                        currentRoute = new GpxRoute();
-                    } else if (qName.equals("trk")) {
-                        states.push(currentState);
-                        currentState = state.trk;
-                        currentTrack = new GpxTrack();
-                    } else if (qName.equals("extensions")) {
-                        states.push(currentState);
-                        currentState = state.ext;
-                    } else if (qName.equals("gpx") && atts.getValue("creator") != null && atts.getValue("creator").startsWith("Nokia Sports Tracker")) {
-                        nokiaSportsTrackerBug = true;
-                    }
-                    break;
-                case author:
-                    if (qName.equals("link")) {
-                        states.push(currentState);
-                        currentState = state.link;
-                        currentLink = new GpxLink(atts.getValue("href"));
-                    } else if (qName.equals("email")) {
-                        currentData.attr.put(GpxData.META_AUTHOR_EMAIL, atts.getValue("id") + "@" + atts.getValue("domain"));
-                    }
-                    break;
-                case trk:
-                    if (qName.equals("trkseg")) {
-                        states.push(currentState);
-                        currentState = state.trkseg;
-                        currentTrackSeg = new ArrayList<WayPoint>();
-                    } else if (qName.equals("link")) {
-                        states.push(currentState);
-                        currentState = state.link;
-                        currentLink = new GpxLink(atts.getValue("href"));
-                    } else if (qName.equals("extensions")) {
-                        states.push(currentState);
-                        currentState = state.ext;
-                    }
-                    break;
-                case metadata:
-                    if (qName.equals("author")) {
-                        states.push(currentState);
-                        currentState = state.author;
-                    } else if (qName.equals("extensions")) {
-                        states.push(currentState);
-                        currentState = state.ext;
-                    } else if (qName.equals("copyright")) {
-                        states.push(currentState);
-                        currentState = state.copyright;
-                        currentData.attr.put(GpxData.META_COPYRIGHT_AUTHOR, atts.getValue("author"));
-                    } else if (qName.equals("link")) {
-                        states.push(currentState);
-                        currentState = state.link;
-                        currentLink = new GpxLink(atts.getValue("href"));
-                    }
-                    break;
-                case trkseg:
-                    if (qName.equals("trkpt")) {
-                        states.push(currentState);
-                        currentState = state.wpt;
-                        currentWayPoint = new WayPoint(parseLatLon(atts));
-                    }
-                    break;
-                case wpt:
-                    if (qName.equals("link")) {
-                        states.push(currentState);
-                        currentState = state.link;
-                        currentLink = new GpxLink(atts.getValue("href"));
-                    } else if (qName.equals("extensions")) {
-                        states.push(currentState);
-                        currentState = state.ext;
-                    }
-                    break;
-                case rte:
-                    if (qName.equals("link")) {
-                        states.push(currentState);
-                        currentState = state.link;
-                        currentLink = new GpxLink(atts.getValue("href"));
-                    } else if (qName.equals("rtept")) {
-                        states.push(currentState);
-                        currentState = state.wpt;
-                        currentWayPoint = new WayPoint(parseLatLon(atts));
-                    } else if (qName.equals("extensions")) {
-                        states.push(currentState);
-                        currentState = state.ext;
-                    }
-                    break;
-                default:
+            case init:
+                if (qName.equals("metadata")) {
+                    states.push(currentState);
+                    currentState = State.metadata;
+                } else if (qName.equals("wpt")) {
+                    states.push(currentState);
+                    currentState = State.wpt;
+                    currentWayPoint = new WayPoint(parseLatLon(atts));
+                } else if (qName.equals("rte")) {
+                    states.push(currentState);
+                    currentState = State.rte;
+                    currentRoute = new GpxRoute();
+                } else if (qName.equals("trk")) {
+                    states.push(currentState);
+                    currentState = State.trk;
+                    currentTrack = new GpxTrack();
+                } else if (qName.equals("extensions")) {
+                    states.push(currentState);
+                    currentState = State.ext;
+                } else if (qName.equals("gpx") && atts.getValue("creator") != null && atts.getValue("creator").startsWith("Nokia Sports Tracker")) {
+                    nokiaSportsTrackerBug = true;
+                }
+                break;
+            case author:
+                if (qName.equals("link")) {
+                    states.push(currentState);
+                    currentState = State.link;
+                    currentLink = new GpxLink(atts.getValue("href"));
+                } else if (qName.equals("email")) {
+                    currentData.attr.put(GpxData.META_AUTHOR_EMAIL, atts.getValue("id") + "@" + atts.getValue("domain"));
+                }
+                break;
+            case trk:
+                if (qName.equals("trkseg")) {
+                    states.push(currentState);
+                    currentState = State.trkseg;
+                    currentTrackSeg = new ArrayList<WayPoint>();
+                } else if (qName.equals("link")) {
+                    states.push(currentState);
+                    currentState = State.link;
+                    currentLink = new GpxLink(atts.getValue("href"));
+                } else if (qName.equals("extensions")) {
+                    states.push(currentState);
+                    currentState = State.ext;
+                }
+                break;
+            case metadata:
+                if (qName.equals("author")) {
+                    states.push(currentState);
+                    currentState = State.author;
+                } else if (qName.equals("extensions")) {
+                    states.push(currentState);
+                    currentState = State.ext;
+                } else if (qName.equals("copyright")) {
+                    states.push(currentState);
+                    currentState = State.copyright;
+                    currentData.attr.put(GpxData.META_COPYRIGHT_AUTHOR, atts.getValue("author"));
+                } else if (qName.equals("link")) {
+                    states.push(currentState);
+                    currentState = State.link;
+                    currentLink = new GpxLink(atts.getValue("href"));
+                }
+                break;
+            case trkseg:
+                if (qName.equals("trkpt")) {
+                    states.push(currentState);
+                    currentState = State.wpt;
+                    currentWayPoint = new WayPoint(parseLatLon(atts));
+                }
+                break;
+            case wpt:
+                if (qName.equals("link")) {
+                    states.push(currentState);
+                    currentState = State.link;
+                    currentLink = new GpxLink(atts.getValue("href"));
+                } else if (qName.equals("extensions")) {
+                    states.push(currentState);
+                    currentState = State.ext;
+                }
+                break;
+            case rte:
+                if (qName.equals("link")) {
+                    states.push(currentState);
+                    currentState = State.link;
+                    currentLink = new GpxLink(atts.getValue("href"));
+                } else if (qName.equals("rtept")) {
+                    states.push(currentState);
+                    currentState = State.wpt;
+                    currentWayPoint = new WayPoint(parseLatLon(atts));
+                } else if (qName.equals("extensions")) {
+                    states.push(currentState);
+                    currentState = State.ext;
+                }
+                break;
+            default:
             }
             accumulator.setLength(0);
@@ -201,127 +201,128 @@
         private Map<String, Object> getAttr() {
             switch (currentState) {
-                case rte: return currentRoute.attr;
-                case metadata: return currentData.attr;
-                case wpt: return currentWayPoint.attr;
-                case trk: return currentTrack.attr;
-                default: return null;
-            }
-        }
-
+            case rte: return currentRoute.attr;
+            case metadata: return currentData.attr;
+            case wpt: return currentWayPoint.attr;
+            case trk: return currentTrack.attr;
+            default: return null;
+            }
+        }
+
+        @SuppressWarnings("unchecked")
         @Override public void endElement(String namespaceURI, String qName, String rqName) {
             switch (currentState) {
-                case metadata:
-                    if (qName.equals("name")) {
-                        currentData.attr.put(GpxData.META_NAME, accumulator.toString());
-                    } else if (qName.equals("desc")) {
-                        currentData.attr.put(GpxData.META_DESC, accumulator.toString());
-                    } else if (qName.equals("time")) {
-                        currentData.attr.put(GpxData.META_TIME, accumulator.toString());
-                    } else if (qName.equals("keywords")) {
-                        currentData.attr.put(GpxData.META_KEYWORDS, accumulator.toString());
-                    } else if (qName.equals("metadata")) {
-                        currentState = states.pop();
+            case metadata:
+                if (qName.equals("name")) {
+                    currentData.attr.put(GpxData.META_NAME, accumulator.toString());
+                } else if (qName.equals("desc")) {
+                    currentData.attr.put(GpxData.META_DESC, accumulator.toString());
+                } else if (qName.equals("time")) {
+                    currentData.attr.put(GpxData.META_TIME, accumulator.toString());
+                } else if (qName.equals("keywords")) {
+                    currentData.attr.put(GpxData.META_KEYWORDS, accumulator.toString());
+                } else if (qName.equals("metadata")) {
+                    currentState = states.pop();
+                }
+                //TODO: parse bounds, extensions
+                break;
+            case author:
+                if (qName.equals("author")) {
+                    currentState = states.pop();
+                } else if (qName.equals("name")) {
+                    currentData.attr.put(GpxData.META_AUTHOR_NAME, accumulator.toString());
+                } else if (qName.equals("email")) {
+                    // do nothing, has been parsed on startElement
+                } else if (qName.equals("link")) {
+                    currentData.attr.put(GpxData.META_AUTHOR_LINK, currentLink);
+                }
+                break;
+            case copyright:
+                if (qName.equals("copyright")) {
+                    currentState = states.pop();
+                } else if (qName.equals("year")) {
+                    currentData.attr.put(GpxData.META_COPYRIGHT_YEAR, accumulator.toString());
+                } else if (qName.equals("license")) {
+                    currentData.attr.put(GpxData.META_COPYRIGHT_LICENSE, accumulator.toString());
+                }
+                break;
+            case link:
+                if (qName.equals("text")) {
+                    currentLink.text = accumulator.toString();
+                } else if (qName.equals("type")) {
+                    currentLink.type = accumulator.toString();
+                } else if (qName.equals("link")) {
+                    if (currentLink.uri == null && accumulator != null && accumulator.toString().length() != 0) {
+                        currentLink = new GpxLink(accumulator.toString());
                     }
-                    //TODO: parse bounds, extensions
-                    break;
-                case author:
-                    if (qName.equals("author")) {
-                        currentState = states.pop();
-                    } else if (qName.equals("name")) {
-                        currentData.attr.put(GpxData.META_AUTHOR_NAME, accumulator.toString());
-                    } else if (qName.equals("email")) {
-                        // do nothing, has been parsed on startElement
-                    } else if (qName.equals("link")) {
-                        currentData.attr.put(GpxData.META_AUTHOR_LINK, currentLink);
+                    currentState = states.pop();
+                }
+                if (currentState == State.author) {
+                    currentData.attr.put(GpxData.META_AUTHOR_LINK, currentLink);
+                } else if (currentState != State.link) {
+                    Map<String, Object> attr = getAttr();
+                    if (!attr.containsKey(GpxData.META_LINKS)) {
+                        attr.put(GpxData.META_LINKS, new LinkedList<GpxLink>());
                     }
-                    break;
-                case copyright:
-                    if (qName.equals("copyright")) {
-                        currentState = states.pop();
-                    } else if (qName.equals("year")) {
-                        currentData.attr.put(GpxData.META_COPYRIGHT_YEAR, accumulator.toString());
-                    } else if (qName.equals("license")) {
-                        currentData.attr.put(GpxData.META_COPYRIGHT_LICENSE, accumulator.toString());
+                    ((Collection<GpxLink>) attr.get(GpxData.META_LINKS)).add(currentLink);
+                }
+                break;
+            case wpt:
+                if (   qName.equals("ele")  || qName.equals("magvar")
+                        || qName.equals("name") || qName.equals("geoidheight")
+                        || qName.equals("type") || qName.equals("sym")) {
+                    currentWayPoint.attr.put(qName, accumulator.toString());
+                } else if(qName.equals("hdop") /*|| qName.equals("vdop") ||
+                        qName.equals("pdop")*/) {
+                    try {
+                        currentWayPoint.attr.put(qName, Float.parseFloat(accumulator.toString()));
+                    } catch(Exception e) {
+                        currentWayPoint.attr.put(qName, new Float(0));
                     }
-                    break;
-                case link:
-                    if (qName.equals("text")) {
-                        currentLink.text = accumulator.toString();
-                    } else if (qName.equals("type")) {
-                        currentLink.type = accumulator.toString();
-                    } else if (qName.equals("link")) {
-                        if (currentLink.uri == null && accumulator != null && accumulator.toString().length() != 0) {
-                            currentLink = new GpxLink(accumulator.toString());
-                        }
-                        currentState = states.pop();
-                    }
-                    if (currentState == state.author) {
-                        currentData.attr.put(GpxData.META_AUTHOR_LINK, currentLink);
-                    } else if (currentState != state.link) {
-                        Map<String, Object> attr = getAttr();
-                        if (!attr.containsKey(GpxData.META_LINKS)) {
-                            attr.put(GpxData.META_LINKS, new LinkedList<GpxLink>());
-                        }
-                        ((Collection<GpxLink>) attr.get(GpxData.META_LINKS)).add(currentLink);
-                    }
-                    break;
-                case wpt:
-                    if (   qName.equals("ele")  || qName.equals("magvar")
-                            || qName.equals("name") || qName.equals("geoidheight")
-                            || qName.equals("type") || qName.equals("sym")) {
-                        currentWayPoint.attr.put(qName, accumulator.toString());
-                    } else if(qName.equals("hdop") /*|| qName.equals("vdop") ||
-                        qName.equals("pdop")*/) {
-                        try {
-                            currentWayPoint.attr.put(qName, Float.parseFloat(accumulator.toString()));
-                        } catch(Exception e) {
-                            currentWayPoint.attr.put(qName, new Float(0));
-                        }
-                    } else if (qName.equals("time")) {
-                        currentWayPoint.attr.put(qName, accumulator.toString());
-                        currentWayPoint.setTime();
-                    } else if (qName.equals("cmt") || qName.equals("desc")) {
-                        currentWayPoint.attr.put(qName, accumulator.toString());
-                        currentWayPoint.setTime();
-                    } else if (qName.equals("rtept")) {
-                        currentState = states.pop();
-                        currentRoute.routePoints.add(currentWayPoint);
-                    } else if (qName.equals("trkpt")) {
-                        currentState = states.pop();
-                        currentTrackSeg.add(currentWayPoint);
-                    } else if (qName.equals("wpt")) {
-                        currentState = states.pop();
-                        currentData.waypoints.add(currentWayPoint);
-                    }
-                    break;
-                case trkseg:
-                    if (qName.equals("trkseg")) {
-                        currentState = states.pop();
-                        currentTrack.trackSegs.add(currentTrackSeg);
-                    }
-                    break;
-                case trk:
-                    if (qName.equals("trk")) {
-                        currentState = states.pop();
-                        currentData.tracks.add(currentTrack);
-                    } else if (qName.equals("name") || qName.equals("cmt")
-                            || qName.equals("desc") || qName.equals("src")
-                            || qName.equals("type") || qName.equals("number")
-                            || qName.equals("url")) {
-                        currentTrack.attr.put(qName, accumulator.toString());
-                    }
-                    break;
-                case ext:
-                    if (qName.equals("extensions")) {
-                        currentState = states.pop();
-                    }
-                    break;
-                default:
-                    if (qName.equals("wpt")) {
-                        currentState = states.pop();
-                    } else if (qName.equals("rte")) {
-                        currentState = states.pop();
-                        currentData.routes.add(currentRoute);
-                    }
+                } else if (qName.equals("time")) {
+                    currentWayPoint.attr.put(qName, accumulator.toString());
+                    currentWayPoint.setTime();
+                } else if (qName.equals("cmt") || qName.equals("desc")) {
+                    currentWayPoint.attr.put(qName, accumulator.toString());
+                    currentWayPoint.setTime();
+                } else if (qName.equals("rtept")) {
+                    currentState = states.pop();
+                    currentRoute.routePoints.add(currentWayPoint);
+                } else if (qName.equals("trkpt")) {
+                    currentState = states.pop();
+                    currentTrackSeg.add(currentWayPoint);
+                } else if (qName.equals("wpt")) {
+                    currentState = states.pop();
+                    currentData.waypoints.add(currentWayPoint);
+                }
+                break;
+            case trkseg:
+                if (qName.equals("trkseg")) {
+                    currentState = states.pop();
+                    currentTrack.trackSegs.add(currentTrackSeg);
+                }
+                break;
+            case trk:
+                if (qName.equals("trk")) {
+                    currentState = states.pop();
+                    currentData.tracks.add(currentTrack);
+                } else if (qName.equals("name") || qName.equals("cmt")
+                        || qName.equals("desc") || qName.equals("src")
+                        || qName.equals("type") || qName.equals("number")
+                        || qName.equals("url")) {
+                    currentTrack.attr.put(qName, accumulator.toString());
+                }
+                break;
+            case ext:
+                if (qName.equals("extensions")) {
+                    currentState = states.pop();
+                }
+                break;
+            default:
+                if (qName.equals("wpt")) {
+                    currentState = states.pop();
+                } else if (qName.equals("rte")) {
+                    currentState = states.pop();
+                    currentData.routes.add(currentRoute);
+                }
             }
         }
Index: trunk/src/org/openstreetmap/josm/tools/WindowGeometry.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/WindowGeometry.java	(revision 2788)
+++ trunk/src/org/openstreetmap/josm/tools/WindowGeometry.java	(revision 2789)
@@ -49,5 +49,5 @@
             reference = reference.getParent();
         }
-        if (reference == null || ! (reference instanceof Window))
+        if (reference == null)
             return new WindowGeometry(new Point(0,0), extent);
         parentWindow = (Window)reference;
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryNodeTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryNodeTest.java	(revision 2788)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryNodeTest.java	(revision 2789)
@@ -14,5 +14,5 @@
 
     @Test
-    public void HistoryNode() {
+    public void historyNode() {
         Date d = new Date();
         HistoryNode node = new HistoryNode(
