Ignore:
Timestamp:
2012-11-02T23:44:09+01:00 (13 years ago)
Author:
bastik
Message:

update to latest josm (projection)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionLoadFromCache.java

    r27906 r28887  
    1212import org.openstreetmap.josm.Main;
    1313import org.openstreetmap.josm.actions.JosmAction;
    14 import org.openstreetmap.josm.data.projection.Lambert;
    15 import org.openstreetmap.josm.data.projection.LambertCC9Zones;
    16 import org.openstreetmap.josm.data.projection.UTM_France_DOM;
    1714import org.openstreetmap.josm.gui.layer.Layer;
    1815
     
    3229
    3330        File[] files = fc.getSelectedFiles();
    34         int layoutZone = getCurrentProjZone();
     31        int layoutZone = CadastrePlugin.getCadastreProjectionLayoutZone();
    3532        nextFile:
    3633        for (File file : files) {
     
    3936                String ext = (filename.lastIndexOf(".")==-1)?"":filename.substring(filename.lastIndexOf(".")+1,filename.length());
    4037                if ((ext.length() == 3 && ext.substring(0, CacheControl.cLambertCC9Z.length()).equals(CacheControl.cLambertCC9Z) &&
    41                     !(Main.getProjection() instanceof LambertCC9Zones))
     38                    !(CadastrePlugin.isLambert_cc9()))
    4239                    || (ext.length() == 4 && ext.substring(0, CacheControl.cUTM20N.length()).equals(CacheControl.cUTM20N) &&
    43                             !(Main.getProjection() instanceof UTM_France_DOM))
    44                     || (ext.length() == 1) && !(Main.getProjection() instanceof Lambert)) {
     40                            !(CadastrePlugin.isUtm_france_dom()))
     41                    || (ext.length() == 1) && !(CadastrePlugin.isLambert())) {
    4542                        JOptionPane.showMessageDialog(Main.parent, tr("{0} not allowed with the current projection", filename), tr("Error"), JOptionPane.ERROR_MESSAGE);
    4643                        continue;
     
    8885        JFileChooser fc = new JFileChooser(new File(CadastrePlugin.cacheDir));
    8986        fc.setMultiSelectionEnabled(true);
    90         int layoutZone = new MenuActionLoadFromCache().getCurrentProjZone();
     87        int layoutZone = CadastrePlugin.getCadastreProjectionLayoutZone();
    9188        if (layoutZone != -1) {
    92             if (Main.getProjection() instanceof Lambert)
     89            if (CadastrePlugin.isLambert())
    9390                fc.addChoosableFileFilter(CacheFileLambert4ZoneFilter.filters[layoutZone]);
    94             else if (Main.getProjection() instanceof LambertCC9Zones)
     91            else if (CadastrePlugin.isLambert_cc9())
    9592                fc.addChoosableFileFilter(CacheFileLambert9ZoneFilter.filters[layoutZone]);
    96             else if (Main.getProjection() instanceof UTM_France_DOM)
     93            else if (CadastrePlugin.isUtm_france_dom())
    9794                fc.addChoosableFileFilter(CacheFileUTM20NFilter.filters[layoutZone]);
    9895        }
     
    106103    }
    107104
    108     private int getCurrentProjZone() {
    109         int zone = -1;
    110         if (Main.getProjection() instanceof LambertCC9Zones)
    111             zone = ((LambertCC9Zones)Main.getProjection()).getLayoutZone();
    112         else if (Main.getProjection() instanceof Lambert)
    113             zone = ((Lambert)Main.getProjection()).getLayoutZone();
    114         else if (Main.getProjection() instanceof UTM_France_DOM)
    115             zone = ((UTM_France_DOM)Main.getProjection()).getCurrentGeodesic();
    116         return zone;
    117     }
    118105}
Note: See TracChangeset for help on using the changeset viewer.