source: osm/applications/editors/josm/plugins/imagery_offset_db/src/iodb/CalibrationObject.java@ 28008

Last change on this file since 28008 was 28008, checked in by zverik, 12 years ago

Something works :)

File size: 1.0 KB
Line 
1package iodb;
2
3import java.util.Map;
4import org.openstreetmap.josm.data.osm.*;
5
6/**
7 *
8 * @author zverik
9 */
10public class CalibrationObject extends ImageryOffsetBase {
11 private OsmPrimitive object;
12 private long lastUserId;
13
14 public CalibrationObject(OsmPrimitive object, long lastUserId) {
15 this.object = object;
16 this.lastUserId = lastUserId;
17 }
18
19 public CalibrationObject(OsmPrimitive object) {
20 this(object, getLastUserId(object));
21 }
22
23 public long getLastUserId() {
24 return lastUserId;
25 }
26
27 public OsmPrimitive getObject() {
28 return object;
29 }
30
31 private static long getLastUserId( OsmPrimitive object ) {
32 return object.getUser() == null ? -1 : object.getUser().getId(); // todo?
33 }
34
35 @Override
36 public void putServerParams( Map<String, String> map ) {
37 super.putServerParams(map);
38 map.put("object", object instanceof Node ? "node" : "way");
39 map.put("id", String.valueOf(object.getId()));
40 map.put("lastuser", String.valueOf(lastUserId));
41 }
42
43}
Note: See TracBrowser for help on using the repository browser.