Index: buildings_tools/src/buildings_tools/Building.java
===================================================================
--- buildings_tools/src/buildings_tools/Building.java	(revision 29863)
+++ buildings_tools/src/buildings_tools/Building.java	(working copy)
@@ -205,8 +205,7 @@
     private Node findNode(EastNorth en) {
         DataSet ds = Main.main.getCurrentDataSet();
         LatLon l = eastNorth2latlon(en);
-        List<Node> nodes = ds.searchNodes(new BBox(l.lon() - 0.0000001, l.lat() - 0.0000001,
-                l.lon() + 0.0000001, l.lat() + 0.0000001));
+        List<Node> nodes = ds.searchNodes(l.toBBox(0.0000001));
         Node bestnode = null;
         double mindist = 0.0003;
         for (Node n : nodes) {
Index: gpxfilter/src/gpxfilter/GpxGrabber.java
===================================================================
--- gpxfilter/src/gpxfilter/GpxGrabber.java	(revision 29863)
+++ gpxfilter/src/gpxfilter/GpxGrabber.java	(working copy)
@@ -26,10 +26,10 @@
     private int page;
 
     public GpxGrabber(Bounds downloadArea) {
-        this.lat1 = downloadArea.getMin().lat();
-        this.lon1 = downloadArea.getMin().lon();
-        this.lat2 = downloadArea.getMax().lat();
-        this.lon2 = downloadArea.getMax().lon();
+        this.lat1 = downloadArea.getMinLat();
+        this.lon1 = downloadArea.getMinLon();
+        this.lat2 = downloadArea.getMaxLat();
+        this.lon2 = downloadArea.getMaxLon();
         
         page = 0;
     }
Index: imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ComputeBoundsAction.java
===================================================================
--- imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ComputeBoundsAction.java	(revision 29863)
+++ imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ComputeBoundsAction.java	(working copy)
@@ -262,10 +262,10 @@
 	protected static final String getBounds(OsmPrimitive p, boolean closeTag) {
 		BBox bbox = p.getBBox();
 		String result = "        <bounds ";
-		result += "min-lat='"+df.format(bbox.getBottomRight().lat())+"' "; 
-		result += "min-lon='"+df.format(bbox.getTopLeft().lon())+"' "; 
-		result += "max-lat='"+df.format(bbox.getTopLeft().lat())+"' "; 
-		result += "max-lon='"+df.format(bbox.getBottomRight().lon())+"'";
+		result += "min-lat='"+df.format(bbox.getBottomRightLat())+"' "; 
+		result += "min-lon='"+df.format(bbox.getTopLeftLon())+"' "; 
+		result += "max-lat='"+df.format(bbox.getTopLeftLat())+"' "; 
+		result += "max-lon='"+df.format(bbox.getBottomRightLon())+"'";
 		result += closeTag ? " />" : ">\n";
 		return result;
 	}
@@ -323,8 +323,8 @@
 			}
 			
 			return latMap.size() == 2 && lonMap.size() == 2 
-					&& latMap.containsKey(bBox.getBottomRight().lat()) && latMap.containsKey(bBox.getTopLeft().lat())
-					&& lonMap.containsKey(bBox.getBottomRight().lon()) && lonMap.containsKey(bBox.getTopLeft().lon());
+					&& latMap.containsKey(bBox.getBottomRightLat()) && latMap.containsKey(bBox.getTopLeftLat())
+					&& lonMap.containsKey(bBox.getBottomRightLon()) && lonMap.containsKey(bBox.getTopLeftLon());
 		}
 		return false;
 	}
Index: imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/data/XmlBoundsConverter.java
===================================================================
--- imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/data/XmlBoundsConverter.java	(revision 29863)
+++ imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/data/XmlBoundsConverter.java	(working copy)
@@ -24,7 +24,6 @@
 import org.openstreetmap.josm.data.imagery.Shape;
 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryBounds;
 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType;
