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

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

Something works :)

File size: 1.5 KB
Line 
1package iodb;
2
3import java.awt.event.ActionEvent;
4import java.util.HashMap;
5import java.util.Map;
6import org.openstreetmap.josm.Main;
7import org.openstreetmap.josm.actions.JosmAction;
8import org.openstreetmap.josm.data.coor.LatLon;
9import org.openstreetmap.josm.data.projection.Projection;
10import 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 */
17public 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}
Note: See TracBrowser for help on using the repository browser.