Ignore:
Timestamp:
2010-03-09T22:02:00+01:00 (15 years ago)
Author:
pieren
Message:

Many small fixes and improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionBuildings.java

    r18544 r20390  
    1313public class MenuActionBuildings extends JosmAction {
    1414   
    15     public static String name = "Building footprints";
     15    public static String name = "Grab buildings only";
    1616
    1717    private static final long serialVersionUID = 1L;
    18     private WMSLayer wmsLayer = null;
    1918   
    2019    public MenuActionBuildings() {
    21         super(tr(name), "cadastre_small", tr("Extract building footprints"), null, false);
     20        super(tr(name), "cadastre_small", tr("Grab building layer only"), null, false);
    2221    }
    2322
    24     public void actionPerformed(ActionEvent arg0) {
    25         wmsLayer = WMSDownloadAction.getLayer();
    26         if (wmsLayer != null) {
    27             if (wmsLayer.isRaster()) {
     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 {
    2830                JOptionPane.showMessageDialog(Main.parent,
    29                         tr("Only on vectorized layers"), tr("Error"),
    30                         JOptionPane.ERROR_MESSAGE);
    31                 return;
     31                        tr("To enable the cadastre WMS plugin, change\n"
     32                         + "the current projection to one of the cadastre\n"
     33                         + "projections and retry"));
    3234            }
    33             DownloadSVGBuilding.download(wmsLayer);
    34         }
     35        } else
     36            new MenuActionNewLocation().actionPerformed(e);
    3537    }
    3638
Note: See TracChangeset for help on using the changeset viewer.