Changeset 5539 in josm for trunk/src


Ignore:
Timestamp:
2012-10-22T21:44:47+02:00 (12 years ago)
Author:
Don-vip
Message:

Add projected bounding box to "inspect primitive" dialog

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java

    r5360 r5539  
    2424import org.openstreetmap.josm.Main;
    2525import org.openstreetmap.josm.data.conflict.Conflict;
     26import org.openstreetmap.josm.data.coor.EastNorth;
     27import org.openstreetmap.josm.data.osm.BBox;
    2628import org.openstreetmap.josm.data.osm.Node;
    2729import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    267269
    268270        void addBbox(OsmPrimitive o) {
    269             if (o.getBBox() != null) {
    270                 add(tr("Bounding box: "), o.getBBox().toStringCSV(", "));
     271            BBox bbox = o.getBBox();
     272            if (bbox != null) {
     273                add(tr("Bounding box: "), bbox.toStringCSV(", "));
     274                EastNorth bottomRigth = Main.getProjection().latlon2eastNorth(bbox.getBottomRight());
     275                EastNorth topLeft = Main.getProjection().latlon2eastNorth(bbox.getTopLeft());
     276                add(tr("Bounding box (projected): "),
     277                        Double.toString(topLeft.east()), ", ",
     278                        Double.toString(bottomRigth.north()), ", ",
     279                        Double.toString(bottomRigth.east()), ", ",
     280                        Double.toString(topLeft.north()));
    271281            }
    272282        }
Note: See TracChangeset for help on using the changeset viewer.