Changeset 31048 in osm for applications/editors/josm/plugins/opendata
- Timestamp:
- 2015-03-05T18:20:14+01:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/opendata
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/ToulouseDataSetHandler.java
r30340 r31048 37 37 38 38 public abstract class ToulouseDataSetHandler extends FrenchDataSetHandler implements ToulouseConstants { 39 39 40 40 /** 41 41 * Categories … … 48 48 public static final DataSetCategory CAT_PATRIMOINE = new DataSetCategory("Patrimoine", "presets/ruins.png"); 49 49 public static final DataSetCategory CAT_SERVICES = new DataSetCategory("Services", "styles/standard/vehicle/services.png"); 50 public static final DataSetCategory CAT_SPORT = new DataSetCategory("Sport", " presets/soccer.png");50 public static final DataSetCategory CAT_SPORT = new DataSetCategory("Sport", "styles/standard/sport/soccer.png"); 51 51 public static final DataSetCategory CAT_TOPOGRAPHIE = new DataSetCategory("Topographie", "presets/peak.svg"); 52 52 public static final DataSetCategory CAT_TRANSPORT = new DataSetCategory("Transport", "presets/bus.png"); 53 public static final DataSetCategory CAT_URBANISME = new DataSetCategory("Urbanisme", " presets/places.png");53 public static final DataSetCategory CAT_URBANISME = new DataSetCategory("Urbanisme", "styles/standard/place/settlement/city.png"); 54 54 55 55 public ToulouseDataSetHandler(int portalId) { 56 56 init(portalId); 57 57 } 58 58 59 59 public ToulouseDataSetHandler(int portalId, String relevantTag) { 60 60 super(relevantTag); 61 61 init(portalId); 62 62 } 63 63 64 64 public ToulouseDataSetHandler(int portalId, boolean relevantUnion, String ... relevantTags) { 65 65 super(relevantUnion, relevantTags); … … 75 75 init(portalId); 76 76 }*/ 77 77 78 78 public ToulouseDataSetHandler(int portalId, boolean relevantUnion, Tag ... relevantTags) { 79 79 super(relevantUnion, relevantTags); … … 84 84 this(portalId, false, relevantTags); 85 85 }*/ 86 86 87 87 private final void init(int portalId) { 88 88 try { … … 116 116 return ICON_CROIX_16; 117 117 } 118 118 119 119 protected final void setWikiPage(String wikiPage) { 120 120 if (wikiPage != null && !wikiPage.isEmpty()) { … … 127 127 } 128 128 } 129 129 130 130 protected abstract class SplitAction extends JosmAction implements DataSetListener { 131 131 132 132 public SplitAction(String name, String desc) { 133 133 super(name, null, desc, null, false); … … 135 135 ToulouseModule.data.addDataSetListener(this); 136 136 } 137 137 138 138 protected abstract Collection<Relation> getBoundaries(); 139 139 140 140 @Override 141 141 public void actionPerformed(ActionEvent e) { … … 191 191 } 192 192 } 193 193 194 194 protected class SplitByMunicipality extends SplitAction { 195 195 public SplitByMunicipality() { -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/OdPlugin.java
r31015 r31048 20 20 import org.openstreetmap.josm.gui.MenuScroller; 21 21 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; 22 import org.openstreetmap.josm.gui.util.GuiHelper; 22 23 import org.openstreetmap.josm.plugins.Plugin; 23 24 import org.openstreetmap.josm.plugins.PluginInformation; … … 49 50 50 51 private static OdPlugin instance; 51 52 52 53 public final XmlImporter xmlImporter = new XmlImporter(); 53 54 54 55 private final JMenu menu; 55 56 56 57 private OdDialog dialog; 57 58 58 59 public OdPlugin(PluginInformation info) { 59 60 super(info); … … 75 76 76 77 menu = Main.main.menu.dataMenu; 77 78 78 79 new Thread(new Runnable() { 79 80 @Override 80 81 public void run() { 81 // Load modules 82 // Load modules in new thread 82 83 loadModules(); 83 // Add menu 84 buildMenu(); 84 // Add menu in EDT 85 GuiHelper.runInEDT(new Runnable() { 86 @Override 87 public void run() { 88 buildMenu(); 89 } 90 }); 85 91 } 86 92 }).start(); … … 91 97 OdUtils.deletePreviousTempDirs(); 92 98 } 93 99 94 100 public static final OdPlugin getInstance() { 95 101 return instance; 96 102 } 97 103 98 104 private JMenu getModuleMenu(Module module) { 99 105 String moduleName = module.getDisplayedName(); … … 105 111 return moduleMenu; 106 112 } 107 113 108 114 private void buildMenu() { 109 115 for (Module module : ModuleHandler.moduleList) { … … 161 167 MainMenu.add(menu, new OpenPreferencesActions()); 162 168 } 163 169 164 170 private void setMenuItemIcon(ImageIcon icon, JMenuItem menuItem) { 165 171 if (icon != null) { 166 if (icon.getIconHeight() != 16 || icon.getIconWidth() != 16) { 172 if (icon.getIconHeight() != 16 || icon.getIconWidth() != 16) { 167 173 icon = new ImageIcon(icon.getImage().getScaledInstance(16, 16, Image.SCALE_DEFAULT)); 168 174 } … … 179 185 } 180 186 } 181 187 182 188 @Override 183 189 public PreferenceSetting getPreferenceSetting() { 184 190 return new OdPreferenceSetting(); 185 191 } 186 192 187 193 private final void loadModules() { 188 194 List<ModuleInformation> modulesToLoad = ModuleHandler.buildListOfModulesToLoad(Main.parent); … … 194 200 ModuleHandler.loadModules(Main.parent, modulesToLoad, null); 195 201 } 196 202 197 203 private final File getSubDirectory(String name) { 198 204 File dir = new File(getPluginDir()+File.separator+name); … … 202 208 return dir; 203 209 } 204 210 205 211 public final File getModulesDirectory() { 206 212 return getSubDirectory("modules"); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/gui/ModulePreference.java
r30723 r31048 62 62 } 63 63 }*/ 64 64 65 65 public static String buildDownloadSummary(ModuleDownloadTask task) { 66 66 Collection<ModuleInformation> downloaded = task.getDownloadedModules(); … … 161 161 } 162 162 163 @Override 163 164 public void addGui(final PreferenceTabbedPane gui) { 164 165 GridBagConstraints gc = new GridBagConstraints(); … … 215 216 } 216 217 218 @Override 217 219 public boolean ok() { 218 220 if (! modulePreferencesActivated) … … 236 238 final ReadLocalModuleInformationTask task = new ReadLocalModuleInformationTask(); 237 239 Runnable r = new Runnable() { 240 @Override 238 241 public void run() { 239 242 if (task.isCanceled()) return; 240 243 SwingUtilities.invokeLater(new Runnable() { 244 @Override 241 245 public void run() { 242 246 model.setAvailableModules(task.getAvailableModules()); … … 262 266 } 263 267 268 @Override 264 269 public void actionPerformed(ActionEvent e) { 265 270 final ReadRemoteModuleInformationTask task = new ReadRemoteModuleInformationTask(OdPreferenceSetting.getModuleSites()); 266 271 Runnable continuation = new Runnable() { 272 @Override 267 273 public void run() { 268 274 if (task.isCanceled()) return; 269 275 SwingUtilities.invokeLater(new Runnable() { 276 @Override 270 277 public void run() { 271 278 model.updateAvailableModules(task.getAvailableModules()); … … 325 332 } 326 333 334 @Override 327 335 public void actionPerformed(ActionEvent e) { 328 336 final List<ModuleInformation> toUpdate = model.getSelectedModules(); … … 339 347 // 340 348 final Runnable moduleDownloadContinuation = new Runnable() { 349 @Override 341 350 public void run() { 342 351 if (moduleDownloadTask.isCanceled()) … … 345 354 model.refreshLocalModuleVersion(moduleDownloadTask.getDownloadedModules()); 346 355 model.clearPendingModules(moduleDownloadTask.getDownloadedModules()); 347 pnlModulePreferences.refreshView(); 356 GuiHelper.runInEDT(new Runnable() { 357 @Override 358 public void run() { 359 pnlModulePreferences.refreshView(); 360 } 361 }); 348 362 } 349 363 }; … … 352 366 // 353 367 final Runnable moduleInfoDownloadContinuation = new Runnable() { 368 @Override 354 369 public void run() { 355 370 if (moduleInfoDownloadTask.isCanceled()) … … 392 407 } 393 408 409 @Override 394 410 public void actionPerformed(ActionEvent e) { 395 411 configureSites(); … … 408 424 } 409 425 426 @Override 410 427 public void stateChanged(ChangeEvent e) { 411 428 JTabbedPane tp = (JTabbedPane)e.getSource(); … … 431 448 } 432 449 450 @Override 433 451 public void changedUpdate(DocumentEvent arg0) { 434 452 filter(); 435 453 } 436 454 455 @Override 437 456 public void insertUpdate(DocumentEvent arg0) { 438 457 filter(); 439 458 } 440 459 460 @Override 441 461 public void removeUpdate(DocumentEvent arg0) { 442 462 filter(); … … 459 479 JPanel buttons = new JPanel(new GridBagLayout()); 460 480 buttons.add(new JButton(new AbstractAction(tr("Add")){ 481 @Override 461 482 public void actionPerformed(ActionEvent e) { 462 483 String s = JOptionPane.showInputDialog( … … 472 493 }), GBC.eol().fill(GBC.HORIZONTAL)); 473 494 buttons.add(new JButton(new AbstractAction(tr("Edit")){ 495 @Override 474 496 public void actionPerformed(ActionEvent e) { 475 497 if (list.getSelectedValue() == null) { … … 497 519 }), GBC.eol().fill(GBC.HORIZONTAL)); 498 520 buttons.add(new JButton(new AbstractAction(tr("Delete")){ 521 @Override 499 522 public void actionPerformed(ActionEvent event) { 500 523 if (list.getSelectedValue() == null) {
Note:
See TracChangeset
for help on using the changeset viewer.