Changeset 30211 in osm for applications/editors/josm/plugins
- Timestamp:
- 2014-01-19T01:17:29+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/opendata
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/ecologie/ForetsPubliquesHandler.java
r28054 r30211 121 121 } 122 122 123 /* (non-Javadoc)124 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler#getDataURLs()125 */126 123 @Override 127 124 public List<Pair<String, URL>> getDataURLs() { … … 139 136 } 140 137 141 private Pair<String, URL> getForetURL(String code, String name) throws MalformedURLException {142 return new Pair<String, URL>( name, new URL(FRENCH_PORTAL+"var/download/"+"for_publ_v2011_reg"+code+".zip"));138 private Pair<String, URL> getForetURL(String code, String regionName) throws MalformedURLException { 139 return new Pair<String, URL>("PublicForests_"+regionName, new URL(FRENCH_PORTAL+"var/download/"+"for_publ_v2011_reg"+code+".zip")); 143 140 } 144 141 } -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/hydrologie/EauxDeSurfaceHandler.java
r29679 r30211 53 53 new WaterAgency("B1", "Meuse", "Meuse-30381855"), 54 54 new WaterAgency("B2", "Sambre", "Sambre-30381857"), 55 new WaterAgency("C", "Rhin", "Rhin-30381951"),55 new WaterAgency("C", "Rhin", "Rhin-30381951"), 56 56 new WaterAgency("D", "Rhône Méditerranée", "Rhône-Méditerranée-30382014"), 57 57 new WaterAgency("E", "Corse", "Corse-30381905"), … … 106 106 } 107 107 108 /* (non-Javadoc)109 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler#getDataURLs()110 */111 108 @Override 112 109 public List<Pair<String, URL>> getDataURLs() { 113 110 List<Pair<String, URL>> result = new ArrayList<Pair<String,URL>>(); 114 111 try { 115 for ( int i =0; i<waterAgencies.length; i++) {116 result.add(getDownloadURL(wa terAgencies[i]));112 for (WaterAgency wa : waterAgencies) { 113 result.add(getDownloadURL(wa)); 117 114 } 118 115 } catch (MalformedURLException e) { … … 123 120 124 121 private Pair<String, URL> getDownloadURL(WaterAgency a) throws MalformedURLException { 125 return new Pair<String, URL>( a.name, new URL("http://www.rapportage.eaufrance.fr/sites/default/files/SIG/FR"+a.code+"_SW.zip"));122 return new Pair<String, URL>("SurfaceWater_"+a.name, new URL("http://www.rapportage.eaufrance.fr/sites/default/files/SIG/FR"+a.code+"_SW.zip")); 126 123 } 127 124 -
applications/editors/josm/plugins/opendata/modules/fr.lemans/src/org/openstreetmap/josm/plugins/opendata/modules/fr/lemans/datasets/LeMansDataSetHandler.java
r28113 r30211 72 72 } 73 73 74 /* (non-Javadoc)75 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler#getSource()76 */77 74 @Override 78 75 public String getSource() { … … 80 77 } 81 78 82 /* (non-Javadoc)83 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler#getLicenseURL()84 */85 79 /*@Override 86 80 public URL getLicenseURL() { … … 93 87 }*/ 94 88 95 /* (non-Javadoc)96 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler#getDataURLs()97 */98 89 @Override 99 90 public List<Pair<String, URL>> getDataURLs() { 100 91 List<Pair<String, URL>> result = new ArrayList<Pair<String,URL>>(); 101 92 try { 102 if (kmzUuid != null && !kmzUuid.isEmpty()) result.add(new Pair<String, URL>( "KMZ", new URL(PORTAL + "download.do?uuid=" + kmzUuid)));103 if (shpUuid != null && !shpUuid.isEmpty()) result.add(new Pair<String, URL>( "SHP", new URL(PORTAL + "download.do?uuid=" + shpUuid)));93 if (kmzUuid != null && !kmzUuid.isEmpty()) result.add(new Pair<String, URL>(getName() + " (KMZ)", new URL(PORTAL + "download.do?uuid=" + kmzUuid))); 94 if (shpUuid != null && !shpUuid.isEmpty()) result.add(new Pair<String, URL>(getName() + " (SHP)", new URL(PORTAL + "download.do?uuid=" + shpUuid))); 104 95 } catch (MalformedURLException e) { 105 96 e.printStackTrace(); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/OdPlugin.java
r29854 r30211 121 121 JMenu moduleMenu = null; 122 122 for (AbstractDataSetHandler handler: module.getNewlyInstanciatedHandlers()) { 123 if (handler.getDataURL() != null || (handler.getDataURLs() != null && !handler.getDataURLs().isEmpty())) { 123 URL dataURL = handler.getDataURL(); 124 List<Pair<String, URL>> dataURLs = handler.getDataURLs(); 125 if (dataURL != null || (dataURLs != null && !dataURLs.isEmpty())) { 124 126 if (moduleMenu == null) { 125 127 moduleMenu = getModuleMenu(module); … … 142 144 } 143 145 JMenuItem handlerItem = null; 144 if ( handler.getDataURL()!= null) {145 handlerItem = endMenu.add(new DownloadDataAction( handlerName, handler.getDataURL()));146 } else if ( handler.getDataURLs()!= null) {146 if (dataURL != null) { 147 handlerItem = endMenu.add(new DownloadDataAction(module.getDisplayedName()+"_"+handlerName, dataURL)); 148 } else if (dataURLs != null) { 147 149 JMenu handlerMenu = new JMenu(handlerName); 148 150 JMenuItem item = null; 149 for (Pair<String, URL> pair : handler.getDataURLs()) {151 for (Pair<String, URL> pair : dataURLs) { 150 152 if (pair != null && pair.a != null && pair.b != null) { 151 153 item = handlerMenu.add(new DownloadDataAction(pair.a, pair.b)); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/datasets/AbstractDataSetHandler.java
r29686 r30211 427 427 428 428 public boolean acceptsUrl(String url) { 429 if (getDataURL() != null && url.equals(getDataURL().toString())) { 429 URL dataURL = getDataURL(); 430 if (dataURL != null && url.equals(dataURL.toString())) { 430 431 return true; 431 432 } 432 if (getDataURLs() != null) { 433 for (Pair<String, URL> pair : getDataURLs()) { 433 List<Pair<String, URL>> dataURLs = getDataURLs(); 434 if (dataURLs != null) { 435 for (Pair<String, URL> pair : dataURLs) { 434 436 if (pair.b != null && url.equals(pair.b.toString())) { 435 437 return true;
Note:
See TracChangeset
for help on using the changeset viewer.