Changeset 29657 in osm for applications/editors/josm/plugins/opendata
- Timestamp:
- 2013-06-13T02:20:32+02:00 (12 years ago)
- Location:
- applications/editors/josm/plugins/opendata
- Files:
-
- 1 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/ToulouseConstants.java
r29653 r29657 51 51 52 52 /** 53 * Categories : TODO: icons53 * Categories 54 54 */ 55 public static final DataSetCategory CAT_ASSOCIATIONS = new DataSetCategory("Associations", ""); 56 public static final DataSetCategory CAT_CITOYENNETE = new DataSetCategory("Citoyenneté", ""); 57 public static final DataSetCategory CAT_CULTURE = new DataSetCategory("Culture", ""); 58 public static final DataSetCategory CAT_ENFANCE = new DataSetCategory("Enfance", ""); 59 public static final DataSetCategory CAT_ENVIRONNEMENT = new DataSetCategory("Environnement", ""); 60 public static final DataSetCategory CAT_PATRIMOINE = new DataSetCategory("Patrimoine", ""); 61 public static final DataSetCategory CAT_SERVICES = new DataSetCategory("Services", ""); 62 public static final DataSetCategory CAT_SPORT = new DataSetCategory("Sport", ""); 63 public static final DataSetCategory CAT_TOPOGRAPHIE = new DataSetCategory("Topographie", ""); 64 public static final DataSetCategory CAT_TRANSPORT = new DataSetCategory("Transport", ""); 65 public static final DataSetCategory CAT_URBANISME = new DataSetCategory("Urbanisme", ""); 55 public static final DataSetCategory CAT_ASSOCIATIONS = new DataSetCategory("Associations", "styles/standard/people.png"); 56 public static final DataSetCategory CAT_CITOYENNETE = new DataSetCategory("Citoyenneté", "presets/townhall.png"); 57 public static final DataSetCategory CAT_CULTURE = new DataSetCategory("Culture", "presets/arts_centre.png"); 58 public static final DataSetCategory CAT_ENFANCE = new DataSetCategory("Enfance", "presets/kindergarten.png"); 59 public static final DataSetCategory CAT_ENVIRONNEMENT = new DataSetCategory("Environnement", "presets/recycling.png"); 60 public static final DataSetCategory CAT_PATRIMOINE = new DataSetCategory("Patrimoine", "presets/ruins.png"); 61 public static final DataSetCategory CAT_SERVICES = new DataSetCategory("Services", "styles/standard/vehicle/services.png"); 62 public static final DataSetCategory CAT_SPORT = new DataSetCategory("Sport", "presets/soccer.png"); 63 public static final DataSetCategory CAT_TOPOGRAPHIE = new DataSetCategory("Topographie", "presets/peak.png"); 64 public static final DataSetCategory CAT_TRANSPORT = new DataSetCategory("Transport", "presets/bus.png"); 65 public static final DataSetCategory CAT_URBANISME = new DataSetCategory("Urbanisme", "presets/places.png"); 66 66 } -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/ToulouseModule.java
r29653 r29657 55 55 import org.openstreetmap.josm.plugins.opendata.modules.fr.toulouse.datasets.sport.InstallationSportiveToulouseHandler; 56 56 import org.openstreetmap.josm.plugins.opendata.modules.fr.toulouse.datasets.topographie.AltimetrieVoieHandler; 57 import org.openstreetmap.josm.plugins.opendata.modules.fr.toulouse.datasets.transport.AiresPietonnesHandler; 57 58 import org.openstreetmap.josm.plugins.opendata.modules.fr.toulouse.datasets.transport.ChantiersLineairesHandler; 58 59 import org.openstreetmap.josm.plugins.opendata.modules.fr.toulouse.datasets.transport.ChantiersPonctuelsHandler; … … 116 117 handlers.add(StationsAutoPartageHandler.class); 117 118 handlers.add(MarchesPleinVentHandler.class); 119 handlers.add(AiresPietonnesHandler.class); 118 120 } 119 121 -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/citoyennete/QuartiersHandler.java
r28554 r29657 26 26 setWikiPage("Quartiers de proximité"); 27 27 setCategory(CAT_CITOYENNETE); 28 setMenuIcon("presets/boundaries.png"); 28 29 } 29 30 -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/citoyennete/SecteursHandler.java
r28554 r29657 26 26 setWikiPage("Secteurs de proximité"); 27 27 setCategory(CAT_CITOYENNETE); 28 setMenuIcon("presets/boundaries.png"); 28 29 } 29 30 -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/transport/HorodateurHandler.java
r28554 r29657 30 30 setWikiPage("Horodateurs"); 31 31 setCategory(CAT_TRANSPORT); 32 setMenuIcon("presets/vending_machine.png"); 32 33 } 33 34 -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/transport/MetroStationHandler.java
r28554 r29657 26 26 setName("Stations de métro"); 27 27 setCategory(CAT_TRANSPORT); 28 setMenuIcon("styles/standard/transport/railway_station.png"); 28 29 } 29 30 -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/transport/PMRHandler.java
r29493 r29657 26 26 setWikiPage("PMR"); 27 27 setCategory(CAT_TRANSPORT); 28 setMenuIcon("styles/standard/vehicle/parking/handicapped.png"); 28 29 } 29 30 -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/transport/TramwayStationHandler.java
r28554 r29657 26 26 setName("Stations de tramway"); 27 27 setCategory(CAT_TRANSPORT); 28 setMenuIcon("styles/standard/transport/railway_station.png"); 28 29 } 29 30 -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/urbanisme/CommuneHandler.java
r28554 r29657 26 26 setName("Communes"); 27 27 setCategory(CAT_URBANISME); 28 setMenuIcon("presets/boundaries.png"); 28 29 } 29 30 -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/urbanisme/VoirieHandler.java
r28554 r29657 39 39 setName("Filaire de voirie"); 40 40 setCategory(CAT_URBANISME); 41 setMenuIcon("presets/way_secondary.png"); 41 42 } 42 43 43 protected VoirieHandler(int portalId, String streetField, String relevant Key) {44 super(portalId, relevant Key);44 protected VoirieHandler(int portalId, String streetField, String relevantTag) { 45 super(portalId, relevantTag); 45 46 this.streetField = streetField; 46 47 map.put("motorway", Arrays.asList(new String[] {"A6", "AUTOROUTE "})); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/OdPlugin.java
r29107 r29657 19 19 import static org.openstreetmap.josm.tools.I18n.marktr; 20 20 21 import java.awt.Image; 21 22 import java.awt.Toolkit; 22 23 import java.awt.event.KeyEvent; … … 28 29 import java.util.Map; 29 30 31 import javax.swing.ImageIcon; 30 32 import javax.swing.JMenu; 31 33 import javax.swing.JMenuItem; … … 129 131 if ((endMenu = catMenus.get(cat)) == null) { 130 132 catMenus.put(cat, endMenu = new JMenu(cat.getName())); 133 setMenuItemIcon(cat.getIcon(), endMenu); 131 134 moduleMenu.add(endMenu); 132 135 } … … 139 142 handlerName = handler.getClass().getName(); 140 143 } 144 JMenuItem handlerItem = null; 141 145 if (handler.getDataURL() != null) { 142 146 handlerItem = endMenu.add(new DownloadDataAction(handlerName, handler.getDataURL())); 143 147 } else if (handler.getDataURLs() != null) { 144 148 JMenu handlerMenu = new JMenu(handlerName); … … 151 155 if (item != null) { 152 156 MenuScroller.setScrollerFor(handlerMenu, (screenHeight / item.getPreferredSize().height)-3); 153 endMenu.add(handlerMenu); 157 handlerItem = endMenu.add(handlerMenu); 154 158 } 159 } 160 if (handlerItem != null) { 161 setMenuItemIcon(handler.getMenuIcon(), handlerItem); 155 162 } 156 163 } … … 164 171 /*JMenuItem itemIcon =*/ MainMenu.add(menu, new OpenPreferencesActions()); 165 172 //MenuScroller.setScrollerFor(menu, screenHeight / itemIcon.getPreferredSize().height); 173 } 174 175 private void setMenuItemIcon(ImageIcon icon, JMenuItem menuItem) { 176 if (icon != null) { 177 if (icon.getIconHeight() != 16 || icon.getIconWidth() != 16) { 178 icon = new ImageIcon(icon.getImage().getScaledInstance(16, 16, Image.SCALE_DEFAULT)); 179 } 180 menuItem.setIcon(icon); 181 } 166 182 } 167 183 -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/datasets/AbstractDataSetHandler.java
r28696 r29657 23 23 import java.util.List; 24 24 import java.util.regex.Pattern; 25 26 import javax.swing.ImageIcon; 25 27 26 28 import org.openstreetmap.josm.actions.JosmAction; … … 44 46 import org.openstreetmap.josm.plugins.opendata.core.licenses.License; 45 47 import org.openstreetmap.josm.plugins.opendata.core.util.NamesFrUtils; 48 import org.openstreetmap.josm.plugins.opendata.core.util.OdUtils; 46 49 import org.openstreetmap.josm.tools.Pair; 47 50 … … 85 88 private String sourceDate; 86 89 private File associatedFile; 90 private ImageIcon menuIcon; 87 91 88 92 public AbstractDataSetHandler() { … … 397 401 fileNameWithoutExtension+"."+MAPCSS_EXT); 398 402 } 399 403 404 public final ImageIcon getMenuIcon() { 405 return menuIcon; 406 } 407 408 public final void setMenuIcon(ImageIcon icon) { 409 this.menuIcon = icon; 410 } 411 412 public final void setMenuIcon(String iconName) { 413 setMenuIcon(OdUtils.getImageIcon(iconName)); 414 } 415 400 416 public final void setAssociatedFile(File associatedFile) { 401 417 this.associatedFile = associatedFile; -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/datasets/SimpleDataSetHandler.java
r28113 r29657 16 16 package org.openstreetmap.josm.plugins.opendata.core.datasets; 17 17 18 import static org.openstreetmap.josm.plugins.opendata.core.io.OverpassApi.OaQueryType.NODE; 19 import static org.openstreetmap.josm.plugins.opendata.core.io.OverpassApi.OaQueryType.RELATION; 20 import static org.openstreetmap.josm.plugins.opendata.core.io.OverpassApi.OaQueryType.WAY; 21 import static org.openstreetmap.josm.plugins.opendata.core.io.OverpassApi.OaRecurseType.NODE_RELATION; 22 import static org.openstreetmap.josm.plugins.opendata.core.io.OverpassApi.OaRecurseType.RELATION_WAY; 23 import static org.openstreetmap.josm.plugins.opendata.core.io.OverpassApi.OaRecurseType.WAY_NODE; 24 import static org.openstreetmap.josm.plugins.opendata.core.io.OverpassApi.OaRecurseType.WAY_RELATION; 25 18 26 import java.util.ArrayList; 19 27 import java.util.Collection; … … 24 32 import org.openstreetmap.josm.data.osm.Tag; 25 33 import org.openstreetmap.josm.data.projection.Projection; 34 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles; 26 35 import org.openstreetmap.josm.plugins.opendata.core.io.OverpassApi; 27 28 import static org.openstreetmap.josm.plugins.opendata.core.io.OverpassApi.OaQueryType.*;29 import static org.openstreetmap.josm.plugins.opendata.core.io.OverpassApi.OaRecurseType.*;30 36 31 37 public abstract class SimpleDataSetHandler extends AbstractDataSetHandler { … … 45 51 addRelevantTag(relevantTag); 46 52 this.relevantUnion = false; 53 Tag tag; 54 String[] kv = relevantTag.split("="); 55 if (kv != null && kv.length == 2) { 56 tag = new Tag(kv[0], kv[1]); 57 } else { 58 tag = new Tag(relevantTag); 59 } 60 setMenuIcon(MapPaintStyles.getNodeIcon(tag)); 47 61 } 48 62
Note:
See TracChangeset
for help on using the changeset viewer.