Line | |
---|
1 | package iodb;
|
---|
2 |
|
---|
3 | import java.util.Map;
|
---|
4 | import org.openstreetmap.josm.data.osm.*;
|
---|
5 |
|
---|
6 | /**
|
---|
7 | *
|
---|
8 | * @author zverik
|
---|
9 | */
|
---|
10 | public 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.