Index: /trunk/src/org/openstreetmap/josm/actions/JumpToAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/JumpToAction.java	(revision 6202)
+++ /trunk/src/org/openstreetmap/josm/actions/JumpToAction.java	(revision 6203)
@@ -127,6 +127,6 @@
         Bounds b = OsmUrlToBounds.parse(url.getText());
         if (b != null) {
-            lat.setText(Double.toString((b.getMin().lat() + b.getMax().lat())/2));
-            lon.setText(Double.toString((b.getMin().lon() + b.getMax().lon())/2));
+            lat.setText(Double.toString((b.getMinLat() + b.getMaxLat())/2));
+            lon.setText(Double.toString((b.getMinLon() + b.getMaxLon())/2));
 
             int zoomLvl = 16;
Index: /trunk/src/org/openstreetmap/josm/data/Bounds.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/Bounds.java	(revision 6202)
+++ /trunk/src/org/openstreetmap/josm/data/Bounds.java	(revision 6203)
@@ -9,4 +9,5 @@
 
 import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.osm.BBox;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 
@@ -27,6 +28,46 @@
     }
 
+    /**
+     * Returns min latitude of bounds. Efficient shortcut for {@code getMin().lat()}.
+     * 
+     * @return min latitude of bounds.
+     * @since 6203
+     */
+    public double getMinLat() {
+        return minLat;
+    }
+
+    /**
+     * Returns min longitude of bounds. Efficient shortcut for {@code getMin().lon()}.
+     * 
+     * @return min longitude of bounds.
+     * @since 6203
+     */
+    public double getMinLon() {
+        return minLon;
+    }
+
     public LatLon getMax() {
         return new LatLon(maxLat, maxLon);
+    }
+
+    /**
+     * Returns max latitude of bounds. Efficient shortcut for {@code getMax().lat()}.
+     * 
+     * @return max latitude of bounds.
+     * @since 6203
+     */
+    public double getMaxLat() {
+        return maxLat;
+    }
+
+    /**
+     * Returns max longitude of bounds. Efficient shortcut for {@code getMax().lon()}.
+     * 
+     * @return max longitude of bounds.
+     * @since 6203
+     */
+    public double getMaxLon() {
+        return maxLon;
     }
 
@@ -37,5 +78,5 @@
 
     /**
-     * Construct bounds out of two points
+     * Construct bounds out of two points. Coords will be rounded.
      */
     public Bounds(LatLon min, LatLon max) {
@@ -51,12 +92,32 @@
     }
 
+    /**
+     * Single point Bounds defined by lat/lon {@code b}.
+     * Coordinates will be rounded to osm precision if {@code roundToOsmPrecision} is true.
+     * 
+     * @param b lat/lon of given point.
+     * @param roundToOsmPrecision defines if lat/lon will be rounded.
+     */
     public Bounds(LatLon b, boolean roundToOsmPrecision) {
+        this(b.lat(), b.lon(), roundToOsmPrecision);
+    }
+    
+    /**
+     * Single point Bounds defined by point [lat,lon].
+     * Coordinates will be rounded to osm precision if {@code roundToOsmPrecision} is true.
+     * 
+     * @param lat latitude of given point.
+     * @param lon longitude of given point.
+     * @param roundToOsmPrecision defines if lat/lon will be rounded.
+     * @since 6203
+     */
+    public Bounds(double lat, double lon, boolean roundToOsmPrecision) {
         // Do not call this(b, b) to avoid GPX performance issue (see #7028) until roundToOsmPrecision() is improved
         if (roundToOsmPrecision) {
-            this.minLat = LatLon.roundToOsmPrecision(b.lat());
-            this.minLon = LatLon.roundToOsmPrecision(b.lon());
-        } else {
-            this.minLat = b.lat();
-            this.minLon = b.lon();
+            this.minLat = LatLon.roundToOsmPrecision(lat);
+            this.minLon = LatLon.roundToOsmPrecision(lon);
+        } else {
+            this.minLat = lat;
+            this.minLon = lon;
         }
         this.maxLat = this.minLat;
@@ -153,6 +214,10 @@
     }
 
-    public Bounds(Bounds other) {
-        this(other.getMin(), other.getMax());
+    /**
+     * Creates new {@code Bounds} from an existing one.
+     * @param other The bounds to copy
+     */
+    public Bounds(final Bounds other) {
+        this(other.minLat, other.minLon, other.maxLat, other.maxLon);
     }
 
@@ -186,4 +251,14 @@
     }
 
