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

Last change on this file since 33047 was 33047, checked in by donvip, 8 years ago

findbugs

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package cadastre_fr;
3
4import static org.openstreetmap.josm.tools.I18n.marktr;
5import static org.openstreetmap.josm.tools.I18n.tr;
6
7import java.awt.event.ActionEvent;
8import java.awt.event.KeyEvent;
9
10import org.openstreetmap.josm.Main;
11import org.openstreetmap.josm.actions.JosmAction;
12import org.openstreetmap.josm.tools.Shortcut;
13
14/**
15 * Action calling the wms grabber for cadastre.gouv.fr
16 */
17public class MenuActionGrab extends JosmAction {
18
19 public static final String NAME = marktr("Cadastre grab");
20
21 /**
22 * Constructs a new {@code MenuActionGrab}.
23 */
24 public MenuActionGrab() {
25 super(tr(NAME), "cadastre_small", tr("Download Image from French Cadastre WMS"),
26 Shortcut.registerShortcut("cadastre:grab", tr("Cadastre: {0}", tr("Download Image from French Cadastre WMS")),
27 KeyEvent.VK_F10, Shortcut.DIRECT), false, "cadastrefr/grab", true);
28 }
29
30 @Override
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}
Note: See TracBrowser for help on using the repository browser.