Changeset 28887 in osm for applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionLoadFromCache.java
- Timestamp:
- 2012-11-02T23:44:09+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionLoadFromCache.java
r27906 r28887 12 12 import org.openstreetmap.josm.Main; 13 13 import 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;17 14 import org.openstreetmap.josm.gui.layer.Layer; 18 15 … … 32 29 33 30 File[] files = fc.getSelectedFiles(); 34 int layoutZone = getCurrentProjZone();31 int layoutZone = CadastrePlugin.getCadastreProjectionLayoutZone(); 35 32 nextFile: 36 33 for (File file : files) { … … 39 36 String ext = (filename.lastIndexOf(".")==-1)?"":filename.substring(filename.lastIndexOf(".")+1,filename.length()); 40 37 if ((ext.length() == 3 && ext.substring(0, CacheControl.cLambertCC9Z.length()).equals(CacheControl.cLambertCC9Z) && 41 !( Main.getProjection() instanceofLambertCC9Zones))38 !(CadastrePlugin.isLambert_cc9())) 42 39 || (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() instanceofLambert)) {40 !(CadastrePlugin.isUtm_france_dom())) 41 || (ext.length() == 1) && !(CadastrePlugin.isLambert())) { 45 42 JOptionPane.showMessageDialog(Main.parent, tr("{0} not allowed with the current projection", filename), tr("Error"), JOptionPane.ERROR_MESSAGE); 46 43 continue; … … 88 85 JFileChooser fc = new JFileChooser(new File(CadastrePlugin.cacheDir)); 89 86 fc.setMultiSelectionEnabled(true); 90 int layoutZone = new MenuActionLoadFromCache().getCurrentProjZone();87 int layoutZone = CadastrePlugin.getCadastreProjectionLayoutZone(); 91 88 if (layoutZone != -1) { 92 if ( Main.getProjection() instanceofLambert)89 if (CadastrePlugin.isLambert()) 93 90 fc.addChoosableFileFilter(CacheFileLambert4ZoneFilter.filters[layoutZone]); 94 else if ( Main.getProjection() instanceofLambertCC9Zones)91 else if (CadastrePlugin.isLambert_cc9()) 95 92 fc.addChoosableFileFilter(CacheFileLambert9ZoneFilter.filters[layoutZone]); 96 else if ( Main.getProjection() instanceof UTM_France_DOM)93 else if (CadastrePlugin.isUtm_france_dom()) 97 94 fc.addChoosableFileFilter(CacheFileUTM20NFilter.filters[layoutZone]); 98 95 } … … 106 103 } 107 104 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 }118 105 }
Note:
See TracChangeset
for help on using the changeset viewer.
