Changeset 24210 in osm
- Timestamp:
- 2010-11-12T23:30:53+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/FixAddressesPlugin.java
r24112 r24210 26 26 public class FixAddressesPlugin extends Plugin { 27 27 private static IncompleteAddressesDialog incompleteAddrDlg; 28 private static FixAddressesPreferences preferences; 28 29 29 30 /** … … 34 35 super(info); 35 36 36 // Create action for edit...37 // Create actions... 37 38 FixUnresolvedStreetsAction action = new FixUnresolvedStreetsAction(); 38 39 SelectIncompleteAddressesAction incAddrAction = new SelectIncompleteAddressesAction(); 39 40 40 // ... and add itto the tools menu in main41 // ... and add them to the tools menu in main 41 42 Main.main.menu.toolsMenu.addSeparator(); 42 43 Main.main.menu.toolsMenu.add(action); 43 44 Main.main.menu.toolsMenu.add(incAddrAction); 44 45 45 // Create dialog46 46 // create preferences instance 47 preferences = (FixAddressesPreferences) new FixAddressesPreferences.Factory().createPreferenceSetting(); 47 48 } 48 49 … … 72 73 return incompleteAddrDlg; 73 74 } 75 76 /** 77 * Gets the preferences instance for this plugin. 78 * 79 * @return the preferences 80 */ 81 public static FixAddressesPreferences getPreferences() { 82 return preferences; 83 } 74 84 } -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/OSMAddress.java
r24209 r24210 14 14 package org.openstreetmap.josm.plugins.fixAddresses; 15 15 16 import java.util.Collection; 16 17 import java.util.HashMap; 17 18 … … 448 449 449 450 /** 451 * Gets all guessed objects or an empty list, if no guesses have been made yet. 452 * 453 * @return the guessed objects. 454 */ 455 public Collection<OsmPrimitive> getGuessedObjects() { 456 if (guessedObjects == null) return null; 457 458 return guessedObjects.values(); 459 } 460 461 /** 450 462 * Check if this instance needs guessed values. This is the case, if the underlying OSM node 451 463 * has either no street name, post code or city. … … 497 509 public void setGuessedValue(String tag, String value, OsmPrimitive osm) { 498 510 CheckParameterUtil.ensureParameterNotNull(tag, "tag"); 499 CheckParameterUtil.ensureParameterNotNull(value, "value"); 500 CheckParameterUtil.ensureParameterNotNull(osm, "osm");501 502 guessedValues.put(tag, value);503 guessedObjects.put(tag, osm);504 fireEntityChanged(this);511 512 if (value != null && osm != null) { 513 guessedValues.put(tag, value); 514 guessedObjects.put(tag, osm); 515 fireEntityChanged(this); 516 } 505 517 } 506 518 -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/SelectAddressesInMapAction.java
r24165 r24210 36 36 import org.openstreetmap.josm.data.osm.OsmPrimitive; 37 37 import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer; 38 import org.openstreetmap.josm.plugins.fixAddresses.FixAddressesPlugin; 38 39 import org.openstreetmap.josm.plugins.fixAddresses.OSMAddress; 39 40 import org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditSelectionEvent; … … 102 103 for (OSMAddress aNode : addrToSel) { 103 104 sel.add(aNode.getOsmObject()); 105 106 // Select also guessed objects, if wished 107 if (FixAddressesPlugin.getPreferences().isSelectGuessedObjects()) { 108 for (OsmPrimitive osmPrimitive : aNode.getGuessedObjects()) { 109 sel.add(osmPrimitive); 110 } 111 } 104 112 } 105 113
Note:
See TracChangeset
for help on using the changeset viewer.