source: osm/applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrab.java@ 29677

Last change on this file since 29677 was 29101, checked in by pieren, 12 years ago

#8229 patch from Don-vip going directly to projection preference window if grab action is called in incompatible cadastre proj.

  • Property svn:eol-style set to native
File size: 1.5 KB
Line 
1// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
2package cadastre_fr;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5import static org.openstreetmap.josm.tools.I18n.marktr;
6
7import java.awt.event.ActionEvent;
8import java.awt.event.KeyEvent;
9
10import javax.swing.JOptionPane;
11
12import org.openstreetmap.josm.Main;
13import org.openstreetmap.josm.actions.JosmAction;
14import org.openstreetmap.josm.tools.Shortcut;
15
16public class MenuActionGrab extends JosmAction {
17
18 /**
19 * Action calling the wms grabber for cadastre.gouv.fr
20 */
21 private static final long serialVersionUID = 1L;
22
23 public static String name = marktr("Cadastre grab");
24
25 public MenuActionGrab() {
26 super(tr(name), "cadastre_small", tr("Download Image from French Cadastre WMS"),
27 Shortcut.registerShortcut("cadastre:grab", tr("Cadastre: {0}", tr("Download Image from French Cadastre WMS")),
28 KeyEvent.VK_F10, Shortcut.DIRECT), false, "cadastrefr/grab", true);
29 }
30
31 public void actionPerformed(ActionEvent e) {
32 if (Main.map != null) {
33 if (CadastrePlugin.isCadastreProjection()) {
34 WMSLayer wmsLayer = WMSDownloadAction.getLayer();
35 if (wmsLayer != null)
36 DownloadWMSVectorImage.download(wmsLayer);
37 } else {
38 CadastrePlugin.askToChangeProjection();
39 }
40 } else
41 new MenuActionNewLocation().actionPerformed(e);
42 }
43
44}
Note: See TracBrowser for help on using the repository browser.