1 | package iodb;
|
---|
2 |
|
---|
3 | import java.awt.event.ActionEvent;
|
---|
4 | import java.util.HashMap;
|
---|
5 | import java.util.Map;
|
---|
6 | import org.openstreetmap.josm.Main;
|
---|
7 | import org.openstreetmap.josm.actions.JosmAction;
|
---|
8 | import org.openstreetmap.josm.data.coor.LatLon;
|
---|
9 | import org.openstreetmap.josm.data.projection.Projection;
|
---|
10 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
11 |
|
---|
12 | /**
|
---|
13 | * Upload the current imagery offset or an calibration object information.
|
---|
14 | *
|
---|
15 | * @author zverik
|
---|
16 | */
|
---|
17 | public class StoreImageryOffsetAction extends JosmAction {
|
---|
18 |
|
---|
19 | public StoreImageryOffsetAction() {
|
---|
20 | super(tr("Store Imagery Offset..."), "storeoffset", tr("Upload an offset for current imagery (or calibration object information) to a server"), null, false);
|
---|
21 | }
|
---|
22 |
|
---|
23 | public void actionPerformed(ActionEvent e) {
|
---|
24 | // todo: check that there is an imagery
|
---|
25 | // and that it is moved
|
---|
26 | Projection proj = Main.map.mapView.getProjection();
|
---|
27 | LatLon center = proj.eastNorth2latlon(Main.map.mapView.getCenter());
|
---|
28 | // todo: open an upload window
|
---|
29 | // todo: if an object was selected, ask if the user wants to upload it
|
---|
30 | // todo: enter all metadata (that is, a description)
|
---|
31 | // todo: upload object info to server
|
---|
32 | }
|
---|
33 |
|
---|
34 | private static void upload( ImageryOffsetBase offset ) {
|
---|
35 | String base = Main.pref.get("iodb.server.url", "http://offsets.textual.ru/");
|
---|
36 | Map<String, String> params = new HashMap<String, String>();
|
---|
37 | offset.putServerParams(params);
|
---|
38 | // todo
|
---|
39 | }
|
---|
40 | }
|
---|