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

Last change on this file since 18743 was 18544, checked in by pieren, 15 years ago

Add licence in headers for GPL compliance.

  • Property svn:eol-style set to native
File size: 1.8 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;
5
6import java.awt.event.ActionEvent;
7import java.awt.event.KeyEvent;
8
9import javax.swing.JOptionPane;
10
11import org.openstreetmap.josm.Main;
12import org.openstreetmap.josm.actions.JosmAction;
13import org.openstreetmap.josm.data.projection.LambertCC9Zones;
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 = "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_F11, Shortcut.GROUP_DIRECT), false);
29 }
30
31 public void actionPerformed(ActionEvent e) {
32 // with the new projection LambertCC9Zones, we are able to determin the zone and thus lat/lon of
33 // downloaded commune bounding box
34 if (Main.map != null || Main.proj instanceof LambertCC9Zones) {
35 if (CadastrePlugin.isCadastreProjection()) {
36 WMSLayer wmsLayer = WMSDownloadAction.getLayer();
37 if (wmsLayer != null)
38 DownloadWMSVectorImage.download(wmsLayer);
39 } else {
40 JOptionPane.showMessageDialog(Main.parent,
41 tr("To enable the cadastre WMS plugin, change\n"
42 + "the current projection to one of the cadastre\n"
43 + "projections and retry"));
44 }
45 }
46 }
47
48}
Note: See TracBrowser for help on using the repository browser.