Changeset 6140 in josm
- Timestamp:
- 2013-08-11T21:09:08+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/PasteAction.java
r6084 r6140 111 111 } 112 112 PrimitiveData copy = data.makeCopy(); 113 copy.clearOsm Id();113 copy.clearOsmMetadata(); 114 114 if (data instanceof NodeData) { 115 115 newNodeIds.put(data.getUniqueId(), copy.getUniqueId()); -
trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java
r6090 r6140 200 200 201 201 /** 202 * Clears the id and version known to the OSM API. The id and the version is set to 0. 203 * incomplete is set to false. It's preferred to use copy constructor with clearId set to true instead 202 * Clears the metadata, including id and version known to the OSM API. 203 * The id is a new unique id. The version, changeset and timestamp are set to 0. 204 * incomplete and deleted are set to false. It's preferred to use copy constructor with clearMetadata set to true instead 204 205 * of calling this method. 205 */ 206 public void clearOsmId() { 206 * @since 6140 207 */ 208 public void clearOsmMetadata() { 207 209 // Not part of dataset - no lock necessary 208 210 this.id = generateUniqueId(); … … 210 212 this.user = null; 211 213 this.changesetId = 0; // reset changeset id on a new object 214 this.timestamp = 0; 212 215 this.setIncomplete(false); 216 this.setDeleted(false); 217 this.setVisible(true); 213 218 } 214 219 -
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r6105 r6140 152 152 * Constructs an identical clone of the argument. 153 153 * @param clone The node to clone 154 * @param clear Id If true, set version to 0 and id to new unique value155 */ 156 public Node(Node clone, boolean clear Id) {154 * @param clearMetadata If {@code true}, clears the OSM id and other metadata as defined by {@link #clearOsmMetadata}. If {@code false}, does nothing 155 */ 156 public Node(Node clone, boolean clearMetadata) { 157 157 super(clone.getUniqueId(), true /* allow negative IDs */); 158 158 cloneFrom(clone); 159 if (clear Id) {160 clearOsm Id();159 if (clearMetadata) { 160 clearOsmMetadata(); 161 161 } 162 162 } -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r6069 r6140 383 383 384 384 /** 385 * Clears the id and version known to the OSM API. The id and the version is set to 0.386 * incomplete is set to false. It's preferred to use copy constructor with clearId set to true instead387 * of calling this method.385 * Clears the metadata, including id and version known to the OSM API. 386 * The id is a new unique id. The version, changeset and timestamp are set to 0. 387 * incomplete and deleted are set to false. It's preferred to use copy constructor with clearMetadata set to true instead 388 388 * 389 389 * <strong>Caution</strong>: Do not use this method on primitives which are already added to a {@link DataSet}. 390 390 * 391 391 * @throws DataIntegrityProblemException If primitive was already added to the dataset 392 */ 393 @Override 394 public void clearOsmId() { 392 * @since 6140 393 */ 394 @Override 395 public void clearOsmMetadata() { 395 396 if (dataSet != null) 396 397 throw new DataIntegrityProblemException("Method cannot be called after primitive was added to the dataset"); 397 super.clearOsm Id();398 super.clearOsmMetadata(); 398 399 } 399 400 -
trunk/src/org/openstreetmap/josm/data/osm/Relation.java
r6105 r6140 183 183 } 184 184 185 public Relation(Relation clone, boolean clearId) { 185 /** 186 * Constructs an identical clone of the argument. 187 * @param clone The relation to clone 188 * @param clearMetadata If {@code true}, clears the OSM id and other metadata as defined by {@link #clearOsmMetadata}. If {@code false}, does nothing 189 */ 190 public Relation(Relation clone, boolean clearMetadata) { 186 191 super(clone.getUniqueId(), true); 187 192 cloneFrom(clone); 188 if (clear Id) {189 clearOsm Id();193 if (clearMetadata) { 194 clearOsmMetadata(); 190 195 } 191 196 } … … 193 198 /** 194 199 * Create an identical clone of the argument (including the id) 200 * @param clone The relation to clone, including its id 195 201 */ 196 202 public Relation(Relation clone) { -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r6105 r6140 232 232 * Contructs a new {@code Way} from an existing {@code Way}. 233 233 * @param original The original {@code Way} to be identically cloned. Must not be null 234 * @param clear Id If true, clears the OSM id as defined by {@link #clearOsmId}. If false, does nothing234 * @param clearMetadata If {@code true}, clears the OSM id and other metadata as defined by {@link #clearOsmMetadata}. If {@code false}, does nothing 235 235 * @since 2410 236 236 */ 237 public Way(Way original, boolean clear Id) {237 public Way(Way original, boolean clearMetadata) { 238 238 super(original.getUniqueId(), true); 239 239 cloneFrom(original); 240 if (clear Id) {241 clearOsm Id();240 if (clearMetadata) { 241 clearOsmMetadata(); 242 242 } 243 243 }
Note:
See TracChangeset
for help on using the changeset viewer.