Ignore:
Timestamp:
2009-07-26T22:52:23+02:00 (16 years ago)
Author:
Gubaer
Message:

replaced JOptionDialog.show... by OptionPaneUtil.show....
improved relation editor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/projection/Lambert.java

    r1849 r1857  
    1313import org.openstreetmap.josm.data.coor.LatLon;
    1414import org.openstreetmap.josm.data.Bounds;
     15import org.openstreetmap.josm.gui.OptionPaneUtil;
    1516
    1617public class Lambert implements Projection {
     
    5253
    5354    public static final double zoneLimits[] = { Math.toRadians(53.5 * 0.9), // between Zone 1 and Zone 2 (in grad *0.9)
    54             Math.toRadians(50.5 * 0.9), // between Zone 2 and Zone 3
    55             Math.toRadians(47.51963 * 0.9), // between Zone 3 and Zone 4
    56             Math.toRadians(46.17821 * 0.9) };// lowest latitude of Zone 4
     55        Math.toRadians(50.5 * 0.9), // between Zone 2 and Zone 3
     56        Math.toRadians(47.51963 * 0.9), // between Zone 3 and Zone 4
     57        Math.toRadians(46.17821 * 0.9) };// lowest latitude of Zone 4
    5758
    5859    public static final double cMinLonZones = Math.toRadians(-4.9074074074074059 * 0.9);
     
    8485        if (lt >= zoneLimits[3] && lt <= cMaxLatZone1 && lg >= cMinLonZones && lg <= cMaxLonZones) {
    8586            // zone I
    86             if (lt > zoneLimits[0])
     87            if (lt > zoneLimits[0]) {
    8788                currentZone = 0;
    88             // zone II
    89             else if (lt > zoneLimits[1])
     89            } else if (lt > zoneLimits[1]) {
    9090                currentZone = 1;
    91             // zone III
    92             else if (lt > zoneLimits[2])
     91            } else if (lt > zoneLimits[2]) {
    9392                currentZone = 2;
    94             // zone III or IV
    95             else if (lt > zoneLimits[3])
     93            } else if (lt > zoneLimits[3])
    9694                // Note: zone IV is dedicated to Corsica island and extends from 47.8 to
    9795                // 45.9 degrees of latitude. There is an overlap with zone III that can be
    9896                // solved only with longitude (covers Corsica if lon > 7.2 degree)
    99                 if (lg < Math.toRadians(8 * 0.9))
     97                if (lg < Math.toRadians(8 * 0.9)) {
    10098                    currentZone = 2;
    101                 else
     99                } else {
    102100                    currentZone = 3;
     101                }
    103102        } else {
    104103            outOfLambertZones = true; // possible when MAX_LAT is used
     
    109108            } else if (layoutZone != currentZone) {
    110109                if ((currentZone < layoutZone && Math.abs(zoneLimits[currentZone] - lt) > cMaxOverlappingZones)
    111                 || (currentZone > layoutZone && Math.abs(zoneLimits[layoutZone] - lt) > cMaxOverlappingZones)) {
    112                     JOptionPane.showMessageDialog(Main.parent,
    113                     tr("IMPORTANT : data positioned far away from\n"
    114                     + "the current Lambert zone limits.\n"
    115                     + "Do not upload any data after this message.\n"
    116                     + "Undo your last action, save your work\n"
    117                     + "and start a new layer on the new zone."));
     110                        || (currentZone > layoutZone && Math.abs(zoneLimits[layoutZone] - lt) > cMaxOverlappingZones)) {
     111                    OptionPaneUtil.showMessageDialog(Main.parent,
     112                            tr("IMPORTANT : data positioned far away from\n"
     113                                    + "the current Lambert zone limits.\n"
     114                                    + "Do not upload any data after this message.\n"
     115                                    + "Undo your last action, save your work\n"
     116                                    + "and start a new layer on the new zone."),
     117                                    tr("Warning"),
     118                                    JOptionPane.WARNING_MESSAGE);
    118119                    layoutZone = -1;
    119120                } else {
     
    130131    public LatLon eastNorth2latlon(EastNorth p) {
    131132        LatLon geo;
    132         if (layoutZone == -1)
     133        if (layoutZone == -1) {
    133134            // possible until the Lambert zone is determined by latlon2eastNorth() with a valid LatLon
    134135            geo = Geographic(p, Xs[currentZone], Ys[currentZone], c[currentZone], n[currentZone]);
    135         else
     136        } else {
    136137            geo = Geographic(p, Xs[layoutZone], Ys[layoutZone], c[layoutZone], n[layoutZone]);
     138        }
    137139        // translate ellipsoid Clark => GRS80 (WGS83)
    138140        LatLon wgs = Clark2GRS80(geo);
     
    197199            double eslt = Ellipsoid.clarke.e * Math.sin(lat);
    198200            double nlt = 2.0 * Math.atan(Math.pow((1.0 + eslt) / (1.0 - eslt), Ellipsoid.clarke.e / 2.0) * l) - Math.PI
    199                     / 2.0;
     201            / 2.0;
    200202            delta = Math.abs(nlt - lat);
    201203            lat = nlt;
     
    261263            s2 *= s2;
    262264            double l = Math.atan((Z / norm)
    263                 / (1.0 - (ell.a * ell.e2 * Math.cos(lt) / (norm * Math.sqrt(1.0 - ell.e2 * s2)))));
     265                    / (1.0 - (ell.a * ell.e2 * Math.cos(lt) / (norm * Math.sqrt(1.0 - ell.e2 * s2)))));
    264266            delta = Math.abs(l - lt);
    265267            lt = l;
Note: See TracChangeset for help on using the changeset viewer.