Ignore:
File:
1 edited

Legend:

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

    r17 r23  
    1515import javax.swing.SpinnerNumberModel;
    1616
     17import org.openstreetmap.josm.Main;
    1718import org.openstreetmap.josm.data.Bounds;
    1819import org.openstreetmap.josm.data.GeoPoint;
    19 import org.openstreetmap.josm.data.osm.DataSet;
    2020import org.openstreetmap.josm.gui.GBC;
    21 import org.openstreetmap.josm.gui.Main;
    2221
    2322/**
     
    8079        };
    8180
    82         private enum Hemisphere {north, south};
     81        private enum Hemisphere {north, south}
    8382
    8483        /**
     
    102101         * Spinner with all possible zones for the configuration panel
    103102         */
    104         private JSpinner zoneSpinner;
     103        JSpinner zoneSpinner;
    105104        /**
    106105         * Hemisphere combo for the configuration panel
    107106         */
    108         private JComboBox hemisphereCombo;
     107        JComboBox hemisphereCombo;
    109108
    110109       
     
    187186         * @author imi
    188187         */
    189         private class ZoneData {
     188        private static class ZoneData {
    190189                int zone = 0;
    191190                Hemisphere hemisphere = Hemisphere.north;
     
    193192        /**
    194193         * Try to autodetect the zone and hemisphere from the dataset.
    195          * @param dataSet The dataset to extrakt zone information from.
    196194         * @return The zone data extrakted from the dataset.
    197195         */
    198         private ZoneData autoDetect(DataSet dataSet) {
     196        ZoneData autoDetect(Bounds b) {
    199197                ZoneData zd = new ZoneData();
    200                
    201                 Bounds b = dataSet.getBoundsLatLon();
    202198                if (b == null)
    203199                        return zd;
     
    234230         */
    235231        @Override
    236         public void init(DataSet dataSet) {
     232        public void init(Bounds b) {
    237233                if (zone == 0) {
    238                         ZoneData zd = autoDetect(dataSet);
     234                        ZoneData zd = autoDetect(b);
    239235                        zone = zd.zone;
    240236                        hemisphere = zd.hemisphere;
     
    274270                        public void actionPerformed(ActionEvent e) {
    275271                                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());
    278273                                        if (zd.zone == 0)
    279274                                                JOptionPane.showMessageDialog(Main.main, "Autodetection failed. Maybe the data set contain too few information.");
Note: See TracChangeset for help on using the changeset viewer.