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