+    /**
+     * Creates BBox with same coordinates.
+     * 
+     * @return BBox with same coordinates.
+     * @since 6203
+     */
+    public BBox toBBox() {
+        return new BBox(minLon, minLat, maxLon, maxLat);
+    }
+    
     @Override public String toString() {
         return "Bounds["+minLat+","+minLon+","+maxLat+","+maxLon+"]";
@@ -203,39 +278,52 @@
     public LatLon getCenter()
     {
+        if (crosses180thMeridian()) {            
+            double lat = (minLat + maxLat) / 2;
+            double lon = (minLon + maxLon - 360.0) / 2;
+            if (lon < -180.0){
+                lon += 360.0;
+            }
+            return new LatLon(lat, lon);
+        } else {
+            return new LatLon((minLat + maxLat) / 2, (minLon + maxLon) / 2);
+        }
+    }
+
+    /**
+     * Extend the bounds if necessary to include the given point.
+     * @param ll The point to include into these bounds
+     */
+    public void extend(LatLon ll) {
+        extend(ll.lat(), ll.lon());
+    }
+    
+    /**
+     * Extend the bounds if necessary to include the given point [lat,lon].
+     * Good to use if you know coordinates to avoid creation of LatLon object.
+     * @param lat Latitude of point to include into these bounds
+     * @param lon Longitude of point to include into these bounds
+     * @since 6203
+     */
+    public void extend(final double lat, final double lon) {
+        if (lat < minLat) {
+            minLat = LatLon.roundToOsmPrecision(lat);
+        }
+        if (lat > maxLat) {
+            maxLat = LatLon.roundToOsmPrecision(lat);
+        }
         if (crosses180thMeridian()) {
-            LatLon result = new LatLon(minLat, minLon-360.0).getCenter(getMax());
-            if (result.lon() < -180.0) {
-                result = new LatLon(result.lat(), result.lon() + 360.0);
-            }
-            return result;
-        } else {
-            return getMin().getCenter(getMax());
-        }
-    }
-
-    /**
-     * Extend the bounds if necessary to include the given point.
-     */
-    public void extend(LatLon ll) {
-        if (ll.lat() < minLat) {
-            minLat = LatLon.roundToOsmPrecision(ll.lat());
-        }
-        if (ll.lat() > maxLat) {
-            maxLat = LatLon.roundToOsmPrecision(ll.lat());
-        }
-        if (crosses180thMeridian()) {
-            if (ll.lon() > maxLon && ll.lon() < minLon) {
-                if (Math.abs(ll.lon() - minLon) <= Math.abs(ll.lon() - maxLon)) {
-                    minLon = LatLon.roundToOsmPrecision(ll.lon());
+            if (lon > maxLon && lon < minLon) {
+                if (Math.abs(lon - minLon) <= Math.abs(lon - maxLon)) {
+                    minLon = LatLon.roundToOsmPrecision(lon);
                 } else {
-                    maxLon = LatLon.roundToOsmPrecision(ll.lon());
+                    maxLon = LatLon.roundToOsmPrecision(lon);
                 }
             }
         } else {
-            if (ll.lon() < minLon) {
-                minLon = LatLon.roundToOsmPrecision(ll.lon());
+            if (lon < minLon) {
+                minLon = LatLon.roundToOsmPrecision(lon);
             }
-            if (ll.lon() > maxLon) {
-                maxLon = LatLon.roundToOsmPrecision(ll.lon());
+            if (lon > maxLon) {
+                maxLon = LatLon.roundToOsmPrecision(lon);
             }
         }
@@ -243,10 +331,12 @@
 
     public void extend(Bounds b) {
-        extend(b.getMin());
-        extend(b.getMax());
-    }
-
-    /**
-     * Is the given point within this bounds?
+        extend(b.minLat, b.minLon);
+        extend(b.maxLat, b.maxLon);
+    }
+
+    /**
+     * Determines if the given point {@code ll} is within these bounds.
+     * @param ll The lat/lon to check
+     * @return {@code true} if {@code ll} is within these bounds, {@code false} otherwise
      */
     public boolean contains(LatLon ll) {
@@ -324,5 +414,5 @@
      */
     public boolean isCollapsed() {
-        return getMin().equals(getMax());
+        return (minLat == maxLat) && (minLon == maxLon);
     }
 
Index: /trunk/src/org/openstreetmap/josm/data/coor/Coordinate.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/coor/Coordinate.java	(revision 6202)
+++ /trunk/src/org/openstreetmap/josm/data/coor/Coordinate.java	(revision 6203)
@@ -3,4 +3,6 @@
 
 import java.io.Serializable;
+
+import org.openstreetmap.josm.data.osm.BBox;
 
 /**
@@ -89,4 +91,26 @@
     }
 
+    /**
+     * Converts to single point BBox.
+     * 
+     * @return single point BBox defined by this coordinate.
+     * @since 6203
+     */
+    public BBox toBBox() {
+        return new BBox(x, y);
+    }
+    
+    /**
+     * Creates bbox around this coordinate. Coordinate defines
+     * center of bbox, its edge will be 2*r.
+     * 
+     * @param r size
+     * @return BBox around this coordinate
+     * @since 6203
+     */
+    public BBox toBBox(final double r) {
+        return new BBox(x - r, y - r, x + r, y + r);
+    }
+
     @Override
     public int hashCode() {
Index: /trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/coor/LatLon.java	(revision 6202)
+++ /trunk/src/org/openstreetmap/josm/data/coor/LatLon.java	(revision 6203)
@@ -216,6 +216,6 @@
     public boolean isOutSideWorld() {
         Bounds b = Main.getProjection().getWorldBoundsLatLon();
-        return lat() < b.getMin().lat() || lat() > b.getMax().lat() ||
-                lon() < b.getMin().lon() || lon() > b.getMax().lon();
+        return lat() < b.getMinLat() || lat() > b.getMaxLat() ||
+                lon() < b.getMinLon() || lon() > b.getMaxLon();
     }
 
Index: /trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java	(revision 6202)
+++ /trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java	(revision 6203)
@@ -51,6 +51,6 @@
      * because a lot of GPX waypoints are created when GPS tracks are downloaded from the OSM server.
      */
-    private double lat = 0;
-    private double lon = 0;
+    private final double lat;
+    private final double lon;
 
     /*
Index: /trunk/src/org/openstreetmap/josm/data/osm/BBox.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/BBox.java	(revision 6202)
+++ /trunk/src/org/openstreetmap/josm/data/osm/BBox.java	(revision 6203)
@@ -4,5 +4,4 @@
 import java.util.Arrays;
 
-import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.coor.QuadTiling;
@@ -16,14 +15,33 @@
     private double ymax = Double.NEGATIVE_INFINITY;
 
-    public BBox(Bounds bounds) {
-        add(bounds.getMin());
-        add(bounds.getMax());
-    }
-
+    /**
+     * Constructs a new {@code BBox} defined by a single point.
+     * 
+     * @param x X coordinate
+     * @param y Y coordinate
+     * @since 6203
+     */
+    public BBox(final double x, final double y) {
+        xmax = xmin = x;
+        ymax = ymin = y;
+        sanity();
+    }
+
+    /**
+     * Constructs a new {@code BBox} defined by points <code>a</code> and <code>b</code>.
+     * Result is minimal BBox containing both points.
+     * 
+     * @param a 
+     * @param b
+     */
     public BBox(LatLon a, LatLon b) {
-        add(a);
-        add(b);
-    }
-
+        this(a.lon(), a.lat(), b.lon(), b.lat());
+    }
+
+    /**
+     * Constructs a new {@code BBox} from another one.
+     * 
+     * @param copy the BBox to copy
+     */
     public BBox(BBox copy) {
         this.xmin = copy.xmin;
@@ -34,8 +52,21 @@
 
     public BBox(double a_x, double a_y, double b_x, double b_y)  {
-        xmin = Math.min(a_x, b_x);
-        xmax = Math.max(a_x, b_x);
-        ymin = Math.min(a_y, b_y);
-        ymax = Math.max(a_y, b_y);
+        
+        if (a_x > b_x) {
+            xmax = a_x;
+            xmin = b_x;
+        } else {
+            xmax = b_x;
+            xmin = a_x;
+        }
+        
+        if (a_y > b_y) {
+            ymax = a_y;
+            ymin = b_y;
+        } else {
+            ymax = b_y;
+            ymin = a_y;
+        }
+        
         sanity();
     }
@@ -84,14 +115,26 @@
      */
     public void add(double x, double y) {
-        xmin = Math.min(xmin, x);
-        xmax = Math.max(xmax, x);
-        ymin = Math.min(ymin, y);
-        ymax = Math.max(ymax, y);
+        
+        if (x < xmin) {
+            xmin = x;
+        } else if (x > xmax) {
+            xmax = x;
+        }
+        
+        if (y < ymin) {
+            ymin = y;
+        } else if (y > ymax) {
+            ymax = y;
+        }
+
         sanity();
     }
 
     public void add(BBox box) {
-        add(box.getTopLeft());
-        add(box.getBottomRight());
+        xmin = Math.min(xmin, box.xmin);
+        xmax = Math.max(xmax, box.xmax);
+        ymin = Math.min(ymin, box.ymin);
+        ymax = Math.max(ymax, box.ymax);
+        sanity();
     }
 
@@ -151,10 +194,54 @@
     }
 
+    /**
+     * Returns the top-left point.
+     * @return The top-left point
+     */
     public LatLon getTopLeft() {
         return new LatLon(ymax, xmin);
     }
 
+    /**
+     * Returns the latitude of top-left point.
+     * @return The latitude of top-left point
+     * @since 6203
+     */
+    public double getTopLeftLat() {
+        return ymax;
+    }
+
+    /**
+     * Returns the longitude of top-left point.
+     * @return The longitude of top-left point
+     * @since 6203
+     */
+    public double getTopLeftLon() {
+        return xmin;
+    }
+
+    /**
+     * Returns the bottom-right point.
+     * @return The bottom-right point
+     */
     public LatLon getBottomRight() {
         return new LatLon(ymin, xmax);
+    }
+
+    /**
+     * Returns the latitude of bottom-right point.
+     * @return The latitude of bottom-right point
+     * @since 6203
+     */
+    public double getBottomRightLat() {
+        return ymin;
+    }
+
+    /**
+     * Returns the longitude of bottom-right point.
+     * @return The longitude of bottom-right point
+     * @since 6203
+     */
+    public double getBottomRightLon() {
+        return xmax;
     }
 
Index: /trunk/src/org/openstreetmap/josm/data/osm/DatasetConsistencyTest.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/DatasetConsistencyTest.java	(revision 6202)
+++ /trunk/src/org/openstreetmap/josm/data/osm/DatasetConsistencyTest.java	(revision 6203)
@@ -81,5 +81,5 @@
                 LatLon c = n.getCoor();
                 if (c != null) {
-                    BBox box = new BBox(new LatLon(c.lat() - 0.0001, c.lon() - 0.0001), new LatLon(c.lat() + 0.0001, c.lon() + 0.0001));
+                    BBox box = c.toBBox(0.0001);
                     if (!dataSet.searchNodes(box).contains(n)) {
                         printError("SEARCH NODES", "%s not found using Dataset.searchNodes()", n);
Index: /trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java	(revision 6202)
+++ /trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java	(revision 6203)
@@ -117,6 +117,5 @@
             double lat = bottom_left.lat() + parent.height() / 2;
             double lon = bottom_left.lon() + parent.width() / 2;
-            LatLon top_right = new LatLon(lat, lon);
-            return new BBox(bottom_left, top_right);
+            return new BBox(bottom_left.lon(), bottom_left.lat(), lon, lat);
         }
 
Index: /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java	(revision 6202)
+++ /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java	(revision 6203)
@@ -1404,5 +1404,5 @@
     public void render(final DataSet data, boolean renderVirtualNodes, Bounds bounds) {
         //long start = System.currentTimeMillis();
-        BBox bbox = new BBox(bounds);
+        BBox bbox = bounds.toBBox();
         getSettings(renderVirtualNodes);
 
Index: /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java	(revision 6202)
+++ /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java	(revision 6203)
@@ -157,5 +157,5 @@
     @Override
     public void render(DataSet data, boolean virtual, Bounds bounds) {
-        BBox bbox = new BBox(bounds);
+        BBox bbox = bounds.toBBox();
         this.ds = data;
         getSettings(virtual);
Index: /trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java	(revision 6202)
+++ /trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java	(revision 6203)
@@ -124,6 +124,6 @@
             proj = new Mercator();
             bounds = new Bounds(
-                    new LatLon(-85.05112877980659, -180.0),
-                    new LatLon(85.05112877980659, 180.0), true);
+                    -85.05112877980659, -180.0,
+                    85.05112877980659, 180.0, true);
         } else {
             Map<String, String> parameters = parseParameterList(pref);
Index: /trunk/src/org/openstreetmap/josm/gui/BookmarkList.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/BookmarkList.java	(revision 6202)
+++ /trunk/src/org/openstreetmap/josm/gui/BookmarkList.java	(revision 6203)
@@ -184,8 +184,8 @@
             array[0] = b.getName();
             Bounds area = b.getArea();
-            array[1] = String.valueOf(area.getMin().lat());
-            array[2] = String.valueOf(area.getMin().lon());
-            array[3] = String.valueOf(area.getMax().lat());
-            array[4] = String.valueOf(area.getMax().lon());
+            array[1] = String.valueOf(area.getMinLat());
+            array[2] = String.valueOf(area.getMinLon());
+            array[3] = String.valueOf(area.getMaxLat());
+            array[4] = String.valueOf(area.getMaxLon());
             coll.add(Arrays.asList(array));
         }
@@ -217,8 +217,8 @@
             StringBuffer sb = new StringBuffer();
             sb.append("<html>min[latitude,longitude]=<strong>[")
-            .append(area.getMin().lat()).append(",").append(area.getMin().lon()).append("]</strong>")
+            .append(area.getMinLat()).append(",").append(area.getMinLon()).append("]</strong>")
             .append("<br>")
             .append("max[latitude,longitude]=<strong>[")
-            .append(area.getMax().lat()).append(",").append(area.getMax().lon()).append("]</strong>")
+            .append(area.getMaxLat()).append(",").append(area.getMaxLon()).append("]</strong>")
             .append("</html>");
             return sb.toString();
Index: /trunk/src/org/openstreetmap/josm/gui/MapView.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 6202)
+++ /trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 6203)
@@ -636,6 +636,6 @@
         tempG.setColor(Color.WHITE);
         Bounds b = getProjection().getWorldBoundsLatLon();
-        double lat = b.getMin().lat();
-        double lon = b.getMin().lon();
+        double lat = b.getMinLat();
+        double lon = b.getMinLon();
 
         Point p = getPoint(b.getMin());
@@ -656,5 +656,5 @@
             path.lineTo(p.x, p.y);
         }
-        lon = max; max = b.getMin().lat();
+        lon = max; max = b.getMinLat();
         for(; lat >= max; lat -= 1.0)
         {
@@ -662,5 +662,5 @@
             path.lineTo(p.x, p.y);
         }
-        lat = max; max = b.getMin().lon();
+        lat = max; max = b.getMinLon();
         for(; lon >= max; lon -= 1.0)
         {
Index: /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 6202)
+++ /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 6203)
@@ -201,7 +201,7 @@
     private EastNorth calculateDefaultCenter() {
         Bounds b = Main.getProjection().getWorldBoundsLatLon();
-        double lat = (b.getMax().lat() + b.getMin().lat())/2;
-        double lon = (b.getMax().lon() + b.getMin().lon())/2;
-
+        double lat = (b.getMaxLat() + b.getMinLat())/2;
+        double lon = (b.getMaxLon() + b.getMinLon())/2;
+        // FIXME is it correct? b.getCenter() makes some adjustments... 
         return Main.getProjection().latlon2eastNorth(new LatLon(lat, lon));
     }
@@ -401,8 +401,8 @@
         double lat = cl.lat();
         double lon = cl.lon();
-        if(lat < b.getMin().lat()) {changed = true; lat = b.getMin().lat(); }
-        else if(lat > b.getMax().lat()) {changed = true; lat = b.getMax().lat(); }
-        if(lon < b.getMin().lon()) {changed = true; lon = b.getMin().lon(); }
-        else if(lon > b.getMax().lon()) {changed = true; lon = b.getMax().lon(); }
+        if(lat < b.getMinLat()) {changed = true; lat = b.getMinLat(); }
+        else if(lat > b.getMaxLat()) {changed = true; lat = b.getMaxLat(); }
+        if(lon < b.getMinLon()) {changed = true; lon = b.getMinLon(); }
+        else if(lon > b.getMaxLon()) {changed = true; lon = b.getMaxLon(); }
         if(changed) {
             newCenter = Projections.project(new LatLon(lat,lon));
@@ -410,6 +410,6 @@
         int width = getWidth()/2;
         int height = getHeight()/2;
-        LatLon l1 = new LatLon(b.getMin().lat(), lon);
-        LatLon l2 = new LatLon(b.getMax().lat(), lon);
+        LatLon l1 = new LatLon(b.getMinLat(), lon);
+        LatLon l2 = new LatLon(b.getMaxLat(), lon);
         EastNorth e1 = getProjection().latlon2eastNorth(l1);
         EastNorth e2 = getProjection().latlon2eastNorth(l2);
@@ -418,6 +418,6 @@
         {
             double newScaleH = d/height;
-            e1 = getProjection().latlon2eastNorth(new LatLon(lat, b.getMin().lon()));
-            e2 = getProjection().latlon2eastNorth(new LatLon(lat, b.getMax().lon()));
+            e1 = getProjection().latlon2eastNorth(new LatLon(lat, b.getMinLon()));
+            e2 = getProjection().latlon2eastNorth(new LatLon(lat, b.getMaxLon()));
             d = e2.east() - e1.east();
             if(d < width*newScale) {
Index: /trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java	(revision 6202)
+++ /trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java	(revision 6203)
@@ -353,6 +353,6 @@
     @Override
     public void setBoundingBox(Bounds bbox) {
-        if (bbox == null || (bbox.getMin().lat() == 0.0 && bbox.getMin().lon() == 0.0
-                && bbox.getMax().lat() == 0.0 && bbox.getMax().lon() == 0.0)) {
+        if (bbox == null || (bbox.getMinLat() == 0.0 && bbox.getMinLon() == 0.0
+                && bbox.getMaxLat() == 0.0 && bbox.getMaxLon() == 0.0)) {
             this.bbox = null;
             iSelectionRectStart = null;
@@ -363,6 +363,6 @@
 
         this.bbox = bbox;
-        double minLon = bbox.getMin().lon();
-        double maxLon = bbox.getMax().lon();
+        double minLon = bbox.getMinLon();
+        double maxLon = bbox.getMaxLon();
 
         if (bbox.crosses180thMeridian()) {
@@ -370,6 +370,6 @@
         }
 
-        int y1 = OsmMercator.LatToY(bbox.getMin().lat(), MAX_ZOOM);
-        int y2 = OsmMercator.LatToY(bbox.getMax().lat(), MAX_ZOOM);
+        int y1 = OsmMercator.LatToY(bbox.getMinLat(), MAX_ZOOM);
+        int y2 = OsmMercator.LatToY(bbox.getMaxLat(), MAX_ZOOM);
         int x1 = OsmMercator.LonToX(minLon, MAX_ZOOM);
         int x2 = OsmMercator.LonToX(maxLon, MAX_ZOOM);
@@ -379,6 +379,6 @@
 
         // calc the screen coordinates for the new selection rectangle
-        MapMarkerDot xmin_ymin = new MapMarkerDot(bbox.getMin().lat(), bbox.getMin().lon());
-        MapMarkerDot xmax_ymax = new MapMarkerDot(bbox.getMax().lat(), bbox.getMax().lon());
+        MapMarkerDot xmin_ymin = new MapMarkerDot(bbox.getMinLat(), bbox.getMinLon());
+        MapMarkerDot xmax_ymax = new MapMarkerDot(bbox.getMaxLat(), bbox.getMaxLon());
 
         Vector<MapMarker> marker = new Vector<MapMarker>(2);
Index: /trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java	(revision 6202)
+++ /trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java	(revision 6203)
@@ -153,6 +153,6 @@
 
         // calc the screen coordinates for the new selection rectangle
-        MapMarkerDot xmin_ymin = new MapMarkerDot(bbox.getMin().lat(), bbox.getMin().lon());
-        MapMarkerDot xmax_ymax = new MapMarkerDot(bbox.getMax().lat(), bbox.getMax().lon());
+        MapMarkerDot xmin_ymin = new MapMarkerDot(bbox.getMinLat(), bbox.getMinLon());
+        MapMarkerDot xmax_ymax = new MapMarkerDot(bbox.getMaxLat(), bbox.getMaxLon());
 
         Vector<MapMarker> marker = new Vector<MapMarker>(2);
@@ -342,10 +342,10 @@
             tb.zoomLevel = (Integer) spZoomLevel.getValue();
             tb.min = new Point(
-                    Math.max(0,lonToTileX(tb.zoomLevel, bbox.getMin().lon())),
-                    Math.max(0,latToTileY(tb.zoomLevel, bbox.getMax().lat()-.00001))
+                    Math.max(0,lonToTileX(tb.zoomLevel, bbox.getMinLon())),
+                    Math.max(0,latToTileY(tb.zoomLevel, bbox.getMaxLat() - 0.00001))
             );
             tb.max = new Point(
-                    Math.max(0,lonToTileX(tb.zoomLevel, bbox.getMax().lon())),
-                    Math.max(0,latToTileY(tb.zoomLevel, bbox.getMin().lat()-.00001))
+                    Math.max(0,lonToTileX(tb.zoomLevel, bbox.getMaxLon())),
+                    Math.max(0,latToTileY(tb.zoomLevel, bbox.getMinLat() - 0.00001))
             );
             doFireTileBoundChanged = false;
@@ -682,8 +682,8 @@
                 max = null;
             } else {
-                int y1 = OsmMercator.LatToY(bbox.getMin().lat(), MAX_ZOOM);
-                int y2 = OsmMercator.LatToY(bbox.getMax().lat(), MAX_ZOOM);
-                int x1 = OsmMercator.LonToX(bbox.getMin().lon(), MAX_ZOOM);
-                int x2 = OsmMercator.LonToX(bbox.getMax().lon(), MAX_ZOOM);
+                int y1 = OsmMercator.LatToY(bbox.getMinLat(), MAX_ZOOM);
+                int y2 = OsmMercator.LatToY(bbox.getMaxLat(), MAX_ZOOM);
+                int x1 = OsmMercator.LonToX(bbox.getMinLon(), MAX_ZOOM);
+                int x2 = OsmMercator.LonToX(bbox.getMaxLon(), MAX_ZOOM);
 
                 min = new Point(Math.min(x1, x2), Math.min(y1, y2));
Index: /trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java	(revision 6202)
+++ /trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java	(revision 6203)
@@ -23,5 +23,4 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
-import org.openstreetmap.josm.data.osm.BBox;
 import org.openstreetmap.josm.gui.BookmarkList;
 import org.openstreetmap.josm.gui.BookmarkList.Bookmark;
@@ -154,5 +153,5 @@
         } else {
             lblCurrentDownloadArea.setText(tr("<html><strong>Current download area</strong> (minlon, minlat, maxlon, maxlat): </html>"));
-            bboxDisplay.setText(new BBox(currentArea).toStringCSV(","));
+            bboxDisplay.setText(currentArea.toBBox().toStringCSV(","));
         }
     }
Index: /trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java	(revision 6202)
+++ /trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java	(revision 6203)
@@ -242,6 +242,6 @@
                     String[] bbox = atts.getValue("boundingbox").split(",");
                     currentResult.bounds = new Bounds(
-                            new LatLon(Double.parseDouble(bbox[0]), Double.parseDouble(bbox[2])),
-                            new LatLon(Double.parseDouble(bbox[1]), Double.parseDouble(bbox[3])));
+                            Double.parseDouble(bbox[0]), Double.parseDouble(bbox[2]),
+                            Double.parseDouble(bbox[1]), Double.parseDouble(bbox[3]));
                     data.add(currentResult);
                 }
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java	(revision 6202)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java	(revision 6203)
@@ -399,6 +399,6 @@
                             if (!mapRectangles.containsKey(i)) {
                                 // Add new map rectangle
-                                Coordinate topLeft = new Coordinate(bounds.getMax().lat(), bounds.getMin().lon());
-                                Coordinate bottomRight = new Coordinate(bounds.getMin().lat(), bounds.getMax().lon());
+                                Coordinate topLeft = new Coordinate(bounds.getMaxLat(), bounds.getMinLon());
+                                Coordinate bottomRight = new Coordinate(bounds.getMinLat(), bounds.getMaxLon());
                                 MapRectangle rectangle = new MapRectangleImpl(topLeft, bottomRight);
                                 mapRectangles.put(i, rectangle);
Index: /trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java	(revision 6202)
+++ /trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java	(revision 6203)
@@ -26,8 +26,8 @@
 
     public BoundingBoxDownloader(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();
         this.crosses180th = downloadArea.crosses180thMeridian();
     }
Index: /trunk/src/org/openstreetmap/josm/io/GpxWriter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/GpxWriter.java	(revision 6202)
+++ /trunk/src/org/openstreetmap/josm/io/GpxWriter.java	(revision 6203)
@@ -157,6 +157,6 @@
         Bounds bounds = data.recalculateBounds();
         if (bounds != null) {
-            String b = "minlat=\"" + bounds.getMin().lat() + "\" minlon=\"" + bounds.getMin().lon() +
-            "\" maxlat=\"" + bounds.getMax().lat() + "\" maxlon=\"" + bounds.getMax().lon() + "\"" ;
+            String b = "minlat=\"" + bounds.getMinLat() + "\" minlon=\"" + bounds.getMinLon() +
+            "\" maxlat=\"" + bounds.getMaxLat() + "\" maxlon=\"" + bounds.getMaxLon() + "\"" ;
             inline("bounds", b);
         }
Index: /trunk/src/org/openstreetmap/josm/io/OsmWriter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmWriter.java	(revision 6202)
+++ /trunk/src/org/openstreetmap/josm/io/OsmWriter.java	(revision 6203)
@@ -163,8 +163,8 @@
         for (DataSource s : ds.dataSources) {
             out.println("  <bounds minlat='"
-                    + s.bounds.getMin().lat()+"' minlon='"
-                    + s.bounds.getMin().lon()+"' maxlat='"
-                    + s.bounds.getMax().lat()+"' maxlon='"
-                    + s.bounds.getMax().lon()
+                    + s.bounds.getMinLat()+"' minlon='"
+                    + s.bounds.getMinLon()+"' maxlat='"
+                    + s.bounds.getMaxLat()+"' maxlon='"
+                    + s.bounds.getMaxLon()
                     +"' origin='"+XmlWriter.encode(s.origin)+"' />");
         }
Index: /trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java	(revision 6202)
+++ /trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java	(revision 6203)
@@ -159,5 +159,5 @@
         }
 
-        final Bounds bbox = new Bounds(new LatLon(minlat, minlon), new LatLon(maxlat, maxlon));
+        final Bounds bbox = new Bounds(minlat, minlon, maxlat, maxlon);
         if (args.containsKey("select") && PermissionPrefWithDefault.CHANGE_SELECTION.isAllowed()) {
             // select objects after downloading, zoom to selection.
Index: /trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java	(revision 6202)
+++ /trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java	(revision 6203)
@@ -50,16 +50,12 @@
                 String[] bbox = map.get("bbox").split(",");
                 b = new Bounds(
-                        new LatLon(Double.parseDouble(bbox[1]), Double.parseDouble(bbox[0])),
-                        new LatLon(Double.parseDouble(bbox[3]), Double.parseDouble(bbox[2])));
+                        Double.parseDouble(bbox[1]), Double.parseDouble(bbox[0]),
+                        Double.parseDouble(bbox[3]), Double.parseDouble(bbox[2]));
             } else if (map.containsKey("minlat")) {
-                String s = map.get("minlat");
-                Double minlat = Double.parseDouble(s);
-                s = map.get("minlon");
-                Double minlon = Double.parseDouble(s);
-                s = map.get("maxlat");
-                Double maxlat = Double.parseDouble(s);
-                s = map.get("maxlon");
-                Double maxlon = Double.parseDouble(s);
-                b = new Bounds(new LatLon(minlat, minlon), new LatLon(maxlat, maxlon));
+                double minlat = Double.parseDouble(map.get("minlat"));
+                double minlon = Double.parseDouble(map.get("minlon"));
+                double maxlat = Double.parseDouble(map.get("maxlat"));
+                double maxlon = Double.parseDouble(map.get("maxlon"));
+                b = new Bounds(minlat, minlon, maxlat, maxlon);
             } else {
                 String z = map.get("zoom");
@@ -234,7 +230,7 @@
     static public int getZoom(Bounds b) {
         // convert to mercator (for calculation of zoom only)
-        double latMin = Math.log(Math.tan(Math.PI/4.0+b.getMin().lat()/180.0*Math.PI/2.0))*180.0/Math.PI;
-        double latMax = Math.log(Math.tan(Math.PI/4.0+b.getMax().lat()/180.0*Math.PI/2.0))*180.0/Math.PI;
-        double size = Math.max(Math.abs(latMax-latMin), Math.abs(b.getMax().lon()-b.getMin().lon()));
+        double latMin = Math.log(Math.tan(Math.PI/4.0+b.getMinLat()/180.0*Math.PI/2.0))*180.0/Math.PI;
+        double latMax = Math.log(Math.tan(Math.PI/4.0+b.getMaxLat()/180.0*Math.PI/2.0))*180.0/Math.PI;
+        double size = Math.max(Math.abs(latMax-latMin), Math.abs(b.getMaxLon()-b.getMinLon()));
         int zoom = 0;
         while (zoom <= 20) {
