Index: /applications/editors/josm/plugins/Create_grid_of_ways/build.xml
===================================================================
--- /applications/editors/josm/plugins/Create_grid_of_ways/build.xml	(revision 16289)
+++ /applications/editors/josm/plugins/Create_grid_of_ways/build.xml	(revision 16290)
@@ -26,5 +26,5 @@
                 <attribute name="Plugin-Description" value="Create a grid of ways."/>
                 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/Create_grid_of_ways"/>
-                <attribute name="Plugin-Mainversion" value="1208"/>
+                <attribute name="Plugin-Mainversion" value="1722"/>
                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
             </manifest>
Index: /applications/editors/josm/plugins/Create_grid_of_ways/src/CreateGridOfWaysPlugin/CreateGridOfWaysAction.java
===================================================================
--- /applications/editors/josm/plugins/Create_grid_of_ways/src/CreateGridOfWaysPlugin/CreateGridOfWaysAction.java	(revision 16289)
+++ /applications/editors/josm/plugins/Create_grid_of_ways/src/CreateGridOfWaysPlugin/CreateGridOfWaysAction.java	(revision 16290)
@@ -75,6 +75,6 @@
         double latDif,lonDif;
         for (Node n1 : nodesWay1) {
-            latDif = n1.coor.lat()-nodeCommon.coor.lat();
-            lonDif = n1.coor.lon()-nodeCommon.coor.lon();
+            latDif = n1.getCoor().lat()-nodeCommon.getCoor().lat();
+            lonDif = n1.getCoor().lon()-nodeCommon.getCoor().lon();
             c2=0;
             for (Node n2 : nodesWay2) {
@@ -89,5 +89,5 @@
                     continue;
                 }
-                Node nodeOfGrid = new Node(new LatLon(n2.coor.lat()+latDif,n2.coor.lon()+lonDif));
+                Node nodeOfGrid = new Node(new LatLon(n2.getCoor().lat()+latDif,n2.getCoor().lon()+lonDif));
                 cmds.add(new AddCommand(nodeOfGrid));
                 w1[c1].nodes.add(nodeOfGrid);
Index: /applications/editors/josm/plugins/agpifoj/build.xml
===================================================================
--- /applications/editors/josm/plugins/agpifoj/build.xml	(revision 16289)
+++ /applications/editors/josm/plugins/agpifoj/build.xml	(revision 16290)
@@ -34,5 +34,5 @@
                 <attribute name="Plugin-Early" value="false"/>
                 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/AgPifoJ"/>
-                <attribute name="Plugin-Mainversion" value="1465"/>
+                <attribute name="Plugin-Mainversion" value="1722"/>
                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
             </manifest>
Index: /applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojDialog.java
===================================================================
--- /applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojDialog.java	(revision 16289)
+++ /applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojDialog.java	(revision 16290)
@@ -124,5 +124,5 @@
             centerView = ((JToggleButton) e.getSource()).isSelected();
             if (centerView && currentEntry != null && currentEntry.pos != null) {
-                Main.map.mapView.zoomTo(currentEntry.pos, Main.map.mapView.getScale());
+                Main.map.mapView.zoomTo(currentEntry.pos);
             }
 
@@ -153,5 +153,5 @@
 
             if (centerView && Main.map != null && entry != null && entry.pos != null) {
-                Main.map.mapView.zoomTo(entry.pos, Main.map.mapView.getScale());
+                Main.map.mapView.zoomTo(entry.pos);
             }
 
Index: /applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/CorrelateGpxWithImages.java
===================================================================
--- /applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/CorrelateGpxWithImages.java	(revision 16289)
+++ /applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/CorrelateGpxWithImages.java	(revision 16290)
@@ -623,5 +623,5 @@
                 BoundingXYVisitor bbox = new BoundingXYVisitor();
                 l.visitBoundingBox(bbox);
-                if (bbox.min != null && bbox.max != null) {
+                if (bbox.getBounds() != null) {
                     boundingBoxedLayerFound = true;
                     break;
Index: /applications/editors/josm/plugins/czechaddress/build.xml
===================================================================
--- /applications/editors/josm/plugins/czechaddress/build.xml	(revision 16289)
+++ /applications/editors/josm/plugins/czechaddress/build.xml	(revision 16290)
@@ -51,5 +51,5 @@
             <attribute name="Plugin-Description" value="Creating and handling address nodes and buildings within Czech Republic."/>
             <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/Cz:JOSM/Plugins/CzechAddress"/>
-            <attribute name="Plugin-Mainversion" value="1607"/>
+            <attribute name="Plugin-Mainversion" value="1722"/>
             <!--<attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>-->
             <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
Index: /applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/MapUtils.java
===================================================================
--- /applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/MapUtils.java	(revision 16289)
+++ /applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/MapUtils.java	(revision 16290)
@@ -3,9 +3,6 @@
 import java.util.Collection;
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.actions.AutoScaleAction;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
-import org.openstreetmap.josm.data.osm.Way;
-import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
-import org.openstreetmap.josm.gui.MapView;
 
 /**
@@ -21,64 +18,17 @@
 
     /**
-     * Zoom level used for zooming to a single node.
-     */
-    public static final double NODE_ZOOM_LEVEL = 0.00000007;
-
-
-    /**
      * Selects and zooms the JOSM viewport to given primitives.
-     *
-     * <p>It does so by calculating the center of given primitives and
-     * then it zooms to it.</p>
-     *
-     * <p><b>WARNING and TODO:</b> The method {@code zoomTo()} currently
-     * checks for damaged {@link Node}s, whose {@code eastNorth} is set to
-     * null. This property is not accessed in this method and therefore
-     * no checking is done. However the "mad GUI" problem may still arise.
-     * Therefore please be careful.</p>
-     *
-     * @see BoundingXYVisitor
-     * @see MapView
      */
     public static void zoomToMany(Collection<OsmPrimitive> primitives) {
-        BoundingXYVisitor visitor = new BoundingXYVisitor();
-        for (OsmPrimitive op : primitives) {
-            if (op instanceof Node)
-                ((Node) op).visit(visitor);
-
-            else if (op instanceof Way)
-                ((Way) op).visit(visitor);
-        }
-        Main.map.mapView.zoomTo(
-                visitor.min.interpolate(visitor.max, 0.5),
-                NODE_ZOOM_LEVEL);
         Main.ds.setSelected(primitives);
+        (new AutoScaleAction("selection")).actionPerformed(null);
     }
 
     /**
      * Selects and zooms the JOSM viewport to given primitive.
-     *
-     * <p><b>TODO:</b> There is an error in JOSM, which makes the whole
-     * GUI totally mad if we zoom to a {@link Node}, whose {@code eastNorth}
-     * is set null. Currently zooming to such a node is ignored, but the
-     * question is where so such damaged nodes come from?</p>
-     *
-     * @see BoundingXYVisitor
-     * @see MapView
      */
     public static void zoomTo(OsmPrimitive primitive) {
-        BoundingXYVisitor visitor = new BoundingXYVisitor();
-
-        if (primitive instanceof Node && ((Node) primitive).eastNorth != null)
-            Main.map.mapView.zoomTo(((Node) primitive).eastNorth, NODE_ZOOM_LEVEL);
-
-        else if (primitive instanceof Way) {
-            ((Way) primitive).visit(visitor);
-            Main.map.mapView.zoomTo(
-                    visitor.min.interpolate(visitor.max, 0.5),
-                    NODE_ZOOM_LEVEL);
-        }
-
         Main.ds.setSelected(primitive);
+        (new AutoScaleAction("selection")).actionPerformed(null);
     }
 }
Index: /applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/AddressElement.java
===================================================================
--- /applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/AddressElement.java	(revision 16289)
+++ /applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/AddressElement.java	(revision 16290)
@@ -97,7 +97,7 @@
 
         if (prim instanceof Node)
-            result += " " + StringUtils.latLonToString(((Node) prim).coor);
+            result += " " + StringUtils.latLonToString(((Node) prim).getCoor());
         else if (prim instanceof Way)
-            result += " " + StringUtils.latLonToString(((Way) prim).firstNode().coor);
+            result += " " + StringUtils.latLonToString(((Way) prim).firstNode().getCoor());
 
         return result;
Index: /applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/LocationSelector.java
===================================================================
--- /applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/LocationSelector.java	(revision 16289)
+++ /applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/LocationSelector.java	(revision 16290)
@@ -40,5 +40,5 @@
         LocationSelector ls = new LocationSelector();
         ls.setVisible(true);
-        
+
         if (ls.getValue() == 1)
             return ls.selectedElement;
@@ -50,5 +50,5 @@
         super(Main.parent, "Výběr umístění",
                             new String[] { "OK", "Zrušit"}, true);
-        
+
         initComponents();
         setupDialog(mainPanel, new String[] { "ok.png", "cancel.png"});
@@ -68,5 +68,5 @@
      * Hardly ever working method for autodetecting the current location.
      *
-     * @deprecated 
+     * @deprecated
      */
     private void autodetectLocation() {
@@ -93,11 +93,5 @@
 
         try {
-            Bounds bounds = visitor.getBounds();
-            LatLon max = bounds.max;
-            LatLon min = bounds.min;
-            center = new LatLon(
-                    (max.getX() + min.getX()) / 2,
-                    (max.getY() + min.getY()) / 2);
-
+            center = Main.proj.eastNorth2latlon(visitor.getBounds().getCenter());
         } catch (Exception e) {
             System.err.println("AUTO: No bounds to determine autolocation.");
@@ -128,5 +122,5 @@
             }
 
-            double currLen = multiplicator * (node.coor.distance(center));
+            double currLen = multiplicator * (node.getCoor().distance(center));
 
 
@@ -138,9 +132,9 @@
 
         if (bestFit != null) {
-            
+
             if (assertions)
                 System.out.println("AUTO: Best fit " + bestFit.getName()
                                  + "\t " + bestFit.get("name"));
-            
+
             for (Region oblast : Database.getInstance().regions) {
                 for (ViToCi obec : oblast.getViToCis()) {
@@ -263,5 +257,5 @@
         ItemEvent event = new ItemEvent(this,
                    ItemEvent.DESELECTED, selectedElement, ItemEvent.DESELECTED);
-        
+
         for (ItemListener i : listeners)
             i.itemStateChanged(event);
@@ -271,5 +265,5 @@
         event = new ItemEvent(this,
                        ItemEvent.SELECTED, selectedElement, ItemEvent.SELECTED);
-        
+
         for (ItemListener i : listeners)
                 i.itemStateChanged(event);
@@ -323,5 +317,5 @@
         else if (oblastComboBox.getSelectedItem() != null)
             selectedElement = ((ElementWithStreets) oblastComboBox.getSelectedItem());
-        
+
         }//GEN-LAST:event_suburbComboBoxItemStateChanged
 
Index: /applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/proposal/ExtractAddressIntoNodeProposal.java
===================================================================
--- /applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/proposal/ExtractAddressIntoNodeProposal.java	(revision 16289)
+++ /applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/proposal/ExtractAddressIntoNodeProposal.java	(revision 16290)
@@ -51,15 +51,11 @@
         if (!isApplicable(primitive))
             return;
-        
+
         Way way = (Way) primitive;
 
         BoundingXYVisitor visitor = new BoundingXYVisitor();
         way.visit(visitor);
-        LatLon center = new LatLon(
-                (visitor.getBounds().max.lat() + visitor.getBounds().min.lat())/2,
-                (visitor.getBounds().max.lon() + visitor.getBounds().min.lon())/2
-            );
-        
-        Node addrNode = new Node(center);
+
+        Node addrNode = new Node(visitor.getBounds().getCenter());
 
         for (String key : way.keySet())
@@ -75,5 +71,5 @@
     /**
      * Returns textual representation of this proposal.
-     * 
+     *
      * Currently the string is in Czech language (see {@link CzechAddressPlugin}).
      */
@@ -83,5 +79,5 @@
     }
 
-    
+
 
 }
Index: /applications/editors/josm/plugins/editgpx/build.xml
===================================================================
--- /applications/editors/josm/plugins/editgpx/build.xml	(revision 16289)
+++ /applications/editors/josm/plugins/editgpx/build.xml	(revision 16290)
@@ -26,5 +26,5 @@
                 <attribute name="Plugin-Description" value="Allows the user to anonymize timestamps and delete parts of huge GPX tracks very fast." />
                 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/EditGpx" />
-                <attribute name="Plugin-Mainversion" value="1500" />
+                <attribute name="Plugin-Mainversion" value="1722" />
                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
             </manifest>
Index: /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxLayer.java
===================================================================
--- /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxLayer.java	(revision 16289)
+++ /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxLayer.java	(revision 16290)
@@ -113,6 +113,5 @@
             for(Node n: dataSet.nodes) {
                 if (!n.deleted) {
-                    LatLon c = n.coor;
-                    Point pnt = Main.map.mapView.getPoint(Main.proj.latlon2eastNorth(c));
+                    Point pnt = Main.map.mapView.getPoint(n.getEastNorth());
                     g.drawOval(pnt.x - 2, pnt.y - 2, 4, 4);
                 }
@@ -166,5 +165,5 @@
                 doneNodes.add(n);
 
-                WayPoint wpt = new WayPoint(n.coor);
+                WayPoint wpt = new WayPoint(n.getCoor());
                 if (anonTime) {
                     wpt.attr.put("time", "1970-01-01T00:00:00");
@@ -184,5 +183,5 @@
             Date tstamp = n.getTimestamp();
 
-            WayPoint wpt = new WayPoint(n.coor);
+            WayPoint wpt = new WayPoint(n.getCoor());
             if (anonTime) {
                 wpt.attr.put("time", "1970-01-01T00:00:00");
Index: /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxMode.java
===================================================================
--- /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxMode.java	(revision 16289)
+++ /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxMode.java	(revision 16290)
@@ -64,19 +64,9 @@
             Point pointReleased = e.getPoint();
 
-            //prepare vars
-            EastNorth en;
-            double scale = Main.map.mapView.getScale();
-            EastNorth center = Main.map.mapView.getCenter(); //Center n/e coordinate of the desired screen center.
-            int width = Main.map.mapView.getWidth();
-            int height = Main.map.mapView.getHeight();
             Rectangle r = createRect(pointReleased, pointPressed);
 
             //go through nodes and mark the ones in the selection rect as deleted
             for (Node n: dataSet.nodes) {
-                en = n.eastNorth;
-                //calculate point on screen from node n
-                double x = (en.east()-center.east())/scale + width/2;
-                double y = (center.north()-en.north())/scale + height/2;
-                Point p = new Point((int)x,(int)y);
+                Point p = Main.map.mapView.getPoint(n.getEastNorth());
                 if (r.contains(p)) {
                     n.deleted = true; //only set as deleted. this makes reset to beginning possible
Index: /applications/editors/josm/plugins/livegps/build.xml
===================================================================
--- /applications/editors/josm/plugins/livegps/build.xml	(revision 16289)
+++ /applications/editors/josm/plugins/livegps/build.xml	(revision 16290)
@@ -26,5 +26,5 @@
                 <attribute name="Plugin-Description" value="Support live GPS input (moving dot) through a connection to gpsd server."/>
                 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/LiveGPS"/>
-                <attribute name="Plugin-Mainversion" value="1498"/>
+                <attribute name="Plugin-Mainversion" value="1722"/>
                 <attribute name="Plugin-Stage" value="50"/>
                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
Index: /applications/editors/josm/plugins/livegps/src/livegps/LiveGpsLayer.java
===================================================================
--- /applications/editors/josm/plugins/livegps/src/livegps/LiveGpsLayer.java	(revision 16289)
+++ /applications/editors/josm/plugins/livegps/src/livegps/LiveGpsLayer.java	(revision 16290)
@@ -74,5 +74,5 @@
     {
         if (lastPoint != null)
-            Main.map.mapView.zoomTo(lastPoint.eastNorth, Main.map.mapView.getScale());
+            Main.map.mapView.zoomTo(lastPoint.eastNorth);
     }
 
Index: /applications/editors/josm/plugins/openstreetbugs/build.xml
===================================================================
--- /applications/editors/josm/plugins/openstreetbugs/build.xml	(revision 16289)
+++ /applications/editors/josm/plugins/openstreetbugs/build.xml	(revision 16290)
@@ -26,5 +26,5 @@
                 <attribute name="Plugin-Description" value="Imports issues from OpenStreetBugs"/>
                 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/OpenStreetBugs"/>
-                <attribute name="Plugin-Mainversion" value="1638"/>
+                <attribute name="Plugin-Mainversion" value="1722"/>
                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
             </manifest>
Index: /applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/DownloadAction.java
===================================================================
--- /applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/DownloadAction.java	(revision 16289)
+++ /applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/DownloadAction.java	(revision 16290)
@@ -37,4 +37,5 @@
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.tools.OsmUrlToBounds;
 import org.openstreetmap.josm.plugins.osb.ConfigKeys;
 import org.openstreetmap.josm.plugins.osb.api.util.HttpUtils;
@@ -48,6 +49,7 @@
         String uri = Main.pref.get(ConfigKeys.OSB_API_URI_DOWNLOAD);
 
+        int zoom = OsmUrlToBounds.getZoom(Main.map.mapView.getRealBounds());
         // check zoom level
-        if(Main.map.mapView.zoom() > 15 || Main.map.mapView.zoom() < 9) {
+        if(zoom > 15 || zoom < 9) {
             return;
         }
Index: /applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/OsbDialog.java
===================================================================
--- /applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/OsbDialog.java	(revision 16289)
+++ /applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/OsbDialog.java	(revision 16290)
@@ -75,4 +75,5 @@
 import org.openstreetmap.josm.plugins.osb.gui.action.OsbActionObserver;
 import org.openstreetmap.josm.plugins.osb.gui.action.PopupFactory;
+import org.openstreetmap.josm.tools.OsmUrlToBounds;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -118,6 +119,7 @@
 
             public void actionPerformed(ActionEvent e) {
+                int zoom = OsmUrlToBounds.getZoom(Main.map.mapView.getRealBounds());
                 // check zoom level
-                if (Main.map.mapView.zoom() > 15 || Main.map.mapView.zoom() < 9) {
+                if (zoom > 15 || zoom < 9) {
                     JOptionPane.showMessageDialog(Main.parent,
                             tr("The visible area is either too small or too big to download data from OpenStreetBugs"),
@@ -257,6 +259,5 @@
 
     public void zoomToNode(Node node) {
-        double scale = Main.map.mapView.getScale();
-        Main.map.mapView.zoomTo(node.getEastNorth(), scale);
+        Main.map.mapView.zoomTo(node.getEastNorth());
     }
 
Index: /applications/editors/josm/plugins/piclayer/build.xml
===================================================================
--- /applications/editors/josm/plugins/piclayer/build.xml	(revision 16289)
+++ /applications/editors/josm/plugins/piclayer/build.xml	(revision 16290)
@@ -81,5 +81,5 @@
                 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
                 <attribute name="Plugin-Description" value="This plugin allows to display any picture as a background in the editor and align it with the map."/>
-                <attribute name="Plugin-Mainversion" value="1529"/>
+                <attribute name="Plugin-Mainversion" value="1722"/>
                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
             </manifest>
Index: /applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerAbstract.java
===================================================================
--- /applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerAbstract.java	(revision 16289)
+++ /applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerAbstract.java	(revision 16290)
@@ -47,28 +47,28 @@
  * anything...)
  */
-public abstract class PicLayerAbstract extends Layer 
+public abstract class PicLayerAbstract extends Layer
 {
-	// Counter - just for naming of layers
-	private static int m_counter = 0;
-	// This is the main image to be displayed
-	private BufferedImage m_image = null;
-	// Initial position of the image in the real world
-	private EastNorth m_initial_position;
-	// Position of the image in the real world
-	private EastNorth m_position;
-	// Angle of rotation of the image
-	private double m_angle = 0.0;
-	// Scale of the image
-	private double m_scale = 1.0;
-	// The scale that was set on the map during image creation
-	private double m_initial_scale = 0;
-	// Popup menu items
-	private Component m_popupmenu[] = null;
-	// Layer icon
+    // Counter - just for naming of layers
+    private static int m_counter = 0;
+    // This is the main image to be displayed
+    private BufferedImage m_image = null;
+    // Initial position of the image in the real world
+    private EastNorth m_initial_position;
+    // Position of the image in the real world
+    private EastNorth m_position;
+    // Angle of rotation of the image
+    private double m_angle = 0.0;
+    // Scale of the image
+    private double m_scale = 1.0;
+    // The scale that was set on the map during image creation
+    private double m_initial_scale = 0;
+    // Popup menu items
+    private Component m_popupmenu[] = null;
+    // Layer icon
     private Icon m_layericon = null;
-	
-	/**
-	 * Constructor
-	 */
+
+    /**
+     * Constructor
+     */
     public PicLayerAbstract() {
         super("PicLayer #" + m_counter);
@@ -76,5 +76,5 @@
         //Increase number
         m_counter++;
-        
+
         // Create popup menu
         // Reset submenu
@@ -87,13 +87,13 @@
         // Main menu
         m_popupmenu = new Component[]{
-        		reset_submenu,
-        		new JSeparator(),
-        		new JMenuItem( new HelpAction() )
+                reset_submenu,
+                new JSeparator(),
+                new JMenuItem( new HelpAction() )
         };
-        
+
         // Load layer icon
         m_layericon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(PicLayerAbstract.class.getResource("/images/layericon.png")));
-    }		
-    
+    }
+
     /**
      * Initializes the image. Gets the image from a subclass and stores some
@@ -101,161 +101,161 @@
      */
     public void Initialize() throws IOException {
-    	
-    	// Create image
-    	Image image = createImage();
-    	if ( image == null ) {
-    		throw new IOException( "Image not created properly.");
-    	}
-    	// Convert to Buffered Image - not sure if this is the right way...
-    	m_image = new BufferedImage( image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_ARGB );
-    	Graphics g = m_image.getGraphics();
-    	g.drawImage( image, 0, 0, null );
-    	
-    	// If the map does not exist - we're screwed. We should not get into this situation in the first place!
-    	if ( Main.map != null && Main.map.mapView != null ) {
-    		// Geographical position of the image
-    		m_initial_position = m_position = Main.map.mapView.getCenter();
-    		// Initial scale at which the image was loaded
-    		m_initial_scale = Main.map.mapView.getScale(); 
-    	} else {
-    		throw new IOException( "Could not find the map object." );
-    	}
-    }
-    
+
+        // Create image
+        Image image = createImage();
+        if ( image == null ) {
+            throw new IOException( "Image not created properly.");
+        }
+        // Convert to Buffered Image - not sure if this is the right way...
+        m_image = new BufferedImage( image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_ARGB );
+        Graphics g = m_image.getGraphics();
+        g.drawImage( image, 0, 0, null );
+
+        // If the map does not exist - we're screwed. We should not get into this situation in the first place!
+        if ( Main.map != null && Main.map.mapView != null ) {
+            // Geographical position of the image
+            m_initial_position = m_position = Main.map.mapView.getCenter();
+            // Initial scale at which the image was loaded
+            m_initial_scale = Main.map.mapView.getMapScale();
+        } else {
+            throw new IOException( "Could not find the map object." );
+        }
+    }
+
     /**
      * To be overridden by subclasses. Provides an image from an external sources.
      * Throws exception if something does not work.
-     * 
+     *
      * TODO: Replace the IOException by our own exception.
      */
     protected abstract Image createImage() throws IOException;
-    
+
     /**
      * To be overridden by subclasses. Returns the user readable name of the layer.
      */
     protected abstract String getPicLayerName();
-	
-	@Override
-	public Icon getIcon() {
-		return m_layericon;
-	}
-
-	@Override
-	public Object getInfoComponent() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	@Override
-	public Component[] getMenuEntries() {
-		return m_popupmenu;
-	}
-
-	@Override
-	public String getToolTipText() {
-		return getPicLayerName();
-	}
-
-	@Override
-	public boolean isMergable(Layer arg0) {
-		// TODO Auto-generated method stub
-		return false;
-	}
-
-	@Override
-	public void mergeFrom(Layer arg0) {
-		// TODO Auto-generated method stub
-
-	}
-
-	@Override
-	public void paint(Graphics arg0, MapView arg1) {
-		
-		if ( m_image != null && arg0 instanceof Graphics2D) {
-			
-			// Position image at the right graphical place
-			EastNorth center = Main.map.mapView.getCenter();
-			EastNorth leftop = Main.map.mapView.getEastNorth( 0, 0 );
-			double pixel_per_en = ( Main.map.mapView.getWidth() / 2.0 ) / ( center.east() - leftop.east() );
-
-			// 	This is now the offset in screen pixels
-			double pic_offset_x = (( m_position.east() - leftop.east() ) * pixel_per_en);
-			double pic_offset_y = (( leftop.north() - m_position.north() ) * pixel_per_en);
-		
-			// Let's use Graphics 2D
-			Graphics2D g = (Graphics2D)arg0.create();
-			// Move
-			g.translate( pic_offset_x, pic_offset_y );
-			// Rotate
-			g.rotate( m_angle * Math.PI / 180.0 );
-			// Scale
-		    double scale = m_scale * m_initial_scale / Main.map.mapView.getScale();
-		    g.scale( scale, scale );
-		    
-		    // Draw picture
-			g.drawImage( m_image, -m_image.getWidth() / 2, -m_image.getHeight() / 2, null );
-			
-			// Draw additional rectangle for the active pic layer
-			if ( Main.map.mapView.getActiveLayer() == this ) {
-				g.setColor( new Color( 0xFF0000 ) );
-				g.drawRect(
-					-m_image.getWidth() / 2,
-					-m_image.getHeight() / 2,
-					m_image.getWidth(),
-					m_image.getHeight()
-				);
-			}
-		} else {
-			// TODO: proper logging
-			System.out.println( "PicLayerAbstract::paint - general drawing error (m_image is null or Graphics not 2D" );
-		}
-	}
-	
-	/**
-	 * Moves the picture. Scaled in EastNorth...
-	 */
-	public void movePictureBy( double east, double north ) {
-		m_position = m_position.add( east, north );
-	}
-
-	/**
-	 * Scales the picture. Scaled in... don't know but works ok :)
-	 */
-	public void scalePictureBy( double scale ) {
-		m_scale += scale;
-	}	
-
-	/**
-	 * Rotates the picture. Scales in angles.
-	 */
-	public void rotatePictureBy( double angle ) {
-		m_angle += angle;
-	}	
-	
-	/**
-	 * Sets the image position to the initial position
-	 */
-	public void resetPosition() {
-		m_position = m_initial_position; 
-	}
-	
-	/**
-	 * Sets the image scale to 1.0
-	 */
-	public void resetScale() {
-		m_scale = 1.0; 
-	}
-
-	/**
-	 * Sets the image angle to 0.0
-	 */
-	public void resetAngle() {
-		m_angle = 0.0; 
-	}
-
-	@Override
-	public void visitBoundingBox(BoundingXYVisitor arg0) {
-		// TODO Auto-generated method stub
-
-	}
+
+    @Override
+    public Icon getIcon() {
+        return m_layericon;
+    }
+
+    @Override
+    public Object getInfoComponent() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public Component[] getMenuEntries() {
+        return m_popupmenu;
+    }
+
+    @Override
+    public String getToolTipText() {
+        return getPicLayerName();
+    }
+
+    @Override
+    public boolean isMergable(Layer arg0) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public void mergeFrom(Layer arg0) {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public void paint(Graphics arg0, MapView arg1) {
+
+        if ( m_image != null && arg0 instanceof Graphics2D) {
+
+            // Position image at the right graphical place
+            EastNorth center = Main.map.mapView.getCenter();
+            EastNorth leftop = Main.map.mapView.getEastNorth( 0, 0 );
+            double pixel_per_en = ( Main.map.mapView.getWidth() / 2.0 ) / ( center.east() - leftop.east() );
+
+            //     This is now the offset in screen pixels
+            double pic_offset_x = (( m_position.east() - leftop.east() ) * pixel_per_en);
+            double pic_offset_y = (( leftop.north() - m_position.north() ) * pixel_per_en);
+
+            // Let's use Graphics 2D
+            Graphics2D g = (Graphics2D)arg0.create();
+            // Move
+            g.translate( pic_offset_x, pic_offset_y );
+            // Rotate
+            g.rotate( m_angle * Math.PI / 180.0 );
+            // Scale
+            double scale = m_scale * m_initial_scale / Main.map.mapView.getMapScale();
+            g.scale( scale, scale );
+
+            // Draw picture
+            g.drawImage( m_image, -m_image.getWidth() / 2, -m_image.getHeight() / 2, null );
+
+            // Draw additional rectangle for the active pic layer
+            if ( Main.map.mapView.getActiveLayer() == this ) {
+                g.setColor( new Color( 0xFF0000 ) );
+                g.drawRect(
+                    -m_image.getWidth() / 2,
+                    -m_image.getHeight() / 2,
+                    m_image.getWidth(),
+                    m_image.getHeight()
+                );
+            }
+        } else {
+            // TODO: proper logging
+            System.out.println( "PicLayerAbstract::paint - general drawing error (m_image is null or Graphics not 2D" );
+        }
+    }
+
+    /**
+     * Moves the picture. Scaled in EastNorth...
+     */
+    public void movePictureBy( double east, double north ) {
+        m_position = m_position.add( east, north );
+    }
+
+    /**
+     * Scales the picture. Scaled in... don't know but works ok :)
+     */
+    public void scalePictureBy( double scale ) {
+        m_scale += scale;
+    }
+
+    /**
+     * Rotates the picture. Scales in angles.
+     */
+    public void rotatePictureBy( double angle ) {
+        m_angle += angle;
+    }
+
+    /**
+     * Sets the image position to the initial position
+     */
+    public void resetPosition() {
+        m_position = m_initial_position;
+    }
+
+    /**
+     * Sets the image scale to 1.0
+     */
+    public void resetScale() {
+        m_scale = 1.0;
+    }
+
+    /**
+     * Sets the image angle to 0.0
+     */
+    public void resetAngle() {
+        m_angle = 0.0;
+    }
+
+    @Override
+    public void visitBoundingBox(BoundingXYVisitor arg0) {
+        // TODO Auto-generated method stub
+
+    }
 }
Index: /applications/editors/josm/plugins/remotecontrol/build.xml
===================================================================
--- /applications/editors/josm/plugins/remotecontrol/build.xml	(revision 16289)
+++ /applications/editors/josm/plugins/remotecontrol/build.xml	(revision 16290)
@@ -26,5 +26,5 @@
                 <attribute name="Plugin-Description" value="Let other applications send commands to JOSM."/>
                 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/RemoteControl"/>
-                <attribute name="Plugin-Mainversion" value="1465"/>
+                <attribute name="Plugin-Mainversion" value="1722"/>
                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
             </manifest>
Index: /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestProcessor.java
===================================================================
--- /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestProcessor.java	(revision 16289)
+++ /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestProcessor.java	(revision 16290)
@@ -18,4 +18,5 @@
 import org.openstreetmap.josm.actions.AutoScaleAction;
 import org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask;
+import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -194,12 +195,11 @@
                 } else if (Main.pref.getBoolean("remotecontrol.permission.change-viewport", true)) {
                     // after downloading, zoom to downloaded area.
-                    final LatLon min = new LatLon(minlat, minlon);
-                    final LatLon max = new LatLon(maxlat, maxlon);
+                    final Bounds bounds = new Bounds(new LatLon(minlat, minlon),
+                        new LatLon(maxlat, maxlon));
 
                     Main.worker.execute(new Runnable() {
                         public void run() {
                             BoundingXYVisitor bbox = new BoundingXYVisitor();
-                            bbox.min = Main.proj.latlon2eastNorth(min);
-                            bbox.max = Main.proj.latlon2eastNorth(max);
+                            bbox.visit(bounds);
                             Main.map.mapView.recalculateCenterScale(bbox);
                         }
Index: /applications/editors/josm/plugins/routing/build.xml
===================================================================
--- /applications/editors/josm/plugins/routing/build.xml	(revision 16289)
+++ /applications/editors/josm/plugins/routing/build.xml	(revision 16290)
@@ -44,5 +44,5 @@
                 <attribute name="Plugin-Description" value="Provides routing capabilities."/>
                 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/Routing"/>
-                <attribute name="Plugin-Mainversion" value="1646"/>
+                <attribute name="Plugin-Mainversion" value="1722"/>
                 <attribute name="Plugin-Stage" value="50"/>
                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
Index: /applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingGraph.java
===================================================================
--- /applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingGraph.java	(revision 16289)
+++ /applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingGraph.java	(revision 16290)
@@ -160,5 +160,5 @@
      */
     private void addEdge(Way way,Node from, Node to) {
-        double length = from.coor.greatCircleDistance(to.coor);
+        double length = from.getCoor().greatCircleDistance(to.getCoor());
 
         OsmEdge edge = new OsmEdge(way, from, to);
Index: /applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/osm/OsmEdge.java
===================================================================
--- /applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/osm/OsmEdge.java	(revision 16289)
+++ /applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/osm/OsmEdge.java	(revision 16290)
@@ -69,5 +69,5 @@
         this.from = from;
         this.to = to;
-        this.length = from.coor.greatCircleDistance(to.coor);
+        this.length = from.getCoor().greatCircleDistance(to.getCoor());
       }
 
@@ -80,9 +80,9 @@
 
   public EastNorth fromEastNorth() {
-      return this.from.eastNorth;
+      return this.from.getEastNorth();
   }
 
   public EastNorth toEastNorth() {
-      return this.to.eastNorth;
+      return this.to.getEastNorth();
   }
 
Index: /applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingLayer.java
===================================================================
--- /applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingLayer.java	(revision 16289)
+++ /applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingLayer.java	(revision 16290)
@@ -139,5 +139,5 @@
                 if (n.deleted || n.incomplete) continue;
 
-                Point P = Main.map.mapView.getPoint(n.eastNorth);
+                Point P = Main.map.mapView.getPoint(n.getEastNorth());
                 double dist = p.distanceSq(P);
                 if (dist < NavigatableComponent.snapDistance) {
@@ -275,5 +275,5 @@
         // paint start icon
         Node node = nodes.get(0);
-        Point screen = mv.getPoint(node.eastNorth);
+        Point screen = mv.getPoint(node.getEastNorth());
         startIcon.paintIcon(mv, g, screen.x - startIcon.getIconWidth()/2,
                 screen.y - startIcon.getIconHeight());
@@ -282,5 +282,5 @@
         for(int index = 1; index < nodes.size() - 1; ++index) {
             node = nodes.get(index);
-            screen = mv.getPoint(node.eastNorth);
+            screen = mv.getPoint(node.getEastNorth());
             middleIcon.paintIcon(mv, g, screen.x - startIcon.getIconWidth()/2,
                     screen.y - middleIcon.getIconHeight());
@@ -289,5 +289,5 @@
         if(nodes.size() > 1) {
             node = nodes.get(nodes.size() - 1);
-            screen = mv.getPoint(node.eastNorth);
+            screen = mv.getPoint(node.getEastNorth());
             endIcon.paintIcon(mv, g, screen.x - startIcon.getIconWidth()/2,
                     screen.y - endIcon.getIconHeight());
Index: /applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/MoveRouteNodeAction.java
===================================================================
--- /applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/MoveRouteNodeAction.java	(revision 16289)
+++ /applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/MoveRouteNodeAction.java	(revision 16290)
@@ -113,5 +113,5 @@
                 for (int i=0;i<nl.size();i++) {
                     Node node = nl.get(i);
-                    double d = Main.map.mapView.getPoint(node.eastNorth).distanceSq(e.getPoint());
+                    double d = Main.map.mapView.getPoint(node.getEastNorth()).distanceSq(e.getPoint());
                     if (d < dmax) {
                         dmax = d;
Index: /applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/RemoveRouteNodeAction.java
===================================================================
--- /applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/RemoveRouteNodeAction.java	(revision 16289)
+++ /applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/RemoveRouteNodeAction.java	(revision 16290)
@@ -102,5 +102,5 @@
                 for (int i=0;i<nl.size();i++) {
                     Node node = nl.get(i);
-                    double d = Main.map.mapView.getPoint(node.eastNorth).distanceSq(e.getPoint());
+                    double d = Main.map.mapView.getPoint(node.getEastNorth()).distanceSq(e.getPoint());
                     if (d < dmax) {
                         dmax = d;
Index: /applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingDialog.java
===================================================================
--- /applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingDialog.java	(revision 16289)
+++ /applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingDialog.java	(revision 16290)
@@ -125,5 +125,5 @@
      */
     public void addNode(Node n) {
-        model.addElement(n.id+" ["+n.coor.toDisplayString()+"]");
+        model.addElement(n.id+" ["+n.getCoor().toDisplayString()+"]");
     }
 
@@ -134,5 +134,5 @@
      */
     public void insertNode(int index, Node n) {
-        model.insertElementAt(n.id+" ["+n.coor.toDisplayString()+"]", index);
+        model.insertElementAt(n.id+" ["+n.getCoor().toDisplayString()+"]", index);
     }
 
Index: /applications/editors/josm/plugins/surveyor/build.xml
===================================================================
--- /applications/editors/josm/plugins/surveyor/build.xml	(revision 16289)
+++ /applications/editors/josm/plugins/surveyor/build.xml	(revision 16290)
@@ -37,5 +37,5 @@
                 <attribute name="Plugin-Description" value="Allow adding markers/nodes on current gps positions."/>
                 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/Surveyor"/>
-                <attribute name="Plugin-Mainversion" value="1326"/>
+                <attribute name="Plugin-Mainversion" value="1722"/>
                 <attribute name="Plugin-Requires" value="livegps"/>
                 <attribute name="Plugin-Stage" value="60"/>
Index: /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorShowAction.java
===================================================================
--- /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorShowAction.java	(revision 16289)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorShowAction.java	(revision 16290)
@@ -81,5 +81,5 @@
                 public void actionPerformed(ActionEvent e) {
                     if(Main.map != null && Main.map.mapView != null) {
-                        Main.map.mapView.zoomTo(Main.map.mapView.getCenter(), Main.map.mapView.getScale()*2);
+                        Main.map.mapView.zoomToFactor(2);
                     }
                 }
@@ -90,5 +90,5 @@
                 public void actionPerformed(ActionEvent e) {
                     if(Main.map != null && Main.map.mapView != null) {
-                        Main.map.mapView.zoomTo(Main.map.mapView.getCenter(), Main.map.mapView.getScale()/2);
+                        Main.map.mapView.zoomToFactor(1/2);
                     }
                 }
Index: /applications/editors/josm/plugins/utilsplugin/build.xml
===================================================================
--- /applications/editors/josm/plugins/utilsplugin/build.xml	(revision 16289)
+++ /applications/editors/josm/plugins/utilsplugin/build.xml	(revision 16290)
@@ -25,5 +25,5 @@
                 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
                 <attribute name="Plugin-Description" value="Several utilities that make your life easier: e.g. simplify way, join areas, jump to position."/>
-                <attribute name="Plugin-Mainversion" value="1638"/>
+                <attribute name="Plugin-Mainversion" value="1722"/>
                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
             </manifest>
Index: /applications/editors/josm/plugins/utilsplugin/src/UtilsPlugin/JumpToAction.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin/src/UtilsPlugin/JumpToAction.java	(revision 16289)
+++ /applications/editors/josm/plugins/utilsplugin/src/UtilsPlugin/JumpToAction.java	(revision 16290)
@@ -43,8 +43,6 @@
         lon.setText(java.lang.Double.toString(curPos.lon()));
 
-        LatLon ll1 = Main.map.mapView.getLatLon(0,0);
-        LatLon ll2 = Main.map.mapView.getLatLon(100,0);
-        double dist = ll1.greatCircleDistance(ll2);
-        zoomFactor = Main.map.mapView.getScale()/dist;
+        double dist = Main.map.mapView.getDist100Pixel();
+        zoomFactor = 1/dist;
 
         zm.setText(java.lang.Long.toString(Math.round(dist*100)/100));
@@ -116,5 +114,5 @@
         }
 
-        Main.map.mapView.zoomTo(Main.proj.latlon2eastNorth(ll), zoomFactor * zoomLvl);
+        Main.map.mapView.zoomToFactor(Main.proj.latlon2eastNorth(ll), zoomFactor * zoomLvl);
     }
 
Index: /applications/editors/josm/plugins/validator/build.xml
===================================================================
--- /applications/editors/josm/plugins/validator/build.xml	(revision 16289)
+++ /applications/editors/josm/plugins/validator/build.xml	(revision 16290)
@@ -26,5 +26,5 @@
                 <attribute name="Plugin-Description" value="An OSM data validator. It checks for problems in data, and provides fixes for the common ones. Spellcheck integrated for tag names."/>
                 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/Validator"/>
-                <attribute name="Plugin-Mainversion" value="1638"/>
+                <attribute name="Plugin-Mainversion" value="1722"/>
                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
             </manifest>
Index: /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java
===================================================================
--- /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java	(revision 16289)
+++ /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java	(revision 16290)
@@ -262,5 +262,5 @@
         ValidatorBoundingXYVisitor bbox = new ValidatorBoundingXYVisitor();
         popupMenuError.visitHighlighted(bbox);
-        if (bbox.min == null || bbox.max == null)
+        if (bbox.getBounds() == null)
             return;
         bbox.enlargeBoundingBox();
Index: /applications/editors/josm/plugins/waydownloader/build.xml
===================================================================
--- /applications/editors/josm/plugins/waydownloader/build.xml	(revision 16289)
+++ /applications/editors/josm/plugins/waydownloader/build.xml	(revision 16290)
@@ -91,5 +91,5 @@
                 <attribute name="Plugin-Description" value="Easy downloading along a long set of interconnected ways"/>
                 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/WayDownloaderPlugin"/>
-                <attribute name="Plugin-Mainversion" value="1"/>
+                <attribute name="Plugin-Mainversion" value="1722"/>
                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
             </manifest>
Index: /applications/editors/josm/plugins/waydownloader/src/WayDownloaderPlugin.java
===================================================================
--- /applications/editors/josm/plugins/waydownloader/src/WayDownloaderPlugin.java	(revision 16289)
+++ /applications/editors/josm/plugins/waydownloader/src/WayDownloaderPlugin.java	(revision 16290)
@@ -25,242 +25,238 @@
 /**
  * Plugin class for the Way Downloader plugin
- * 
+ *
  * @author Harry Wood
  */
 public class WayDownloaderPlugin extends Plugin {
 
-	private Way priorConnectedWay = null;
-	private Node selectedNode = null;
-
-
-	/** Plugin constructor called at JOSM startup */
-	public WayDownloaderPlugin() {
-		//add WayDownloadAction to tools menu
-		MainMenu.add(Main.main.menu.toolsMenu, new WayDownloadAction());
-	}
-	
-	private class WayDownloadAction extends JosmAction implements Runnable {
-
-		/** Set up the action (text appearing on the menu, keyboard shortcut etc */ 
-		public WayDownloadAction() {
-
-			super( "Way Download" ,
-					"way-download",
-					"Download map data on the end of selected way",
-					Shortcut.registerShortcut("waydownloader:waydownload", "Way Download", KeyEvent.VK_W, Shortcut.GROUP_MENU, Shortcut.SHIFT_DEFAULT),
-					true);
-		}
-
-		/** Called when the WayDownloadAction action is triggered (e.g. user clicked the menu option) */
-		public void actionPerformed(ActionEvent e) {
-			
-			System.out.println("Way Download");
-
-			String errMsg = null;
-			
-			selectedNode = null;
-			Collection<OsmPrimitive> selection = Main.ds.getSelectedNodes();
-			
-			if (selection.size()==0) {
-				selection = Main.ds.getSelectedWays();
-				if (!workFromWaySelection(selection)) {
-					errMsg = tr("Select a starting node on the end of a way");
-				}
-				selection = Main.ds.getSelectedNodes();
-			}
-			
-			if ( selection.size()==0 || selection.size()>1 ) {
-				errMsg = tr("Select a starting node on the end of a way");
-			} else {
-				OsmPrimitive p = selection.iterator().next();
-
-				
-				
-	            if (!(p instanceof Node)) {
-					errMsg = tr("Select a starting node on the end of a way");
-	            } else {
-	            	selectedNode = (Node) p;
-
-
-	                Main.map.mapView.zoomTo(selectedNode.eastNorth , Main.map.mapView.getScale());
-	                
-	            	//Before downloading. Figure a few things out.
-	            	//Find connected way
-	            	ArrayList<Way> connectedWays = findConnectedWays();
-	            
-	            	if (connectedWays.size()==0) {
-						errMsg = tr("Select a starting node on the end of a way");
-	            	} else {
-	            		priorConnectedWay =(Way) connectedWays.get(0);
-	            		
-	            		//Download a little rectangle around the selected node
-	            		double latbuffer=0.0003; //TODO make this an option
-	            		double lonbuffer=0.0005;
-	            		DownloadOsmTask downloadTask = new DownloadOsmTask();
-	            		downloadTask.download( null,
-                                               selectedNode.coor.lat()-latbuffer,
-                                               selectedNode.coor.lon()-lonbuffer,
-                                               selectedNode.coor.lat()+latbuffer,
-                                               selectedNode.coor.lon()+lonbuffer);
-
-	                    //The download is scheduled to be executed.
-	            		//Now schedule the run() method (below) to be executed once that's completed.
-	                    Main.worker.execute(this);
-	            		
-	            	}
-	            }
-			}
-			
-	        if(errMsg != null)
-	            JOptionPane.showMessageDialog(Main.parent, errMsg);
-		
-	        
-		}
-
-		/**
-		 * Logic to excute after the download has happened
-		 */
-		public void run() {
-    		//Find ways connected to the node after the download
-        	ArrayList<Way> connectedWays = findConnectedWays();
-        	
-        	String errMsg = null;
-			if (connectedWays.size()==0) {
-				throw new RuntimeException("Way downloader data inconsistency. priorConnectedWay (" +
-						priorConnectedWay.toString() + ") wasn't discovered after download");
-				
-			} else if (connectedWays.size()==1) {
-				//Just one way connecting the node still. Presumably the one which was there before
-				
-				//Check if it's just a duplicate node
-				Node dupeNode = duplicateNode();
-				if (dupeNode!=null) {
-
-					if (JOptionPane.showConfirmDialog(null, "Merge duplicate node?")==JOptionPane.YES_OPTION) {
-						LinkedList<Node> dupeNodes = new LinkedList<Node>();
-						dupeNodes.add(dupeNode);
-				        MergeNodesAction.mergeNodes(dupeNodes, selectedNode);
-
-						connectedWays = findConnectedWays(); //Carry on
-					}
-		            
-					
-				} else {
-					errMsg = tr("Reached the end of the line");
-				}
-				
-        	}
-
-			if (connectedWays.size()>2) {
-        		//Three or more ways meeting at this node. Means we have a junction.
-				errMsg = tr("Reached a junction");
-				
-        	} else if (connectedWays.size()==2) {
-        		//Two connected ways (The "normal" way downloading case)
-        		//Figure out which of the two is new.
-        		System.out.println("connectedWays.toString()=" + connectedWays.toString());
-        		Way wayA = (Way) connectedWays.get(0);
-        		Way wayB = (Way) connectedWays.get(1);
-        		Way nextWay = wayA;
-        		if (priorConnectedWay.equals(wayA)) nextWay = wayB;
-
-        		Node nextNode = findOtherEnd(nextWay, selectedNode);
-        	
-        		//Select the next node
-        		Main.ds.setSelected(nextNode); 
-        		
-                Main.map.mapView.zoomTo(nextNode.eastNorth , Main.map.mapView.getScale());
-        		
-        	}
-	        if(errMsg != null)
-	            JOptionPane.showMessageDialog(Main.parent, errMsg);
-		}
-	}
-
-	/** See if there's another node at the same coordinates. If so return it. Otherwise null */
-	private Node duplicateNode() {
-		Iterator nodesIter = Main.ds.nodes.iterator();
-    	while (nodesIter.hasNext()) {
-    		Node onNode = (Node) nodesIter.next();
-    		if (!onNode.equals(this.selectedNode)
-    				&& onNode.coor.lat()==selectedNode.coor.lat()
-    				&& onNode.coor.lon()==selectedNode.coor.lon()) {
-    			return onNode;
-    		}
-    	}
-		return null;
-	}
-	
-	/** Given the the node on one end of the way, return the node on the other end */ 
-	private Node findOtherEnd(Way way, Node firstEnd) {
-		Node otherEnd = way.nodes.get(0);
-		if (otherEnd.equals(firstEnd)) otherEnd = way.nodes.get(way.nodes.size()-1);
-		return otherEnd;
-	}
-	
-	/** find set of ways which have an end on the selectedNode */
-	private ArrayList<Way> findConnectedWays() { 
-		ArrayList<Way> connectedWays = new ArrayList<Way>(); 
-		
-		//loop through every way
-		Iterator waysIter = Main.ds.ways.iterator();
-		while (waysIter.hasNext()) {
-			Way onWay = (Way) waysIter.next();
-
-
-			Object[] nodes = onWay.nodes.toArray();
-			if (nodes.length<2) {
-				//Should never happen should it? TODO: investigate. For the moment ignore these
-				System.err.println("WayDownloader plugin encountered a way with " + nodes.length + " nodes :" + onWay.toString());
-			} else {
-				Node firstNode = (Node) nodes[0];
-				Node lastNode = (Node) nodes[nodes.length-1];
-
-				if (firstNode.equals(selectedNode) || lastNode.equals(selectedNode)) {
-					//Found it
-					connectedWays.add(onWay);
-				}
-			}
-		}
-		return connectedWays;
-	}
-	
-	/**
-	 * given a selected way, select a node on the end of the way which is not in a downloaded area
-	 * return true if this worked
-	 */
-	private boolean workFromWaySelection(Collection<OsmPrimitive> selection) {
-		
-		if (selection.size()>1) {
-			//more than one way selected
-			return false;
-		} else {
-			Way selectedWay = (Way) selection.toArray()[0];
-			selectedNode = (Node) selectedWay.nodes.get(0);
+    private Way priorConnectedWay = null;
+    private Node selectedNode = null;
+
+
+    /** Plugin constructor called at JOSM startup */
+    public WayDownloaderPlugin() {
+        //add WayDownloadAction to tools menu
+        MainMenu.add(Main.main.menu.toolsMenu, new WayDownloadAction());
+    }
+
+    private class WayDownloadAction extends JosmAction implements Runnable {
+
+        /** Set up the action (text appearing on the menu, keyboard shortcut etc */
+        public WayDownloadAction() {
+
+            super( "Way Download" ,
+                    "way-download",
+                    "Download map data on the end of selected way",
+                    Shortcut.registerShortcut("waydownloader:waydownload", "Way Download", KeyEvent.VK_W, Shortcut.GROUP_MENU, Shortcut.SHIFT_DEFAULT),
+                    true);
+        }
+
+        /** Called when the WayDownloadAction action is triggered (e.g. user clicked the menu option) */
+        public void actionPerformed(ActionEvent e) {
+
+            System.out.println("Way Download");
+
+            String errMsg = null;
+
+            selectedNode = null;
+            Collection<OsmPrimitive> selection = Main.ds.getSelectedNodes();
+
+            if (selection.size()==0) {
+                selection = Main.ds.getSelectedWays();
+                if (!workFromWaySelection(selection)) {
+                    errMsg = tr("Select a starting node on the end of a way");
+                }
+                selection = Main.ds.getSelectedNodes();
+            }
+
+            if ( selection.size()==0 || selection.size()>1 ) {
+                errMsg = tr("Select a starting node on the end of a way");
+            } else {
+                OsmPrimitive p = selection.iterator().next();
+
+
+
+                if (!(p instanceof Node)) {
+                    errMsg = tr("Select a starting node on the end of a way");
+                } else {
+                    selectedNode = (Node) p;
+
+
+                    Main.map.mapView.zoomTo(selectedNode.getEastNorth());
+
+                    //Before downloading. Figure a few things out.
+                    //Find connected way
+                    ArrayList<Way> connectedWays = findConnectedWays();
+
+                    if (connectedWays.size()==0) {
+                        errMsg = tr("Select a starting node on the end of a way");
+                    } else {
+                        priorConnectedWay =(Way) connectedWays.get(0);
+
+                        //Download a little rectangle around the selected node
+                        double latbuffer=0.0003; //TODO make this an option
+                        double lonbuffer=0.0005;
+                        DownloadOsmTask downloadTask = new DownloadOsmTask();
+                        downloadTask.download( null,
+                                               selectedNode.getCoor().lat()-latbuffer,
+                                               selectedNode.getCoor().lon()-lonbuffer,
+                                               selectedNode.getCoor().lat()+latbuffer,
+                                               selectedNode.getCoor().lon()+lonbuffer);
+
+                        //The download is scheduled to be executed.
+                        //Now schedule the run() method (below) to be executed once that's completed.
+                        Main.worker.execute(this);
+                    }
+                }
+            }
+
+            if(errMsg != null)
+                JOptionPane.showMessageDialog(Main.parent, errMsg);
+        }
+
+        /**
+         * Logic to excute after the download has happened
+         */
+        public void run() {
+            //Find ways connected to the node after the download
+            ArrayList<Way> connectedWays = findConnectedWays();
+
+            String errMsg = null;
+            if (connectedWays.size()==0) {
+                throw new RuntimeException("Way downloader data inconsistency. priorConnectedWay (" +
+                        priorConnectedWay.toString() + ") wasn't discovered after download");
+
+            } else if (connectedWays.size()==1) {
+                //Just one way connecting the node still. Presumably the one which was there before
+
+                //Check if it's just a duplicate node
+                Node dupeNode = duplicateNode();
+                if (dupeNode!=null) {
+
+                    if (JOptionPane.showConfirmDialog(null, "Merge duplicate node?")==JOptionPane.YES_OPTION) {
+                        LinkedList<Node> dupeNodes = new LinkedList<Node>();
+                        dupeNodes.add(dupeNode);
+                        MergeNodesAction.mergeNodes(dupeNodes, selectedNode);
+
+                        connectedWays = findConnectedWays(); //Carry on
+                    }
+
+
+                } else {
+                    errMsg = tr("Reached the end of the line");
+                }
+
+            }
+
+            if (connectedWays.size()>2) {
+                //Three or more ways meeting at this node. Means we have a junction.
+                errMsg = tr("Reached a junction");
+
+            } else if (connectedWays.size()==2) {
+                //Two connected ways (The "normal" way downloading case)
+                //Figure out which of the two is new.
+                System.out.println("connectedWays.toString()=" + connectedWays.toString());
+                Way wayA = (Way) connectedWays.get(0);
+                Way wayB = (Way) connectedWays.get(1);
+                Way nextWay = wayA;
+                if (priorConnectedWay.equals(wayA)) nextWay = wayB;
+
+                Node nextNode = findOtherEnd(nextWay, selectedNode);
+
+                //Select the next node
+                Main.ds.setSelected(nextNode);
+
+                Main.map.mapView.zoomTo(nextNode.getEastNorth());
+            }
+            if(errMsg != null)
+                JOptionPane.showMessageDialog(Main.parent, errMsg);
+        }
+    }
+
+    /** See if there's another node at the same coordinates. If so return it. Otherwise null */
+    private Node duplicateNode() {
+        Iterator nodesIter = Main.ds.nodes.iterator();
+        while (nodesIter.hasNext()) {
+            Node onNode = (Node) nodesIter.next();
+            if (!onNode.equals(this.selectedNode)
+                    && onNode.getCoor().lat()==selectedNode.getCoor().lat()
+                    && onNode.getCoor().lon()==selectedNode.getCoor().lon()) {
+                return onNode;
+            }
+        }
+        return null;
+    }
+
+    /** Given the the node on one end of the way, return the node on the other end */
+    private Node findOtherEnd(Way way, Node firstEnd) {
+        Node otherEnd = way.nodes.get(0);
+        if (otherEnd.equals(firstEnd)) otherEnd = way.nodes.get(way.nodes.size()-1);
+        return otherEnd;
+    }
+
+    /** find set of ways which have an end on the selectedNode */
+    private ArrayList<Way> findConnectedWays() {
+        ArrayList<Way> connectedWays = new ArrayList<Way>();
+
+        //loop through every way
+        Iterator waysIter = Main.ds.ways.iterator();
+        while (waysIter.hasNext()) {
+            Way onWay = (Way) waysIter.next();
+
+
+            Object[] nodes = onWay.nodes.toArray();
+            if (nodes.length<2) {
+                //Should never happen should it? TODO: investigate. For the moment ignore these
+                System.err.println("WayDownloader plugin encountered a way with " + nodes.length + " nodes :" + onWay.toString());
+            } else {
+                Node firstNode = (Node) nodes[0];
+                Node lastNode = (Node) nodes[nodes.length-1];
+
+                if (firstNode.equals(selectedNode) || lastNode.equals(selectedNode)) {
+                    //Found it
+                    connectedWays.add(onWay);
+                }
+            }
+        }
+        return connectedWays;
+    }
+
+    /**
+     * given a selected way, select a node on the end of the way which is not in a downloaded area
+     * return true if this worked
+     */
+    private boolean workFromWaySelection(Collection<OsmPrimitive> selection) {
+
+        if (selection.size()>1) {
+            //more than one way selected
+            return false;
+        } else {
+            Way selectedWay = (Way) selection.toArray()[0];
+            selectedNode = (Node) selectedWay.nodes.get(0);
 
             if (isDownloaded(selectedNode)) {
-				selectedNode = findOtherEnd(selectedWay, selectedNode);
-				
+                selectedNode = findOtherEnd(selectedWay, selectedNode);
+
                 if (isDownloaded(selectedNode)) return false;
-			}
-		}
-		Main.ds.setSelected(selectedNode); 
-		return true;
-	}
-	
-	private boolean isDownloaded(Node node) {
-		Iterator downloadedAreasIter = Main.ds.dataSources.iterator();
-		while (downloadedAreasIter.hasNext()) {
-			DataSource datasource = (DataSource) downloadedAreasIter.next();
-			Bounds bounds = datasource.bounds;
-
-			if (node.coor.lat()>bounds.min.lat() &&
-				node.coor.lat()<bounds.max.lat() &&
-				node.coor.lon()>bounds.min.lon() &&
-				node.coor.lon()<bounds.max.lon()) {
-				return true;
-			}
-		}
-		return false;
-	}
+            }
+        }
+        Main.ds.setSelected(selectedNode);
+        return true;
+    }
+
+    private boolean isDownloaded(Node node) {
+        Iterator downloadedAreasIter = Main.ds.dataSources.iterator();
+        while (downloadedAreasIter.hasNext()) {
+            DataSource datasource = (DataSource) downloadedAreasIter.next();
+            Bounds bounds = datasource.bounds;
+
+            if (node.getCoor().lat()>bounds.min.lat() &&
+                node.getCoor().lat()<bounds.max.lat() &&
+                node.getCoor().lon()>bounds.min.lon() &&
+                node.getCoor().lon()<bounds.max.lon()) {
+                return true;
+            }
+        }
+        return false;
+    }
 }
Index: /applications/editors/josm/plugins/wmsplugin/build.xml
===================================================================
--- /applications/editors/josm/plugins/wmsplugin/build.xml	(revision 16289)
+++ /applications/editors/josm/plugins/wmsplugin/build.xml	(revision 16290)
@@ -29,5 +29,5 @@
                 <attribute name="Plugin-Description" value="Display georeferenced images as background in JOSM (WMS servers, Yahoo, ...)."/>
                 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/WMSPlugin"/>
-                <attribute name="Plugin-Mainversion" value="1646"/>
+                <attribute name="Plugin-Mainversion" value="1722"/>
                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
                 <attribute name="de_Plugin-Link" value="http://wiki.openstreetmap.org/wiki/DE:JOSM/Plugins/WMSPlugin"/>
Index: /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/Grabber.java
===================================================================
--- /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/Grabber.java	(revision 16289)
+++ /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/Grabber.java	(revision 16290)
@@ -9,6 +9,6 @@
 
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.data.Bounds;
-import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.ProjectionBounds;
+import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.projection.Projection;
 import org.openstreetmap.josm.gui.MapView;
@@ -16,5 +16,5 @@
 
 abstract public class Grabber implements Runnable {
-    protected Bounds b;
+    protected ProjectionBounds b;
     protected Projection proj;
     protected double pixelPerDegree;
@@ -24,25 +24,7 @@
     protected CacheFiles cache;
 
-    Grabber(Bounds b, GeorefImage image, MapView mv, WMSLayer layer, CacheFiles cache)
+    Grabber(ProjectionBounds b, GeorefImage image, MapView mv, WMSLayer layer, CacheFiles cache)
     {
-        if (b.min != null && b.max != null && WMSPlugin.doOverlap)
-        {
-            double latCent = (b.min.lat() + b.max.lat()) / 2;
-            double lonCent = (b.min.lon() + b.max.lon()) / 2;
-
-            double latSize =  b.max.lat() - b.min.lat();
-            double lonSize =  b.max.lon() - b.min.lon();
-
-            double latCoef = (100.0 + WMSPlugin.overlapLat) / 100.0 / 2.0;
-            double lonCoef = (100.0 + WMSPlugin.overlapLon) / 100.0 / 2.0;
-
-            this.b = new Bounds( new LatLon(latCent - latCoef * latSize,
-                                            lonCent - lonCoef * lonSize),
-                                 new LatLon(latCent + latCoef * latSize,
-                                            lonCent + lonCoef * lonSize));
-        }
-        else
-            this.b = b;
-
+        this.b = b;
         this.proj = Main.main.proj;
         this.pixelPerDegree = layer.pixelPerDegree;
@@ -56,8 +38,8 @@
 
     int width(){
-        return (int) ((b.max.lon() - b.min.lon()) * pixelPerDegree);
+        return (int) ((b.max.north() - b.min.north()) * pixelPerDegree);
     }
     int height(){
-        return (int) ((b.max.lat() - b.min.lat()) * pixelPerDegree);
+        return (int) ((b.max.east() - b.min.east()) * pixelPerDegree);
     }
 
Index: /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSGrabber.java
===================================================================
--- /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSGrabber.java	(revision 16289)
+++ /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSGrabber.java	(revision 16290)
@@ -24,5 +24,9 @@
 
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.data.Bounds;
+import org.openstreetmap.josm.data.ProjectionBounds;
+import org.openstreetmap.josm.data.coor.EastNorth;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.projection.Epsg4326;
+import org.openstreetmap.josm.data.projection.Mercator;
 import org.openstreetmap.josm.gui.MapView;
 import org.openstreetmap.josm.io.CacheFiles;
@@ -35,5 +39,5 @@
     private final boolean urlWithPatterns;
 
-    WMSGrabber(Bounds b, GeorefImage image, MapView mv, WMSLayer layer, CacheFiles cache) {
+    WMSGrabber(ProjectionBounds b, GeorefImage image, MapView mv, WMSLayer layer, CacheFiles cache) {
         super(b, image, mv, layer, cache);
         this.baseURL = layer.baseURL;
@@ -51,11 +55,12 @@
         try {
             url = getURL(
-                b.min.lon(), b.min.lat(),
-                b.max.lon(), b.max.lat(),
+                b.min.east(), b.min.north(),
+                b.max.east(), b.max.north(),
                 width(), height());
 
-            image.min = proj.latlon2eastNorth(b.min);
-            image.max = proj.latlon2eastNorth(b.max);
+            image.min = b.min;
+            image.max = b.max;
 
+System.out.println(url + " " + b + " " + image.min + " " + image.max);
             if(image.isVisible(mv)) { //don't download, if the image isn't visible already
                 image.image = grab(url);
@@ -73,4 +78,25 @@
     protected URL getURL(double w, double s,double e,double n,
             int wi, int ht) throws MalformedURLException {
+        String proj = Main.proj.toCode();
+        if(Main.proj instanceof Mercator) // don't use mercator code directly
+        {
+            LatLon sw = Main.proj.eastNorth2latlon(new EastNorth(s, w));
+            LatLon ne = Main.proj.eastNorth2latlon(new EastNorth(n, e));
+            proj = "EPSG:4326";
+            s = sw.lat();
+            w = sw.lon();
+            n = ne.lat();
+            e = ne.lon();
+        }
+/*        else if(!(Main.proj instanceof Epsg4326))
+        {
+            EastNorth sw = Main.proj.latlon2eastNorth(new LatLon(s, w));
+            EastNorth ne = Main.proj.latlon2eastNorth(new LatLon(n, e));
+            s = sw.north();
+            w = sw.east();
+            n = ne.north();
+            e = ne.east();
+        }
+*/
         String str = baseURL;
         String bbox = latLonFormat.format(w) + ","
@@ -80,8 +106,4 @@
 
         if (urlWithPatterns) {
-            String proj = Main.proj.toCode();
-            if(Main.proj instanceof org.openstreetmap.josm.data.projection.Mercator) // don't use mercator code directly
-                proj = "EPSG:4326";
-
             str = MessageFormat.format(str, proj, bbox, wi, ht);
         } else {
@@ -99,5 +121,5 @@
     {
         String projname = Main.proj.toCode();
-        if(Main.proj instanceof org.openstreetmap.josm.data.projection.Mercator) // don't use mercator code
+        if(Main.proj instanceof Mercator) // don't use mercator code
             projname = "EPSG:4326";
         String res = "";
Index: /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSLayer.java
===================================================================
--- /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSLayer.java	(revision 16289)
+++ /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSLayer.java	(revision 16290)
@@ -26,5 +26,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.DiskAccessAction;
-import org.openstreetmap.josm.data.Bounds;
+import org.openstreetmap.josm.data.ProjectionBounds;
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -79,5 +79,5 @@
         WMSGrabber.getProjection(baseURL, true);
         mv = Main.map.mapView;
-        getPPD();
+        pixelPerDegree = getPPD();
 
         executor = Executors.newFixedThreadPool(3);
@@ -92,6 +92,7 @@
     }
 
-    public void getPPD(){
-        pixelPerDegree = mv.getWidth() / (bounds().max.lon() - bounds().min.lon());
+    public double getPPD(){
+        ProjectionBounds bounds = mv.getProjectionBounds();
+        return mv.getWidth() / (bounds.max.east() - bounds.min.east());
     }
 
@@ -128,8 +129,8 @@
     }
 
-    private Bounds XYtoBounds (int x, int y) {
-        return new Bounds(
-            new LatLon(      x * ImageSize / pixelPerDegree,       y * ImageSize / pixelPerDegree),
-            new LatLon((x + 1) * ImageSize / pixelPerDegree, (y + 1) * ImageSize / pixelPerDegree));
+    private ProjectionBounds XYtoBounds (int x, int y) {
+        return new ProjectionBounds(
+            new EastNorth(      x * ImageSize / pixelPerDegree,       y * ImageSize / pixelPerDegree),
+            new EastNorth((x + 1) * ImageSize / pixelPerDegree, (y + 1) * ImageSize / pixelPerDegree));
     }
 
@@ -138,14 +139,8 @@
     }
 
-    protected Bounds bounds(){
-        return new Bounds(
-            mv.getLatLon(0, mv.getHeight()),
-            mv.getLatLon(mv.getWidth(), 0));
-    }
-
     @Override public void paint(Graphics g, final MapView mv) {
         if(baseURL == null) return;
 
-        if( !startstop.isSelected() || (pixelPerDegree / (mv.getWidth() / (bounds().max.lon() - bounds().min.lon())) > minZoom) ){ //don't download when it's too outzoomed
+        if( !startstop.isSelected() || (pixelPerDegree / getPPD() > minZoom) ){ //don't download when it's too outzoomed
             for(int x = 0; x<dax; ++x)
                 for(int y = 0; y<day; ++y)
@@ -161,8 +156,9 @@
 
     protected void downloadAndPaintVisible(Graphics g, final MapView mv){
-        int bminx= (int)Math.floor ((bounds().min.lat() * pixelPerDegree ) / ImageSize );
-        int bminy= (int)Math.floor ((bounds().min.lon() * pixelPerDegree ) / ImageSize );
-        int bmaxx= (int)Math.ceil  ((bounds().max.lat() * pixelPerDegree ) / ImageSize );
-        int bmaxy= (int)Math.ceil  ((bounds().max.lon() * pixelPerDegree ) / ImageSize );
+        ProjectionBounds bounds = mv.getProjectionBounds();
+        int bminx= (int)Math.floor ((bounds.min.east() * pixelPerDegree ) / ImageSize );
+        int bminy= (int)Math.floor ((bounds.min.north() * pixelPerDegree ) / ImageSize );
+        int bmaxx= (int)Math.ceil  ((bounds.max.east() * pixelPerDegree ) / ImageSize );
+        int bmaxy= (int)Math.ceil  ((bounds.max.north() * pixelPerDegree ) / ImageSize );
 
         if((bmaxx - bminx > dax) || (bmaxy - bminy > day)){
@@ -241,5 +237,5 @@
             initializeImages();
             resolution = scale();
-            getPPD();
+            pixelPerDegree = getPPD();
             mv.repaint();
         }
Index: /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPlugin.java
===================================================================
--- /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPlugin.java	(revision 16289)
+++ /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPlugin.java	(revision 16290)
@@ -25,5 +25,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
-import org.openstreetmap.josm.data.Bounds;
+import org.openstreetmap.josm.data.ProjectionBounds;
 import org.openstreetmap.josm.gui.IconToggleButton;
 import org.openstreetmap.josm.gui.MainMenu;
@@ -43,8 +43,4 @@
     static ArrayList<WMSInfo> wmsList = new ArrayList<WMSInfo>();
     static TreeMap<String,String> wmsListDefault = new TreeMap<String,String>();
-
-    static boolean doOverlap = false;
-    static int overlapLat = 4;
-    static int overlapLon = 14;
 
     // remember state of menu item to restore on changed preferences
@@ -89,18 +85,4 @@
 
         TreeSet<String> keys = new TreeSet<String>(prefs.keySet());
-
-        // Here we load the settings for "overlap" checkbox and spinboxes.
-
-        try {
-            doOverlap = Boolean.valueOf(prefs.get("wmsplugin.url.overlap"));
-        } catch (Exception e) {} // If sth fails, we drop to default settings.
-
-        try {
-            overlapLat = Integer.valueOf(prefs.get("wmsplugin.url.overlapLat"));
-        } catch (Exception e) {} // If sth fails, we drop to default settings.
-
-        try {
-            overlapLon = Integer.valueOf(prefs.get("wmsplugin.url.overlapLon"));
-        } catch (Exception e) {} // If sth fails, we drop to default settings.
 
         // And then the names+urls of WMS servers
@@ -207,15 +189,9 @@
     }
 
-    // baseURL, XYtoBounds(x,y), Main.main.proj, pixelPerDegree, img, mv, this
-    // Grabber gr = WMSPlugin.getGrabber(XYtoBounds(x,y), img, mv, this);
-    public static Grabber getGrabber(Bounds bounds, GeorefImage img, MapView mv, WMSLayer layer){
+    public static Grabber getGrabber(ProjectionBounds bounds, GeorefImage img, MapView mv, WMSLayer layer){
         if(layer.baseURL.startsWith("yahoo://"))
             return new YAHOOGrabber(bounds, img, mv, layer, cache);
         else
             return new WMSGrabber(bounds, img, mv, layer, cache);
-
-        // OSBGrabber should be rewrite for thread support first
-        //if (wmsurl.matches("(?i).*layers=npeoocmap.*") || wmsurl.matches("(?i).*layers=npe.*") )
-        //  return new OSGBGrabber(_b, _proj, _pixelPerDegree,  _images, _mv, _layer);
     }
 
Index: /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPreferenceEditor.java
===================================================================
--- /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPreferenceEditor.java	(revision 16289)
+++ /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPreferenceEditor.java	(revision 16290)
@@ -33,8 +33,4 @@
     private DefaultTableModel model;
     private HashMap<Integer, WMSInfo> oldValues = new HashMap<Integer, WMSInfo>();
-
-    JCheckBox overlapCheckBox;
-    JSpinner spinLat;
-    JSpinner spinLon;
 
     public void addGui(final PreferenceDialog gui) {
@@ -117,19 +113,4 @@
         p.add(buttonPanel);
         p.add(Box.createHorizontalGlue(), GBC.eol().fill(GBC.HORIZONTAL));
-
-        overlapCheckBox = new JCheckBox(tr("Overlap tiles"), WMSPlugin.doOverlap );
-        JLabel labelLat = new JLabel(tr("% of lat:"));
-        JLabel labelLon = new JLabel(tr("% of lon:"));
-        spinLat = new JSpinner(new SpinnerNumberModel(WMSPlugin.overlapLat, 1, 50, 1));
-        spinLon = new JSpinner(new SpinnerNumberModel(WMSPlugin.overlapLon, 1, 50, 1));
-
-        JPanel overlapPanel = new JPanel(new FlowLayout());
-        overlapPanel.add(overlapCheckBox);
-        overlapPanel.add(labelLat);
-        overlapPanel.add(spinLat);
-        overlapPanel.add(labelLon);
-        overlapPanel.add(spinLon);
-
-        p.add(overlapPanel);
     }
 
@@ -170,12 +151,4 @@
 
         if (change) WMSPlugin.refreshMenu();
-
-        WMSPlugin.doOverlap = overlapCheckBox.getModel().isSelected();
-        WMSPlugin.overlapLat = (Integer) spinLat.getModel().getValue();
-        WMSPlugin.overlapLon = (Integer) spinLon.getModel().getValue();
-
-        Main.pref.put("wmsplugin.url.overlap",    String.valueOf(WMSPlugin.doOverlap));
-        Main.pref.put("wmsplugin.url.overlapLat", String.valueOf(WMSPlugin.overlapLat));
-        Main.pref.put("wmsplugin.url.overlapLon", String.valueOf(WMSPlugin.overlapLon));
 
         return false;
Index: /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/YAHOOGrabber.java
===================================================================
--- /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/YAHOOGrabber.java	(revision 16289)
+++ /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/YAHOOGrabber.java	(revision 16290)
@@ -10,5 +10,5 @@
 import javax.imageio.ImageIO;
 
-import org.openstreetmap.josm.data.Bounds;
+import org.openstreetmap.josm.data.ProjectionBounds;
 import org.openstreetmap.josm.gui.MapView;
 import org.openstreetmap.josm.io.CacheFiles;
@@ -18,5 +18,5 @@
     protected String browserCmd;
 
-    YAHOOGrabber(Bounds b, GeorefImage image, MapView mv, WMSLayer layer, CacheFiles cache) {
+    YAHOOGrabber(ProjectionBounds b, GeorefImage image, MapView mv, WMSLayer layer, CacheFiles cache) {
         super(b, image, mv, layer, cache);
         this.baseURL = "file:///" + WMSPlugin.getPrefsPath() + "ymap.html?";
