Changeset 32425 in osm for applications/editors/josm


Ignore:
Timestamp:
2016-06-28T23:22:36+02:00 (9 years ago)
Author:
donvip
Message:

remove calls to deprecated methods

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/Address.java

    r32211 r32425  
    4848import org.openstreetmap.josm.command.SequenceCommand;
    4949import org.openstreetmap.josm.data.coor.EastNorth;
     50import org.openstreetmap.josm.data.osm.DataSet;
    5051import org.openstreetmap.josm.data.osm.Node;
    5152import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    526527
    527528    private static void setNewSelection(OsmPrimitive osm) {
    528         Collection<OsmPrimitive> newSelection = new LinkedList<>(Main.main.getCurrentDataSet().getSelected());
     529        DataSet ds = Main.getLayerManager().getEditDataSet();
     530        Collection<OsmPrimitive> newSelection = new LinkedList<>(ds.getSelected());
    529531        newSelection.clear();
    530532        newSelection.add(osm);
    531         getCurrentDataSet().setSelected(osm);
     533        ds.setSelected(osm);
    532534    }
    533535}
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java

    r32329 r32425  
    580580                    Main.info("Try to grab into a new layer when "+wmsLayer.getName()+" is already opened.");
    581581                    // remove the duplicated layer
    582                     Main.main.removeLayer(wmsLayer);
     582                    Main.getLayerManager().removeLayer(wmsLayer);
    583583                    throw new DuplicateLayerException();
    584584                }
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java

    r32329 r32425  
    458458            int wmsNewLayerPos = Main.getLayerManager().getLayers().size();
    459459            for(Layer l : Main.getLayerManager().getLayersOfType(WMSLayer.class)) {
    460                 int wmsPos = Main.map.mapView.getLayerPos(l);
     460                int wmsPos = Main.getLayerManager().getLayers().indexOf(l);
    461461                if (wmsPos < wmsNewLayerPos) wmsNewLayerPos = wmsPos;
    462462            }
    463             Main.main.addLayer(wmsLayer);
     463            Main.getLayerManager().addLayer(wmsLayer);
    464464            // Move the layer to its new position
    465465            Main.map.mapView.moveLayer(wmsLayer, wmsNewLayerPos);
    466466        } else
    467             Main.main.addLayer(wmsLayer);
     467            Main.getLayerManager().addLayer(wmsLayer);
    468468    }
    469469
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java

    r32211 r32425  
    142142        // check if the new way or its nodes is already in OSM layer
    143143        for (Node n : svgDataSet.getNodes()) {
    144             Node nearestNewNode = checkNearestNode(n, Main.main.getCurrentDataSet().getNodes());
     144            Node nearestNewNode = checkNearestNode(n, Main.getLayerManager().getEditDataSet().getNodes());
    145145            if (nearestNewNode != n) {
    146146                // replace the SVG node by the OSM node
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSVectorImage.java

    r32205 r32425  
    4343                        // set raster image commune bounding box based on current view (before adjustment)
    4444                        JOptionPane.showMessageDialog(Main.parent,tr("This commune is not vectorized.\nPlease use the other menu entry to georeference a \"Plan image\""));
    45                         Main.main.removeLayer(wmsLayer);
     45                        Main.getLayerManager().removeLayer(wmsLayer);
    4646                        wmsLayer = null;
    4747                        return;
     
    5656            else if(wmsLayer.getImages().size()==0)
    5757              // failed to contact WMS of find this commune. Remove layer if empty.
    58               Main.main.removeLayer(wmsLayer);
     58              Main.getLayerManager().removeLayer(wmsLayer);
    5959        } catch (DuplicateLayerException e) {
    6060            // we tried to grab onto a duplicated layer (removed)
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/RasterImageGeoreferencer.java

    r32060 r32425  
    159159     if (selectedValue == 0) { // "Cancel"
    160160         // remove layer
    161          Main.main.removeLayer(wmsLayer);
     161         Main.getLayerManager().removeLayer(wmsLayer);
    162162         wmsLayer = null;
    163163         Main.map.mapView.removeMouseListener(this);
     
    348348     actionCompleted();
    349349     if (wmsLayer != null) {
    350          Main.main.removeLayer(wmsLayer);
     350         Main.getLayerManager().removeLayer(wmsLayer);
    351351         wmsLayer = null;
    352352     }
Note: See TracChangeset for help on using the changeset viewer.