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

Last change on this file since 21777 was 20390, checked in by pieren, 15 years ago

Many small fixes and improvements

File size: 1.3 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;
7
8import javax.swing.JOptionPane;
9
10import org.openstreetmap.josm.Main;
11import org.openstreetmap.josm.actions.JosmAction;
12
13public class MenuActionBuildings extends JosmAction {
14
15 public static String name = "Grab buildings only";
16
17 private static final long serialVersionUID = 1L;
18
19 public MenuActionBuildings() {
20 super(tr(name), "cadastre_small", tr("Grab building layer only"), null, false);
21 }
22
23 public void actionPerformed(ActionEvent e) {
24 if (Main.map != null) {
25 if (CadastrePlugin.isCadastreProjection()) {
26 WMSLayer wmsLayer = WMSDownloadAction.getLayer();
27 if (wmsLayer != null)
28 DownloadWMSVectorImage.download(wmsLayer, true);
29 } else {
30 JOptionPane.showMessageDialog(Main.parent,
31 tr("To enable the cadastre WMS plugin, change\n"
32 + "the current projection to one of the cadastre\n"
33 + "projections and retry"));
34 }
35 } else
36 new MenuActionNewLocation().actionPerformed(e);
37 }
38
39}
Note: See TracBrowser for help on using the repository browser.