Changeset 12742 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2017-09-05T20:41:09+02:00 (7 years ago)
Author:
Don-vip
Message:

see #15229 - see #15182 - remove useless dependence of Geometry on GUI now that MultipolygonCache does not need anymore a MapView

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Geometry.java

    r12726 r12742  
    3535import org.openstreetmap.josm.data.projection.Projection;
    3636import org.openstreetmap.josm.data.projection.Projections;
    37 import org.openstreetmap.josm.gui.MainApplication;
    38 import org.openstreetmap.josm.gui.MapFrame;
    3937
    4038/**
     
    553551     */
    554552    public static Area getAreaLatLon(Relation multipolygon) {
    555         MapFrame map = MainApplication.getMap();
    556         final Multipolygon mp = map == null || map.mapView == null
    557                 ? new Multipolygon(multipolygon)
    558                 : MultipolygonCache.getInstance().get(multipolygon);
     553        final Multipolygon mp = MultipolygonCache.getInstance().get(multipolygon);
    559554        Path2D path = new Path2D.Double();
    560555        path.setWindingRule(Path2D.WIND_EVEN_ODD);
     
    694689    public static double multipolygonArea(Relation multipolygon) {
    695690        double area = 0.0;
    696         MapFrame map = MainApplication.getMap();
    697         final Multipolygon mp = map == null || map.mapView == null
    698                 ? new Multipolygon(multipolygon)
    699                 : MultipolygonCache.getInstance().get(multipolygon);
     691        final Multipolygon mp = MultipolygonCache.getInstance().get(multipolygon);
    700692        for (Multipolygon.PolyData pd : mp.getCombinedPolygons()) {
    701693            area += pd.getAreaAndPerimeter(Projections.getProjectionByCode("EPSG:54008")).getArea();
Note: See TracChangeset for help on using the changeset viewer.