-import org.openstreetmap.josm.data.osm.BBox;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -76,7 +75,7 @@
 	}
 	
     private static Node getNode(LatLon latlon, DataSet dataSet) {
-        List<Node> nodes = dataSet.searchNodes(new BBox(latlon, latlon));
+        List<Node> nodes = dataSet.searchNodes(latlon.toBBox());
         if (!nodes.isEmpty()) {
             return nodes.get(0);
         } else {
Index: mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustPlugin.java
===================================================================
--- mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustPlugin.java	(revision 29863)
+++ mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustPlugin.java	(working copy)
@@ -520,8 +520,8 @@
         MapView mapView = Main.map.mapView;
         Bounds bounds = new Bounds(mapView.getLatLon(0, mapView.getHeight()),
                 mapView.getLatLon(mapView.getWidth(), 0));
-        return new BoundingBox(bounds.getMin().lon(), bounds.getMin().lat(),
-                bounds.getMax().lon(), bounds.getMax().lat());
+        return new BoundingBox(bounds.getMinLon(), bounds.getMinLat(),
+                bounds.getMaxLon(), bounds.getMaxLat());
     }
 
     /**
Index: opendata/src/org/openstreetmap/josm/plugins/opendata/core/datasets/AbstractDataSetHandler.java
===================================================================
--- opendata/src/org/openstreetmap/josm/plugins/opendata/core/datasets/AbstractDataSetHandler.java	(revision 29863)
+++ opendata/src/org/openstreetmap/josm/plugins/opendata/core/datasets/AbstractDataSetHandler.java	(working copy)
@@ -265,20 +265,20 @@
 
 	public final Collection<String> getOsmXapiRequests(Bounds bounds) {
 		return getOsmXapiRequests(
-				LatLon.roundToOsmPrecisionStrict(bounds.getMin().lon())+","+
-				LatLon.roundToOsmPrecisionStrict(bounds.getMin().lat())+","+
-				LatLon.roundToOsmPrecisionStrict(bounds.getMax().lon())+","+
-				LatLon.roundToOsmPrecisionStrict(bounds.getMax().lat()));
+				LatLon.roundToOsmPrecisionStrict(bounds.getMinLon())+","+
+				LatLon.roundToOsmPrecisionStrict(bounds.getMinLat())+","+
+				LatLon.roundToOsmPrecisionStrict(bounds.getMaxLon())+","+
+				LatLon.roundToOsmPrecisionStrict(bounds.getMaxLat()));
 	}
 	
 	protected Collection<String> getOsmXapiRequests(String bbox) {return null;}
 	
 	public final String getOverpassApiRequest(Bounds bounds) {
 		return getOverpassApiRequest(
-				"w=\""+LatLon.roundToOsmPrecisionStrict(bounds.getMin().lon())+"\" "+
-				"s=\""+LatLon.roundToOsmPrecisionStrict(bounds.getMin().lat())+"\" "+
-				"e=\""+LatLon.roundToOsmPrecisionStrict(bounds.getMax().lon())+"\" "+
-				"n=\""+LatLon.roundToOsmPrecisionStrict(bounds.getMax().lat())+"\"");
+				"w=\""+LatLon.roundToOsmPrecisionStrict(bounds.getMinLon())+"\" "+
+				"s=\""+LatLon.roundToOsmPrecisionStrict(bounds.getMinLat())+"\" "+
+				"e=\""+LatLon.roundToOsmPrecisionStrict(bounds.getMaxLon())+"\" "+
+				"n=\""+LatLon.roundToOsmPrecisionStrict(bounds.getMaxLat())+"\"");
 	}
 
 
Index: openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/DownloadAction.java
===================================================================
--- openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/DownloadAction.java	(revision 29863)
+++ openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/DownloadAction.java	(working copy)
@@ -56,10 +56,10 @@
 
         // add query params to the uri
         StringBuilder sb = new StringBuilder(uri)
-            .append("?b=").append(bounds.getMin().lat())
-            .append("&t=").append(bounds.getMax().lat())
-            .append("&l=").append(bounds.getMin().lon())
-            .append("&r=").append(bounds.getMax().lon());
+            .append("?b=").append(bounds.getMinLat())
+            .append("&t=").append(bounds.getMaxLat())
+            .append("&l=").append(bounds.getMinLon())
+            .append("&r=").append(bounds.getMaxLon());
         uri = sb.toString();
 
         // download the data
Index: osmarender/src/org/openstreetmap/josm/plugins/osmarender/OsmarenderPlugin.java
===================================================================
--- osmarender/src/org/openstreetmap/josm/plugins/osmarender/OsmarenderPlugin.java	(revision 29863)
+++ osmarender/src/org/openstreetmap/josm/plugins/osmarender/OsmarenderPlugin.java	(working copy)
@@ -192,10 +192,10 @@
 
     private void writeGenerated(Bounds b) throws IOException {
         String bounds_tag = "<bounds " +
-            "minlat=\"" + b.getMin().lat() + "\" " +
-            "maxlat=\"" + b.getMax().lat() + "\" " +
-            "minlon=\"" + b.getMin().lon() + "\" " +
-            "maxlon=\"" + b.getMax().lon() + "\" " + "/>";
+            "minlat=\"" + b.getMinLat() + "\" " +
+            "maxlat=\"" + b.getMaxLat() + "\" " +
+            "minlon=\"" + b.getMinLon() + "\" " +
+            "maxlon=\"" + b.getMaxLon() + "\" " + "/>";
 
         BufferedReader reader = new BufferedReader(
                 new FileReader( getPluginDir() + File.separator + "osm-map-features.xml") );
Index: tracer/src/org/openstreetmap/josm/plugins/tracer/ConnectWays.java
===================================================================
--- tracer/src/org/openstreetmap/josm/plugins/tracer/ConnectWays.java	(revision 29863)
+++ tracer/src/org/openstreetmap/josm/plugins/tracer/ConnectWays.java	(working copy)
@@ -44,11 +44,7 @@
             System.out.println("-------");
             System.out.println("Node: " + n);
             LatLon ll = n.getCoor();
-            BBox bbox = new BBox(
-                    ll.getX() - MIN_DISTANCE,
-                    ll.getY() - MIN_DISTANCE,
-                    ll.getX() + MIN_DISTANCE,
-                    ll.getY() + MIN_DISTANCE);
+            BBox bbox = ll.toBBox(MIN_DISTANCE);
 
             // bude se node slucovat s jinym?
             double minDistanceSq = MIN_DISTANCE;
@@ -124,11 +120,7 @@
             throws IllegalStateException, IndexOutOfBoundsException {
 
         LatLon ll = node.getCoor();
-        BBox bbox = new BBox(
-                ll.getX() - MIN_DISTANCE_TW,
-                ll.getY() - MIN_DISTANCE_TW,
-                ll.getX() + MIN_DISTANCE_TW,
-                ll.getY() + MIN_DISTANCE_TW);
+        BBox bbox = ll.toBBox(MIN_DISTANCE_TW);
 
         // node nebyl slouceny s jinym
         // hledani pripadne blizke usecky, kam bod pridat
Index: walkingpapers/src/org/openstreetmap/josm/plugins/walkingpapers/WalkingPapersLayer.java
===================================================================
--- walkingpapers/src/org/openstreetmap/josm/plugins/walkingpapers/WalkingPapersLayer.java	(revision 29863)
+++ walkingpapers/src/org/openstreetmap/josm/plugins/walkingpapers/WalkingPapersLayer.java	(working copy)
@@ -255,8 +255,8 @@
                 if (!key.valid) continue;
                 if (tile == null) {
                     // check if tile is in range
-                    Bounds tileBounds = new Bounds(new LatLon(tileYToLat(y+1), tileXToLon(x)),
-                        new LatLon(tileYToLat(y), tileXToLon(x+1)));
+                    Bounds tileBounds = new Bounds(tileYToLat(y+1), tileXToLon(x),
+                        tileYToLat(y), tileXToLon(x+1));
                     if (!tileBounds.asRect().intersects(printBounds.asRect())) continue;
                     tile = new WalkingPapersTile(x, y, currentZoomLevel, this);
                     tileStorage.put(key, tile);
Index: waydownloader/src/org/openstreetmap/josm/plugins/waydownloader/WayDownloaderPlugin.java
===================================================================
--- waydownloader/src/org/openstreetmap/josm/plugins/waydownloader/WayDownloaderPlugin.java	(revision 29863)
+++ waydownloader/src/org/openstreetmap/josm/plugins/waydownloader/WayDownloaderPlugin.java	(working copy)
@@ -265,7 +265,7 @@
      */
     private Node findDuplicateNode(Node referenceNode) {
         DataSet ds = Main.main.getCurrentDataSet();
-        List<Node> candidates = ds.searchNodes(new BBox(new Bounds(referenceNode.getCoor(), 0.0003, 0.0005)));
+        List<Node> candidates = ds.searchNodes(new Bounds(referenceNode.getCoor(), 0.0003, 0.0005).toBBox());
         for (Node candidate: candidates) {
             if (!candidate.equals(referenceNode)
                     && !candidate.isIncomplete()
