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

Last change on this file since 27880 was 27880, checked in by stoecker, 13 years ago

prevent conflicts with windows

  • Property svn:eol-style set to native
File size: 1.7 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_F9, Shortcut.DIRECT), false);
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 JOptionPane.showMessageDialog(Main.parent,
39 tr("To enable the cadastre WMS plugin, change\n"
40 + "the current projection to one of the cadastre\n"
41 + "projections and retry"));
42 }
43 } else
44 new MenuActionNewLocation().actionPerformed(e);
45 }
46
47}
Note: See TracBrowser for help on using the repository browser.