Changeset 23837 in osm for applications/editors
- Timestamp:
- 2010-10-26T01:12:25+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/AddressNode.java
r23836 r23837 14 14 package org.openstreetmap.josm.plugins.addressEdit; 15 15 16 import org.openstreetmap.josm.Main; 17 import org.openstreetmap.josm.command.ChangeCommand; 18 import org.openstreetmap.josm.data.osm.Node; 16 19 import org.openstreetmap.josm.data.osm.OsmPrimitive; 17 20 … … 149 152 if (streetName != null && streetName.length() == 0) return; 150 153 151 this.osmObject.put(TagUtils.ADDR_STREET_TAG, streetName);152 this.osmObject.setModified(true);153 } 154 changeAddressValue(TagUtils.ADDR_STREET_TAG, streetName); 155 } 156 154 157 155 158 /** … … 160 163 if (state != null && state.length() == 0) return; 161 164 162 this.osmObject.put(TagUtils.ADDR_STATE_TAG, state); 163 this.osmObject.setModified(true); 165 changeAddressValue(TagUtils.ADDR_STATE_TAG, state); 164 166 } 165 167 … … 171 173 if (country != null && country.length() == 0) return; 172 174 173 this.osmObject.put(TagUtils.ADDR_COUNTRY_TAG, country); 174 this.osmObject.setModified(true); 175 changeAddressValue(TagUtils.ADDR_COUNTRY_TAG, country); 175 176 } 176 177 … … 182 183 if (postCode != null && postCode.length() == 0) return; 183 184 184 this.osmObject.put(TagUtils.ADDR_POSTCODE_TAG, postCode); 185 this.osmObject.setModified(true); 186 } 185 changeAddressValue(TagUtils.ADDR_POSTCODE_TAG, postCode); 186 } 187 188 /** 189 * Internal helper method which changes the given property and 190 * puts the appropriate command {@link src.org.openstreetmap.josm.command.Command} 191 * into the undo/redo queue. 192 * @param tag The tag to change. 193 * @param newValue The new value for the tag. 194 */ 195 private void changeAddressValue(String tag, String newValue) { 196 Node oldNode = (Node)osmObject; 197 OsmPrimitive newNode = new Node(oldNode); 198 newNode.put(tag, newValue); 199 Main.main.undoRedo.add( new ChangeCommand(oldNode, newNode)); 200 } 201 187 202 188 203 @Override
Note:
See TracChangeset
for help on using the changeset viewer.