1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package cadastre_fr;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.tools.I18n.marktr;
|
---|
5 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
6 |
|
---|
7 | import java.awt.event.ActionEvent;
|
---|
8 |
|
---|
9 | import org.openstreetmap.josm.Main;
|
---|
10 | import org.openstreetmap.josm.actions.JosmAction;
|
---|
11 |
|
---|
12 | public class MenuActionRefineGeoRef extends JosmAction {
|
---|
13 |
|
---|
14 | public static final String NAME = marktr("Refine georeferencing");
|
---|
15 |
|
---|
16 | private WMSLayer wmsLayer;
|
---|
17 | private RasterImageGeoreferencer rasterImageGeoreferencer;
|
---|
18 |
|
---|
19 | /**
|
---|
20 | * Constructs a new {@code MenuActionRefineGeoRef}.
|
---|
21 | * @param wmsLayer WMS layer
|
---|
22 | */
|
---|
23 | public MenuActionRefineGeoRef(WMSLayer wmsLayer) {
|
---|
24 | super(tr(NAME), null, tr("Improve georeferencing (only raster images)"), null, false);
|
---|
25 | this.wmsLayer = wmsLayer;
|
---|
26 | rasterImageGeoreferencer = new RasterImageGeoreferencer();
|
---|
27 | }
|
---|
28 |
|
---|
29 | @Override
|
---|
30 | public void actionPerformed(ActionEvent arg0) {
|
---|
31 | if (!wmsLayer.isRaster()) {
|
---|
32 | Main.info("MenuActionRefineGeoRef called for unexpected layer type");
|
---|
33 | return;
|
---|
34 | }
|
---|
35 | if (CadastrePlugin.isCadastreProjection()) {
|
---|
36 | //wmsLayer = WMSDownloadAction.getLayer();
|
---|
37 | } else {
|
---|
38 | CadastrePlugin.askToChangeProjection();
|
---|
39 | }
|
---|
40 | rasterImageGeoreferencer.addListener();
|
---|
41 | rasterImageGeoreferencer.startGeoreferencing(wmsLayer);
|
---|
42 | }
|
---|
43 | }
|
---|