Changeset 2676 in josm for trunk/src/org/openstreetmap/josm/data/projection
- Timestamp:
- 2009-12-24T08:48:40+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/projection/Puwg.java
r2516 r2676 3 3 package org.openstreetmap.josm.data.projection; 4 4 5 import static org.openstreetmap.josm.tools.I18n.tr; 6 7 import java.awt.GridBagLayout; 5 8 import java.text.DecimalFormat; 6 7 import static org.openstreetmap.josm.tools.I18n.tr;8 9 import java.awt.GridBagLayout;10 9 import java.util.Collection; 11 10 import java.util.Collections; … … 40 39 private static DecimalFormat decFormatter = new DecimalFormat("###0"); 41 40 41 @Override 42 42 public EastNorth latlon2eastNorth(LatLon p) { 43 43 PuwgData z = Zones[zone]; … … 50 50 } 51 51 52 @Override 52 53 public LatLon eastNorth2latlon(EastNorth p) { 53 54 PuwgData z = Zones[zone]; … … 63 64 } 64 65 66 @Override 65 67 public String toCode() { 66 68 return Zones[zone].toCode(); … … 72 74 } 73 75 76 @Override 74 77 public String getCacheDirectoryName() { 75 78 return Zones[zone].getCacheDirectoryName(); 76 79 } 77 80 81 @Override 78 82 public Bounds getWorldBoundsLatLon() { 79 83 return Zones[zone].getWorldBoundsLatLon(); 80 84 } 81 85 86 @Override 82 87 public double getDefaultZoomInPPD() { 83 88 // This will set the scale bar to about 100 km … … 93 98 } 94 99 100 @Override 95 101 public void setupPreferencePanel(JPanel p) { 96 102 JComboBox prefcb = new JComboBox(Puwg.Zones); … … 105 111 } 106 112 113 @Override 107 114 public Collection<String> getPreferences(JPanel p) { 108 Object prefcb = p.getComponent(2);115 Object prefcb = p.getComponent(2); 109 116 if(!(prefcb instanceof JComboBox)) 110 117 return null; … … 113 120 } 114 121 122 @Override 115 123 public Collection<String> getPreferencesFromCode(String code) 116 124 { … … 118 126 { 119 127 if(code.equals(p.toCode())) 120 return Collections.singleton(code);128 return Collections.singleton(code); 121 129 } 122 130 return null; 123 131 } 124 132 133 @Override 125 134 public void setPreferences(Collection<String> args) 126 135 { … … 131 140 for(String s : args) 132 141 { 133 for (int i=0; i < Puwg.Zones.length; ++i) 134 if(s.equals(Zones[i].toCode())) 135 zone = i; 136 break; 142 for (int i=0; i < Puwg.Zones.length; ++i) 143 if(s.equals(Zones[i].toCode())) { 144 zone = i; 145 } 146 break; 137 147 } 138 } catch (NullPointerException e) {} ;148 } catch (NullPointerException e) {} 139 149 } 140 150 } … … 151 161 class Epsg2180 implements PuwgData { 152 162 153 final privatedouble Epsg2180FalseEasting = 500000.0; /* y */154 final privatedouble Epsg2180FalseNorthing = -5300000.0; /* x */155 final privatedouble Epsg2180ScaleFactor = 0.9993;156 final privatedouble Epsg2180CentralMeridian = 19.0;163 private static final double Epsg2180FalseEasting = 500000.0; /* y */ 164 private static final double Epsg2180FalseNorthing = -5300000.0; /* x */ 165 private static final double Epsg2180ScaleFactor = 0.9993; 166 private static final double Epsg2180CentralMeridian = 19.0; 157 167 private static DecimalFormat decFormatter = new DecimalFormat("###0"); 158 168 … … 202 212 abstract class Puwg2000 implements PuwgData { 203 213 204 final privatedouble PuwgFalseEasting = 500000.0;205 final privatedouble PuwgFalseNorthing = 0;206 final privatedouble PuwgScaleFactor = 0.999923;207 final private double[] Puwg2000CentralMeridian = {15.0, 18.0, 21.0, 24.0};214 private static final double PuwgFalseEasting = 500000.0; 215 private static final double PuwgFalseNorthing = 0; 216 private static final double PuwgScaleFactor = 0.999923; 217 //final private double[] Puwg2000CentralMeridian = {15.0, 18.0, 21.0, 24.0}; 208 218 final private String[] Puwg2000Code = { "EPSG:2176", "EPSG:2177", "EPSG:2178", "EPSG:2179"}; 209 219 final private String[] Puwg2000CDName = { "epsg2176", "epsg2177", "epsg2178", "epsg2179"}; … … 258 268 259 269 class Epsg2176 extends Puwg2000 implements Projection { 260 final private int PuwgZone = 5; 261 270 private static final int PuwgZone = 5; 271 272 @Override 262 273 public int getZone() { return PuwgZone; } 263 274 } 264 275 265 276 class Epsg2177 extends Puwg2000 implements Projection { 266 final private int PuwgZone = 6; 267 277 private static final int PuwgZone = 6; 278 279 @Override 268 280 public int getZone() { return PuwgZone; } 269 281 } 270 282 271 283 class Epsg2178 extends Puwg2000 implements Projection { 272 final private int PuwgZone = 7; 273 284 private static final int PuwgZone = 7; 285 286 @Override 274 287 public int getZone() { return PuwgZone; } 275 288 } 276 289 277 290 class Epsg2179 extends Puwg2000 implements Projection { 278 final private int PuwgZone = 8; 279 280 public int getZone() { return PuwgZone; } 281 } 291 private static final int PuwgZone = 8; 292 293 @Override 294 public int getZone() { return PuwgZone; } 295 }
Note:
See TracChangeset
for help on using the changeset viewer.