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

Last change on this file since 16929 was 16929, checked in by pieren, 16 years ago

support new projections for French overseas departements and move projection checking from startup to grab action (since projection is dynamic)

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1package cadastre_fr;
2
3import static org.openstreetmap.josm.tools.I18n.tr;
4
5import java.awt.event.ActionEvent;
6import java.awt.event.KeyEvent;
7
8import javax.swing.JOptionPane;
9
10import org.openstreetmap.josm.Main;
11import org.openstreetmap.josm.actions.JosmAction;
12import org.openstreetmap.josm.tools.Shortcut;
13
14public class MenuActionGrab extends JosmAction {
15
16 /**
17 * Action calling the wms grabber for cadastre.gouv.fr
18 */
19 private static final long serialVersionUID = 1L;
20
21 public static String name = "Cadastre grab";
22
23 public MenuActionGrab() {
24 super(tr(name), "cadastre_small", tr("Download Image from French Cadastre WMS"),
25 Shortcut.registerShortcut("cadastre:grab", tr("Cadastre: {0}", tr("Download Image from French Cadastre WMS")),
26 KeyEvent.VK_F11, Shortcut.GROUP_DIRECT), false);
27 }
28
29 public void actionPerformed(ActionEvent e) {
30 if (Main.map != null) {
31 if (CadastrePlugin.isCadastreProjection()) {
32 WMSLayer wmsLayer = WMSDownloadAction.getLayer();
33 if (wmsLayer != null)
34 DownloadWMSTask.download(wmsLayer);
35 } else {
36 JOptionPane.showMessageDialog(Main.parent,
37 tr("To enable the cadastre WMS plugin, change\n"
38 + "the current projection to one of the cadastre\n"
39 + "projection and retry"));
40 }
41 }
42 }
43
44}
Note: See TracBrowser for help on using the repository browser.