Line | |
---|
1 | // License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
|
---|
2 | package cadastre_fr;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
5 |
|
---|
6 | import java.awt.event.ActionEvent;
|
---|
7 |
|
---|
8 | import javax.swing.JOptionPane;
|
---|
9 |
|
---|
10 | import org.openstreetmap.josm.Main;
|
---|
11 | import org.openstreetmap.josm.actions.JosmAction;
|
---|
12 |
|
---|
13 | public 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.