Changes in src/org/openstreetmap/josm/data/projection/UTM.java [17:23] in josm
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/data/projection/UTM.java
r17 r23 15 15 import javax.swing.SpinnerNumberModel; 16 16 17 import org.openstreetmap.josm.Main; 17 18 import org.openstreetmap.josm.data.Bounds; 18 19 import org.openstreetmap.josm.data.GeoPoint; 19 import org.openstreetmap.josm.data.osm.DataSet;20 20 import org.openstreetmap.josm.gui.GBC; 21 import org.openstreetmap.josm.gui.Main;22 21 23 22 /** … … 80 79 }; 81 80 82 private enum Hemisphere {north, south} ;81 private enum Hemisphere {north, south} 83 82 84 83 /** … … 102 101 * Spinner with all possible zones for the configuration panel 103 102 */ 104 privateJSpinner zoneSpinner;103 JSpinner zoneSpinner; 105 104 /** 106 105 * Hemisphere combo for the configuration panel 107 106 */ 108 privateJComboBox hemisphereCombo;107 JComboBox hemisphereCombo; 109 108 110 109 … … 187 186 * @author imi 188 187 */ 189 private class ZoneData {188 private static class ZoneData { 190 189 int zone = 0; 191 190 Hemisphere hemisphere = Hemisphere.north; … … 193 192 /** 194 193 * Try to autodetect the zone and hemisphere from the dataset. 195 * @param dataSet The dataset to extrakt zone information from.196 194 * @return The zone data extrakted from the dataset. 197 195 */ 198 private ZoneData autoDetect(DataSet dataSet) {196 ZoneData autoDetect(Bounds b) { 199 197 ZoneData zd = new ZoneData(); 200 201 Bounds b = dataSet.getBoundsLatLon();202 198 if (b == null) 203 199 return zd; … … 234 230 */ 235 231 @Override 236 public void init( DataSet dataSet) {232 public void init(Bounds b) { 237 233 if (zone == 0) { 238 ZoneData zd = autoDetect( dataSet);234 ZoneData zd = autoDetect(b); 239 235 zone = zd.zone; 240 236 hemisphere = zd.hemisphere; … … 274 270 public void actionPerformed(ActionEvent e) { 275 271 if (Main.main.getMapFrame() != null) { 276 DataSet ds = Main.main.getMapFrame().mapView.getActiveDataSet(); 277 ZoneData zd = autoDetect(ds); 272 ZoneData zd = autoDetect(Main.main.ds.getBoundsLatLon()); 278 273 if (zd.zone == 0) 279 274 JOptionPane.showMessageDialog(Main.main, "Autodetection failed. Maybe the data set contain too few information.");
Note:
See TracChangeset
for help on using the changeset viewer.