Changeset 23846 in osm for applications/editors/josm
- Timestamp:
- 2010-10-26T17:52:56+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/AddressNode.java
r23837 r23846 152 152 if (streetName != null && streetName.length() == 0) return; 153 153 154 changeAddressValue(TagUtils.ADDR_STREET_TAG, streetName);154 setOSMTag(TagUtils.ADDR_STREET_TAG, streetName); 155 155 } 156 156 … … 163 163 if (state != null && state.length() == 0) return; 164 164 165 changeAddressValue(TagUtils.ADDR_STATE_TAG, state);165 setOSMTag(TagUtils.ADDR_STATE_TAG, state); 166 166 } 167 167 … … 173 173 if (country != null && country.length() == 0) return; 174 174 175 changeAddressValue(TagUtils.ADDR_COUNTRY_TAG, country);175 setOSMTag(TagUtils.ADDR_COUNTRY_TAG, country); 176 176 } 177 177 … … 183 183 if (postCode != null && postCode.length() == 0) return; 184 184 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 202 185 setOSMTag(TagUtils.ADDR_POSTCODE_TAG, postCode); 186 } 187 203 188 @Override 204 189 public String toString() { -
applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/NodeEntityBase.java
r23834 r23846 19 19 import java.util.List; 20 20 21 import org.openstreetmap.josm.Main; 22 import org.openstreetmap.josm.command.ChangeCommand; 23 import org.openstreetmap.josm.data.osm.Node; 21 24 import org.openstreetmap.josm.data.osm.OsmPrimitive; 22 25 … … 89 92 return TagUtils.hasNameTag(osmObject); 90 93 } 94 95 /** 96 * Internal helper method which changes the given property and 97 * puts the appropriate command {@link src.org.openstreetmap.josm.command.Command} 98 * into the undo/redo queue. 99 * @param tag The tag to change. 100 * @param newValue The new value for the tag. 101 */ 102 protected void setOSMTag(String tag, String newValue) { 103 Node oldNode = (Node)osmObject; 104 OsmPrimitive newNode = new Node(oldNode); 105 newNode.put(tag, newValue); 106 Main.main.undoRedo.add( new ChangeCommand(oldNode, newNode)); 107 } 91 108 92 109 /* (non-Javadoc)
Note:
See TracChangeset
for help on using the changeset viewer.