Changeset 26228 in osm for applications/editors/josm/plugins
- Timestamp:
- 2011-07-01T00:44:06+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheControl.java
r24934 r26228 210 210 private String WMSFileExtension() { 211 211 String ext = String.valueOf((wmsLayer.getLambertZone() + 1)); 212 if (Main. projinstanceof LambertCC9Zones)212 if (Main.getProjection() instanceof LambertCC9Zones) 213 213 ext = cLambertCC9Z + ext; 214 else if (Main. projinstanceof UTM_France_DOM)214 else if (Main.getProjection() instanceof UTM_France_DOM) 215 215 ext = cUTM20N + ext; 216 216 return ext; -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java
r24954 r26228 58 58 final String cInterfaceRasterTA = "afficherCarteTa.do"; 59 59 final String cInterfaceRasterFeuille = "afficherCarteFeuille.do"; 60 final String cImageLinkStart = " title=\"image\"><a href=\"#\" onClick=\"popup('afficherCarteFeuille.do?f=";61 final String cTAImageLinkStart = " title=\"image\"><a href=\"#\" onClick=\"popup('afficherCarteTa.do?f=";60 final String cImageLinkStart = "<a href=\"#\" class=\"raster\" onClick=\"popup('afficherCarteFeuille.do?f="; 61 final String cTAImageLinkStart = "<a href=\"#\" class=\"raster\" onClick=\"popup('afficherCarteTa.do?f="; 62 62 final String cImageNameStart = ">Feuille "; 63 63 final String cTAImageNameStart = "Tableau d'assemblage <strong>"; -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java
r25046 r26228 122 122 * - move the grabber from CadastrPlugin singleton to each wmsLayer instance to allow grabbing 123 123 * of multiple municipalities in parallel. 124 * 2.2 01-Jul-2011 - replace deprecated Main.proj by newest Main.getProjection() 125 * - fix list of raster images (Feuilles) parsing failing after a Cadastre server change/maintenance 124 126 */ 125 127 public class CadastrePlugin extends Plugin { … … 350 352 351 353 public static boolean isCadastreProjection() { 352 return Main. proj.toString().equals(new Lambert().toString())353 || Main. proj.toString().equals(new UTM_France_DOM().toString())354 || Main. proj.toString().equals(new LambertCC9Zones().toString());354 return Main.getProjection().toString().equals(new Lambert().toString()) 355 || Main.getProjection().toString().equals(new UTM_France_DOM().toString()) 356 || Main.getProjection().toString().equals(new LambertCC9Zones().toString()); 355 357 } 356 358 -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java
r25045 r26228 114 114 Way wayToAdd = new Way(); 115 115 for (EastNorth eastNorth : path) { 116 Node nodeToAdd = new Node(Main. proj.eastNorth2latlon(eastNorth));116 Node nodeToAdd = new Node(Main.getProjection().eastNorth2latlon(eastNorth)); 117 117 // check if new node is not already created by another new path 118 118 Node nearestNewNode = checkNearestNode(nodeToAdd, svgDataSet.getNodes()); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java
r25045 r26228 116 116 List<Node> nodeList = new ArrayList<Node>(); 117 117 for (EastNorth eastNorth : eastNorths.get(bestPath)) { 118 nodeList.add(new Node(Main. proj.eastNorth2latlon(eastNorth)));118 nodeList.add(new Node(Main.getProjection().eastNorth2latlon(eastNorth))); 119 119 } 120 120 Way wayToAdd = new Way(); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/EastNorthBound.java
r23190 r26228 33 33 34 34 public Bounds toBounds() { 35 return new Bounds(Main. proj.eastNorth2latlon(min), Main.proj.eastNorth2latlon(max));35 return new Bounds(Main.getProjection().eastNorth2latlon(min), Main.getProjection().eastNorth2latlon(max)); 36 36 } 37 37 -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrabPlanImage.java
r24934 r26228 141 141 return; 142 142 if (ignoreMouseClick) return; // In case we are currently just allowing zooming to read lambert coordinates 143 EastNorth ea = Main. proj.latlon2eastNorth(Main.map.mapView.getLatLon(e.getX(), e.getY()));143 EastNorth ea = Main.getProjection().latlon2eastNorth(Main.map.mapView.getLatLon(e.getX(), e.getY())); 144 144 System.out.println("clic:"+countMouseClicked+" ,"+ea+", mode:"+mode); 145 145 if (clickOnTheMap) { -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionLoadFromCache.java
r24934 r26228 38 38 String ext = (filename.lastIndexOf(".")==-1)?"":filename.substring(filename.lastIndexOf(".")+1,filename.length()); 39 39 if ((ext.length() == 3 && ext.substring(0, CacheControl.cLambertCC9Z.length()).equals(CacheControl.cLambertCC9Z) && 40 !(Main. projinstanceof LambertCC9Zones))40 !(Main.getProjection() instanceof LambertCC9Zones)) 41 41 || (ext.length() == 4 && ext.substring(0, CacheControl.cUTM20N.length()).equals(CacheControl.cUTM20N) && 42 !(Main. projinstanceof UTM_France_DOM))43 || (ext.length() == 1) && !(Main. projinstanceof Lambert)) {42 !(Main.getProjection() instanceof UTM_France_DOM)) 43 || (ext.length() == 1) && !(Main.getProjection() instanceof Lambert)) { 44 44 JOptionPane.showMessageDialog(Main.parent, tr("{0} not allowed with the current projection", filename), tr("Error"), JOptionPane.ERROR_MESSAGE); 45 45 continue; … … 89 89 int layoutZone = new MenuActionLoadFromCache().getCurrentProjZone(); 90 90 if (layoutZone != -1) { 91 if (Main. projinstanceof Lambert)91 if (Main.getProjection() instanceof Lambert) 92 92 fc.addChoosableFileFilter(CacheFileLambert4ZoneFilter.filters[layoutZone]); 93 else if (Main. projinstanceof LambertCC9Zones)93 else if (Main.getProjection() instanceof LambertCC9Zones) 94 94 fc.addChoosableFileFilter(CacheFileLambert9ZoneFilter.filters[layoutZone]); 95 else if (Main. projinstanceof UTM_France_DOM)95 else if (Main.getProjection() instanceof UTM_France_DOM) 96 96 fc.addChoosableFileFilter(CacheFileUTM20NFilter.filters[layoutZone]); 97 97 } … … 107 107 private int getCurrentProjZone() { 108 108 int zone = -1; 109 if (Main. projinstanceof LambertCC9Zones)110 zone = ((LambertCC9Zones)Main. proj).getLayoutZone();111 else if (Main. projinstanceof Lambert)112 zone = ((Lambert)Main. proj).getLayoutZone();113 else if (Main. projinstanceof UTM_France_DOM)114 zone = ((UTM_France_DOM)Main. proj).getCurrentGeodesic();109 if (Main.getProjection() instanceof LambertCC9Zones) 110 zone = ((LambertCC9Zones)Main.getProjection()).getLayoutZone(); 111 else if (Main.getProjection() instanceof Lambert) 112 zone = ((Lambert)Main.getProjection()).getLayoutZone(); 113 else if (Main.getProjection() instanceof UTM_France_DOM) 114 zone = ((UTM_France_DOM)Main.getProjection()).getCurrentGeodesic(); 115 115 return zone; 116 116 } -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java
r25045 r26228 116 116 // add the layer if it doesn't exist 117 117 int zone = -1; 118 if (Main. projinstanceof LambertCC9Zones)119 zone = ((LambertCC9Zones)Main. proj).getLayoutZone();120 else if (Main. projinstanceof Lambert)121 zone = ((Lambert)Main. proj).getLayoutZone();122 else if (Main. projinstanceof UTM_France_DOM)123 zone = ((UTM_France_DOM)Main. proj).getCurrentGeodesic();118 if (Main.getProjection() instanceof LambertCC9Zones) 119 zone = ((LambertCC9Zones)Main.getProjection()).getLayoutZone(); 120 else if (Main.getProjection() instanceof Lambert) 121 zone = ((Lambert)Main.getProjection()).getLayoutZone(); 122 else if (Main.getProjection() instanceof UTM_France_DOM) 123 zone = ((UTM_France_DOM)Main.getProjection()).getCurrentGeodesic(); 124 124 wmsLayer = new WMSLayer(location, codeCommune, zone); 125 125 wmsLayer.setDepartement(codeDepartement); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
r25889 r26228 138 138 } else { 139 139 if (isRaster) { 140 b = new Bounds(Main. proj.eastNorth2latlon(rasterMin), Main.proj.eastNorth2latlon(rasterMax));140 b = new Bounds(Main.getProjection().eastNorth2latlon(rasterMin), Main.getProjection().eastNorth2latlon(rasterMax)); 141 141 divideBbox(b, Integer.parseInt(Main.pref.get("cadastrewms.rasterDivider", 142 142 CadastrePreferenceSetting.DEFAULT_RASTER_DIVIDER))); … … 158 158 */ 159 159 private void divideBbox(Bounds b, int factor) { 160 EastNorth lambertMin = Main. proj.latlon2eastNorth(b.getMin());161 EastNorth lambertMax = Main. proj.latlon2eastNorth(b.getMax());160 EastNorth lambertMin = Main.getProjection().latlon2eastNorth(b.getMin()); 161 EastNorth lambertMax = Main.getProjection().latlon2eastNorth(b.getMax()); 162 162 double minEast = lambertMin.east(); 163 163 double minNorth = lambertMin.north(); … … 322 322 GeorefImage georefImage = 323 323 new GeorefImage(null, 324 Main. proj.latlon2eastNorth(bounds.getMin()),325 Main. proj.latlon2eastNorth(bounds.getMax()));324 Main.getProjection().latlon2eastNorth(bounds.getMin()), 325 Main.getProjection().latlon2eastNorth(bounds.getMax())); 326 326 for (GeorefImage img : images) { 327 327 if (img.overlap(georefImage)) … … 399 399 */ 400 400 public void setRasterBounds(Bounds bounds) { 401 EastNorth rasterCenter = Main. proj.latlon2eastNorth(bounds.getCenter());402 EastNorth eaMin = Main. proj.latlon2eastNorth(bounds.getMin());403 EastNorth eaMax = Main. proj.latlon2eastNorth(bounds.getMax());401 EastNorth rasterCenter = Main.getProjection().latlon2eastNorth(bounds.getCenter()); 402 EastNorth eaMin = Main.getProjection().latlon2eastNorth(bounds.getMin()); 403 EastNorth eaMax = Main.getProjection().latlon2eastNorth(bounds.getMax()); 404 404 double rasterSizeX = communeBBox.max.getX() - communeBBox.min.getX(); 405 405 double rasterSizeY = communeBBox.max.getY() - communeBBox.min.getY();
Note:
See TracChangeset
for help on using the changeset viewer.