Ignore:
Timestamp:
2009-10-25T20:48:47+01:00 (15 years ago)
Author:
pieren
Message:

fix some warnings and easier selection of WMSlayer in WMSAdjustAction

Location:
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr
Files:
6 edited

Legend:

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

    r18207 r18278  
    1212import static org.openstreetmap.josm.tools.I18n.tr;
    1313
    14 import java.awt.image.BufferedImage;
    1514import java.io.*;
    1615import java.util.ArrayList;
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java

    r18271 r18278  
    7676 *                 - fixed bug of raster image loaded from cache not working on Java1.6
    7777 *                 - improve mouse click bounce detection during georeferencing process
    78  * 1.4 23-Oct-2009 - add support for new Lambert CC 9 Zones projection
     78 * 1.4 25-Oct-2009 - add support for new Lambert CC 9 Zones projection
    7979 *                 - add optional crosspieces display on raster image layers
    8080 *                 - add automatic raster images georeferencing when WMS provides data
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java

    r18271 r18278  
    44
    55import java.io.IOException;
    6 import java.util.ArrayList;
    76import java.util.concurrent.Future;
    87
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java

    r18207 r18278  
    77import java.util.ArrayList;
    88
    9 import javax.swing.JComboBox;
    109import javax.swing.JLabel;
    1110import javax.swing.JOptionPane;
     
    5049            inputTown.setToolTipText(tr("<html>Enter the town,village or city name.<br>"
    5150                    + "Use the syntax and punctuation known by www.cadastre.gouv.fr .</html>"));
    52             JComboBox inputWMSList = null;
    5351
    5452            p.add(labelSectionNewLocation, GBC.eol());
     
    8886                Main.main.addLayer(wmsLayer);
    8987                System.out.println("Add new layer with Location:" + inputTown.getText());
    90             } else if (existingLayers != null && existingLayers.size() > 0 && inputWMSList.getSelectedIndex() > 0) {
    91                 wmsLayer = existingLayers.get(inputWMSList.getSelectedIndex()-1);
     88            } else if (existingLayers != null && existingLayers.size() > 0 && Main.map.mapView.getActiveLayer() instanceof WMSLayer) {
     89                wmsLayer = (WMSLayer)Main.map.mapView.getActiveLayer();
    9290                resetCookie = true;
    9391            }
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionSaveRasterAs.java

    r18109 r18278  
    55import java.awt.event.ActionEvent;
    66import java.awt.image.BufferedImage;
    7 import java.io.BufferedOutputStream;
    87import java.io.File;
    9 import java.io.FileOutputStream;
    108import java.io.IOException;
    119
     
    1614import org.openstreetmap.josm.Main;
    1715import org.openstreetmap.josm.actions.JosmAction;
    18 
    19 import com.sun.image.codec.jpeg.JPEGCodec;
    20 import com.sun.image.codec.jpeg.JPEGImageEncoder;
    2116
    2217public class MenuActionSaveRasterAs extends JosmAction {
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSAdjustAction.java

    r18256 r18278  
    3838    @Override public void enterMode() {
    3939        if (Main.map != null) {
     40            selectedLayer = null;
     41            WMSLayer possibleLayer = null;
     42            int cRasterLayers = 0;
     43            for (Layer l : Main.map.mapView.getAllLayers()) {
     44                if (l instanceof WMSLayer && ((WMSLayer)l).isRaster()) {
     45                    possibleLayer = (WMSLayer)l;
     46                    cRasterLayers++;
     47                }
     48            }
    4049            Layer activeLayer = Main.map.mapView.getActiveLayer();
    4150            if (activeLayer instanceof WMSLayer && ((WMSLayer)activeLayer).isRaster()) {
     51                selectedLayer = (WMSLayer)activeLayer;
     52            } else if (cRasterLayers == 1) {
     53                selectedLayer = possibleLayer;
     54            }
     55            if (selectedLayer != null) {
    4256                super.enterMode();
    4357                Main.map.mapView.addMouseListener(this);
    4458                Main.map.mapView.addMouseMotionListener(this);
    4559                rasterMoved = false;
    46                 selectedLayer = (WMSLayer)activeLayer;
    4760            } else {
    4861                JOptionPane.showMessageDialog(Main.parent,tr("This mode works only if active layer is\n"
Note: See TracChangeset for help on using the changeset viewer.