Ignore:
Timestamp:
11.05.2010 09:25:21 (2 years ago)
Author:
jttt
Message:

Fix #2297 JOSM Webstart fails at loading plugins, cleanup puwg projection

File:
1 edited

Legend:

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

    r3083 r3232  
    123123    public Collection<String> getPreferencesFromCode(String code) 
    124124    { 
    125         for (Projection p : Puwg.Zones) 
     125        for (PuwgData p : Puwg.Zones) 
    126126        { 
    127127            if(code.equals(p.toCode())) 
     
    151151} 
    152152 
    153 interface PuwgData extends Projection { 
    154     public double getPuwgCentralMeridianDeg(); 
    155     public double getPuwgCentralMeridian(); 
    156     public double getPuwgFalseEasting(); 
    157     public double getPuwgFalseNorthing(); 
    158     public double getPuwgScaleFactor(); 
     153interface PuwgData { 
     154    double getPuwgCentralMeridianDeg(); 
     155    double getPuwgCentralMeridian(); 
     156    double getPuwgFalseEasting(); 
     157    double getPuwgFalseNorthing(); 
     158    double getPuwgScaleFactor(); 
     159 
     160    // Projection methods 
     161    String toCode(); 
     162    String getCacheDirectoryName(); 
     163    Bounds getWorldBoundsLatLon(); 
    159164} 
    160165 
     
    165170    private static final double Epsg2180ScaleFactor = 0.9993; 
    166171    private static final double Epsg2180CentralMeridian = 19.0; 
    167     private static DecimalFormat decFormatter = new DecimalFormat("###0"); 
    168172 
    169173    @Override public String toString() { 
     
    185189                new LatLon(54.84, 24.15)); 
    186190    } 
    187  
    188     /* These two MUST NOT be used. Use Puwg implementation instead. */ 
    189     public EastNorth latlon2eastNorth(LatLon p) { return null; } 
    190     public LatLon eastNorth2latlon(EastNorth p) { return null; } 
    191191 
    192192    public double getPuwgCentralMeridianDeg() { return Epsg2180CentralMeridian; } 
     
    195195    public double getPuwgFalseNorthing() { return Epsg2180FalseNorthing; } 
    196196    public double getPuwgScaleFactor() { return Epsg2180ScaleFactor; } 
    197  
    198     public double getDefaultZoomInPPD() { 
    199         // This will set the scale bar to about 100 km 
    200         return 0.009; 
    201     } 
    202  
    203     public String eastToString(EastNorth p) { 
    204         return decFormatter.format(p.east()); 
    205     } 
    206  
    207     public String northToString(EastNorth p) { 
    208         return decFormatter.format(p.north()); 
    209     } 
    210197} 
    211198 
     
    218205    final private String[] Puwg2000Code = { "EPSG:2176",  "EPSG:2177", "EPSG:2178", "EPSG:2179"}; 
    219206    final private String[] Puwg2000CDName = { "epsg2176",  "epsg2177", "epsg2178", "epsg2179"}; 
    220     private static DecimalFormat decFormatter = new DecimalFormat("###0.00"); 
    221207 
    222208    @Override public String toString() { 
     
    238224                new LatLon(54.84, (3 * getZone()) + 1.5)); 
    239225    } 
    240  
    241     /* These two MUST NOT be used. Use Puwg implementation instead. */ 
    242     public EastNorth latlon2eastNorth(LatLon p) { return null; } 
    243     public LatLon eastNorth2latlon(EastNorth p) { return null; } 
    244226 
    245227    public double getPuwgCentralMeridianDeg() { return getZone() * 3.0; } 
     
    252234    public int getZoneIndex() { return getZone() - 5; } 
    253235 
    254     public double getDefaultZoomInPPD() { 
    255         // This will set the scale bar to about 100 km 
    256         return 0.009; 
    257     } 
    258  
    259     public String eastToString(EastNorth p) { 
    260         return Integer.toString(getZone()) + decFormatter.format(p.east()); 
    261     } 
    262  
    263     public String northToString(EastNorth p) { 
    264         return decFormatter.format(p.north()); 
    265     } 
    266  
    267 } 
    268  
    269 class Epsg2176 extends Puwg2000 implements Projection { 
     236} 
     237 
     238class Epsg2176 extends Puwg2000 { 
    270239    private static final int PuwgZone = 5; 
    271240 
     
    274243} 
    275244 
    276 class Epsg2177 extends Puwg2000 implements Projection { 
     245class Epsg2177 extends Puwg2000 { 
    277246    private static final int PuwgZone = 6; 
    278247 
     
    281250} 
    282251 
    283 class Epsg2178 extends Puwg2000 implements Projection { 
     252class Epsg2178 extends Puwg2000 { 
    284253    private static final int PuwgZone = 7; 
    285254 
     
    288257} 
    289258 
    290 class Epsg2179 extends Puwg2000 implements Projection { 
     259class Epsg2179 extends Puwg2000 { 
    291260    private static final int PuwgZone = 8; 
    292261 
Note: See TracChangeset for help on using the changeset viewer.