Index: trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java	(revision 4000)
+++ trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java	(revision 4001)
@@ -89,4 +89,5 @@
         if (event.getID() != KeyEvent.KEY_PRESSED) return;
         if (layer == null) return;
+        if (offsetDialog != null && offsetDialog.areFieldsInFocus()) return;
         KeyEvent kev = (KeyEvent)event;
         double dx = 0, dy = 0;
@@ -148,6 +149,5 @@
 
     class ImageryOffsetDialog extends ExtendedDialog implements FocusListener {
-        public final JTextField easting = new JTextField();
-        public final JTextField northing = new JTextField();
+        public final JTextField tOffset = new JTextField();
         JTextField tBookmarkName = new JTextField();
         private boolean ignoreListener;
@@ -163,20 +163,19 @@
                     "You can also enter east and north offset in the {0} coordinates.\n" +
                     "If you want to save the offset as bookmark, enter the bookmark name below",Main.proj.toString())), GBC.eop());
-            pnl.add(new JLabel(tr("Easting") + ": "),GBC.std());
-            pnl.add(easting,GBC.std().fill(GBC.HORIZONTAL).insets(0, 0, 5, 0));
-            pnl.add(new JLabel(tr("Northing") + ": "),GBC.std());
-            pnl.add(northing,GBC.eol().fill(GBC.HORIZONTAL));
-            pnl.add(new JLabel(tr("Bookmark name: ")),GBC.eol().insets(0,5,0,0));
+            pnl.add(new JLabel(tr("Offset: ")),GBC.std());
+            pnl.add(tOffset,GBC.eol().fill(GBC.HORIZONTAL).insets(0,0,0,5));
+            pnl.add(new JLabel(tr("Bookmark name: ")),GBC.std());
             pnl.add(tBookmarkName,GBC.eol().fill(GBC.HORIZONTAL));
-            easting.setColumns(8);
-            northing.setColumns(8);
-            easting.setText(String.valueOf(layer.getDx()));
-            northing.setText(String.valueOf(layer.getDy()));
-            easting.addFocusListener(this);
-            northing.addFocusListener(this);
+            tOffset.setColumns(16);
+            updateOffsetIntl();
+            tOffset.addFocusListener(this);
             setContent(pnl);
             setupDialog();
         }
 
+        public boolean areFieldsInFocus() {
+            return tOffset.hasFocus();
+        }
+
         @Override
         public void focusGained(FocusEvent e) {
@@ -186,17 +185,19 @@
         public void focusLost(FocusEvent e) {
             if (ignoreListener) return;
-            double dx = oldDx;
-            try {
-                dx = Double.parseDouble(easting.getText());
-            } catch (NumberFormatException nfe) {
-                easting.setText(String.valueOf(oldDx));
-            }
-            double dy = oldDy;
-            try {
-                dy = Double.parseDouble(northing.getText());
-            } catch (NumberFormatException nfe) {
-                northing.setText(String.valueOf(oldDy));
-            }
-            layer.setOffset(dx, dy);
+            String ostr = tOffset.getText();
+            int semicolon = ostr.indexOf(';');
+            if( semicolon >= 0 && semicolon + 1 < ostr.length() ) {
+                try {
+                    // here we assume that Double.parseDouble() needs '.' as a decimal separator
+                    String easting = ostr.substring(0, semicolon).trim().replace(',', '.');
+                    String northing = ostr.substring(semicolon + 1).trim().replace(',', '.');
+                    double dx = Double.parseDouble(easting);
+                    double dy = Double.parseDouble(northing);
+                    layer.setOffset(dx, dy);
+                } catch (NumberFormatException nfe) {
+                    // we repaint offset numbers in any case
+                }
+            }
+            updateOffsetIntl();
             Main.map.repaint();
         }
@@ -204,7 +205,15 @@
         public void updateOffset() {
             ignoreListener = true;
-            easting.setText(String.valueOf(layer.getDx()));
-            northing.setText(String.valueOf(layer.getDy()));
+            updateOffsetIntl();
             ignoreListener = false;
+        }
+
+        public void updateOffsetIntl() {
+            // Support projections with very small numbers (e.g. 4326)
+            int precision = Main.proj.getDefaultZoomInPPD() >= 1.0 ? 2 : 7;
+            // US locale to force decimal separator to be '.'
+            tOffset.setText(new java.util.Formatter(java.util.Locale.US).format(
+                    "%1." + precision + "f; %1." + precision + "f",
+                    layer.getDx(), layer.getDy()).toString());
         }
 
