Changeset 32329 in osm for applications/editors


Ignore:
Timestamp:
2016-06-19T16:08:56+02:00 (9 years ago)
Author:
donvip
Message:

fix #josm12953 - Replace most uses of MapView.getActiveLayer and similar methods (patch by michael2402, modified) - gsoc-core

Location:
applications/editors/josm/plugins
Files:
72 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/CommandLine/build.xml

    r31926 r32329  
    44    <property name="commit.message" value="JOSM/CommandLine: fix exception after JOSM update"/>
    55    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    6     <property name="plugin.main.version" value="9170"/>
     6    <property name="plugin.main.version" value="10279"/>
    77
    88    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLine.java

    r31927 r32329  
    369369                break;
    370370            case IMAGERYURL:
    371                 Layer layer = Main.map.mapView.getActiveLayer();
     371                Layer layer = Main.getLayerManager().getActiveLayer();
    372372                if (layer != null) {
    373373                    if (!(layer instanceof ImageryLayer)) {
    374                         List<ImageryLayer> imageryLayers = Main.map.mapView.getLayersOfType(ImageryLayer.class);
     374                        List<ImageryLayer> imageryLayers = Main.getLayerManager().getLayersOfType(ImageryLayer.class);
    375375                        if (imageryLayers.size() == 1) {
    376376                            layer = imageryLayers.get(0);
     
    389389                break;
    390390            case IMAGERYOFFSET:
    391                 Layer olayer = Main.map.mapView.getActiveLayer();
     391                Layer olayer = Main.getLayerManager().getActiveLayer();
    392392                if (olayer != null) {
    393393                    if (!(olayer instanceof ImageryLayer)) {
    394                         List<ImageryLayer> imageryLayers = Main.map.mapView.getLayersOfType(ImageryLayer.class);
     394                        List<ImageryLayer> imageryLayers = Main.getLayerManager().getLayersOfType(ImageryLayer.class);
    395395                        if (imageryLayers.size() == 1) {
    396396                            olayer = imageryLayers.get(0);
     
    597597                        GpxFilter gpxFilter = new GpxFilter();
    598598                        gpxFilter.initBboxFilter(bbox);
    599                         List<GpxLayer> gpxLayers = Main.map.mapView.getLayersOfType(GpxLayer.class);
     599                        List<GpxLayer> gpxLayers = Main.getLayerManager().getLayersOfType(GpxLayer.class);
    600600                        for (GpxLayer gpxLayer : gpxLayers) {
    601601                            gpxFilter.addGpxData(gpxLayer.data);
  • applications/editors/josm/plugins/CustomizePublicTransportStop/.project

    r32286 r32329  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<projectDescription>
    3         <name>josmPlugins</name>
     3        <name>JOSM-CustomizePublicTransportStop</name>
    44        <comment>JavaCC Nature</comment>
    55        <projects>
  • applications/editors/josm/plugins/DirectUpload/build.xml

    r31949 r32329  
    55    <property name="commit.message" value="applied JOSM Ticket 4498 (patch by ax) - oauth support for gpx upload (I accidentally committed parts of the path in [24236])"/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="9314"/>
     7    <property name="plugin.main.version" value="10279"/>
    88
    99    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/DirectUpload/src/org/openstreetmap/josm/plugins/DirectUpload/UploadOsmConnection.java

    r31871 r32329  
    1111import org.openstreetmap.josm.gui.layer.GpxLayer;
    1212import org.openstreetmap.josm.gui.layer.Layer;
     13import org.openstreetmap.josm.gui.layer.MainLayerManager;
    1314import org.openstreetmap.josm.io.OsmConnection;
    1415import org.openstreetmap.josm.io.OsmTransferException;
     
    4950    GpxData autoSelectTrace() {
    5051        if (Main.map != null && Main.map.mapView != null) {
    51             MapView mv = Main.map.mapView;
     52            MainLayerManager lm = Main.getLayerManager();
    5253//            List<Layer> allLayers = new ArrayList<Layer>(mv.getAllLayersAsList());  // modifiable
    5354            List<Layer> selectedLayers = LayerListDialog.getInstance().getModel().getSelectedLayers();
    54             List<GpxLayer> gpxLayersRemaining = mv.getLayersOfType(GpxLayer.class);
     55            List<GpxLayer> gpxLayersRemaining = lm.getLayersOfType(GpxLayer.class);
    5556            gpxLayersRemaining.removeAll(selectedLayers);
    5657            GpxLayer traceLayer = null;
     
    6869                }
    6970                // active layer
    70                 else if (mv.getActiveLayer() instanceof GpxLayer) {
    71                     traceLayer = (GpxLayer) mv.getActiveLayer();
     71                else if (lm.getActiveLayer() instanceof GpxLayer) {
     72                    traceLayer = (GpxLayer) lm.getActiveLayer();
    7273                }
    7374            }
    7475
    7576            if (traceLayer != null) {
    76                 GpxData data = traceLayer.data;
    77                 return data;
     77                return traceLayer.data;
    7878            }
    7979        }
  • applications/editors/josm/plugins/ElevationProfile/build.xml

    r32027 r32329  
    44    <property name="commit.message" value="[josm_elevationprofile]"/>
    55    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    6     <property name="plugin.main.version" value="9620"/>
     6    <property name="plugin.main.version" value="10279"/>
    77   
    88    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileDialog.java

    r32315 r32329  
    196196        MapView.addLayerChangeListener(this);
    197197        if (Main.isDisplayingMapView()) {
    198             Layer layer = Main.map.mapView.getActiveLayer();
     198            Layer layer = Main.getLayerManager().getActiveLayer();
    199199            if (layer instanceof GpxLayer) {
    200200                setActiveLayer((GpxLayer) layer);
  • applications/editors/josm/plugins/NanoLog/build.xml

    r31981 r32329  
    55    <property name="commit.message" value="NanoLog"/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="9383"/>
     7    <property name="plugin.main.version" value="10279"/>
    88    <property name="plugin.author" value="Ilya Zverev"/>
    99    <property name="plugin.class" value="nanolog.NanoLogPlugin"/>
  • applications/editors/josm/plugins/NanoLog/src/nanolog/GPXChooser.java

    r30491 r32329  
    1919    public static GpxLayer topLayer() {
    2020        // return first found local layer
    21         for( Layer layer : Main.map.mapView.getAllLayers() ) {
     21        for( Layer layer : Main.getLayerManager().getLayers() ) {
    2222            if( layer instanceof GpxLayer && ((GpxLayer)layer).isLocalFile() )
    2323                return (GpxLayer)layer;
  • applications/editors/josm/plugins/NanoLog/src/nanolog/NanoLogLayer.java

    r31981 r32329  
    298298        public void mousePressed( MouseEvent e ) {
    299299            int nearest = nearestEntry(e);
    300             if( nearest > 0 && Main.map.mapView.getActiveLayer() == NanoLogLayer.this ) {
     300            if( nearest > 0 && Main.getLayerManager().getActiveLayer() == NanoLogLayer.this ) {
    301301                dragging = nearest;
    302302                doDrag(e);
  • applications/editors/josm/plugins/NanoLog/src/nanolog/NanoLogPanel.java

    r30737 r32329  
    3737    public void updateMarkers() {
    3838        List<NanoLogEntry> entries = new ArrayList<>();
    39         for( NanoLogLayer l : Main.map.mapView.getLayersOfType(NanoLogLayer.class) ) {
     39        for( NanoLogLayer l : Main.getLayerManager().getLayersOfType(NanoLogLayer.class) ) {
    4040            entries.addAll(l.getEntries());
    4141        }
  • applications/editors/josm/plugins/cadastre-fr/build.xml

    r32054 r32329  
    44    <property name="commit.message" value="Changed constructor for Plugin"/>
    55    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    6     <property name="plugin.main.version" value="9759"/>
     6    <property name="plugin.main.version" value="10279"/>
    77   
    88    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java

    r32212 r32329  
    576576    private static void checkLayerDuplicates(WMSLayer wmsLayer) throws DuplicateLayerException {
    577577        if (Main.map != null) {
    578             for (Layer l : Main.map.mapView.getAllLayers()) {
     578            for (Layer l : Main.getLayerManager().getLayers()) {
    579579                if (l instanceof WMSLayer && l.getName().equals(wmsLayer.getName()) && (!l.equals(wmsLayer))) {
    580580                    Main.info("Try to grab into a new layer when "+wmsLayer.getName()+" is already opened.");
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java

    r32164 r32329  
    456456    public static void addWMSLayer(WMSLayer wmsLayer) {
    457457        if (Main.map != null && Main.map.mapView != null) {
    458             int wmsNewLayerPos = Main.map.mapView.getAllLayers().size();
    459             for(Layer l : Main.map.mapView.getLayersOfType(WMSLayer.class)) {
     458            int wmsNewLayerPos = Main.getLayerManager().getLayers().size();
     459            for(Layer l : Main.getLayerManager().getLayersOfType(WMSLayer.class)) {
    460460                int wmsPos = Main.map.mapView.getLayerPos(l);
    461461                if (wmsPos < wmsNewLayerPos) wmsNewLayerPos = wmsPos;
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrabPlanImage.java

    r29714 r32329  
    22package cadastre_fr;
    33
     4import static org.openstreetmap.josm.tools.I18n.marktr;
    45import static org.openstreetmap.josm.tools.I18n.tr;
    5 import static org.openstreetmap.josm.tools.I18n.marktr;
    66
    77import java.awt.event.ActionEvent;
     
    1212import org.openstreetmap.josm.Main;
    1313import org.openstreetmap.josm.actions.JosmAction;
    14 import org.openstreetmap.josm.gui.layer.Layer;
    1514
    1615public class MenuActionGrabPlanImage extends JosmAction implements Runnable {
     
    3635        if (wmsLayer == null || Main.map == null || Main.map.mapView == null) return;
    3736        if (!rasterImageGeoreferencer.isRunning()) return;
    38         for (Layer l : Main.map.mapView.getAllLayersAsList())
    39             if (l == wmsLayer)
    40                 return;
     37        if (Main.getLayerManager().containsLayer(wmsLayer))
     38                return;
    4139        JOptionPane.showMessageDialog(Main.parent, tr("Georeferencing interrupted"));
    4240        rasterImageGeoreferencer.actionInterrupted();
    4341    }
    4442
    45     public void actionPerformed(ActionEvent ae) {
     43    @Override
     44        public void actionPerformed(ActionEvent ae) {
    4645        if (Main.map != null) {
    4746            if (CadastrePlugin.isCadastreProjection()) {
     
    5857    }
    5958
    60     public void run() {
     59    @Override
     60        public void run() {
    6161        // wait until plan image is fully loaded and joined into one single image
    6262        boolean loadedFromCache = downloadWMSPlanImage.waitFinished();
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionLoadFromCache.java

    r32211 r32329  
    6969                    // check if the selected cache is not already displayed
    7070                    if (Main.map != null) {
    71                         for (Layer l : Main.map.mapView.getAllLayers()) {
     71                        for (Layer l : Main.getLayerManager().getLayers()) {
    7272                            if (l instanceof WMSLayer && l.getName().equals(location)) {
    7373                                JOptionPane.showMessageDialog(Main.parent, tr("The location {0} is already on screen. Cache not loaded.", filename), tr("Error"), JOptionPane.ERROR_MESSAGE);
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java

    r32060 r32329  
    106106            Main.pref.put("cadastrewms.codeDepartement", codeDepartement);
    107107            if (Main.map != null) {
    108                 for (Layer l : Main.map.mapView.getAllLayers()) {
     108                for (Layer l : Main.getLayerManager().getLayers()) {
    109109                    if (l instanceof WMSLayer && l.getName().equalsIgnoreCase(location)) {
    110110                        return null;
     
    118118            CadastrePlugin.addWMSLayer(wmsLayer);
    119119            Main.info("Add new layer with Location:" + inputTown.getText());
    120         } else if (existingLayers != null && existingLayers.size() > 0 && Main.map.mapView.getActiveLayer() instanceof WMSLayer) {
    121             wmsLayer = (WMSLayer)Main.map.mapView.getActiveLayer();
     120        } else if (existingLayers != null && existingLayers.size() > 0 && Main.getLayerManager().getActiveLayer() instanceof WMSLayer) {
     121            wmsLayer = (WMSLayer)Main.getLayerManager().getActiveLayer();
    122122        }
    123123
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSAdjustAction.java

    r29595 r32329  
    4141    @Override public void enterMode() {
    4242        if (Main.map != null) {
    43             if (Main.map.mapView.getActiveLayer() instanceof WMSLayer) {
    44                 modifiedLayer = (WMSLayer)Main.map.mapView.getActiveLayer();
     43            if (Main.getLayerManager().getActiveLayer() instanceof WMSLayer) {
     44                modifiedLayer = (WMSLayer)Main.getLayerManager().getActiveLayer();
    4545                super.enterMode();
    4646                Main.map.mapView.addMouseListener(this);
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSDownloadAction.java

    r30737 r32329  
    2727        ArrayList<WMSLayer> existingWMSlayers = new ArrayList<>();
    2828        if (Main.map != null) {
    29             Layer activeLayer = Main.map.mapView.getActiveLayer();
     29            Layer activeLayer = Main.getLayerManager().getActiveLayer();
    3030            if (activeLayer instanceof WMSLayer)
    3131                return (WMSLayer) activeLayer;
    32             for (Layer l : Main.map.mapView.getAllLayers()) {
     32            for (Layer l : Main.getLayerManager().getLayers()) {
    3333                if (l instanceof WMSLayer) {
    3434                    existingWMSlayers.add((WMSLayer)l);
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java

    r32211 r32329  
    160160        grabThread.setGrabber(grabber);
    161161        // if it is the first layer, use the communeBBox as grab bbox (and not divided)
    162         if (Main.map.mapView.getAllLayers().size() == 1 ) {
     162        if (Main.getLayerManager().getLayers().size() == 1 ) {
    163163            final Bounds bounds = this.getCommuneBBox().toBounds();
    164164            GuiHelper.runInEDTAndWait(new Runnable() {
  • applications/editors/josm/plugins/gpsblam/build.xml

    r31926 r32329  
    55    <property name="commit.message" value="Commit message"/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="7001"/>
     7    <property name="plugin.main.version" value="10279"/>
    88
    99    <!--
  • applications/editors/josm/plugins/gpsblam/src/org/openstreetmap/josm/plugins/gpsblam/GPSBlamInputData.java

    r30761 r32329  
    2727    // within given radius of line between given points
    2828    GPSBlamInputData(Point p1, Point p2, int radius) {
    29         Collection<Layer> layers = Main.map.mapView.getAllLayers();
     29        Collection<Layer> layers = Main.getLayerManager().getLayers();
    3030        for (Layer l : layers) {
    3131            if (l.isVisible() && l instanceof GpxLayer) {
  • applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/downloadtask/DownloadXmlBoundsTask.java

    r30735 r32329  
    7373            int count = 0;
    7474            if (!Main.isDisplayingMapView()) return 0;
    75             for (Layer layer : Main.map.mapView.getAllLayers()) {
     75            for (Layer layer : Main.getLayerManager().getLayers()) {
    7676                if (layer instanceof XmlBoundsLayer) {
    7777                    count++;
     
    8484        protected OsmDataLayer getFirstDataLayer() {
    8585            if (!Main.isDisplayingMapView()) return null;
    86             for (Layer layer : Main.map.mapView.getAllLayersAsList()) {
     86            for (Layer layer : Main.getLayerManager().getLayers()) {
    8787                if (layer instanceof XmlBoundsLayer)
    8888                    return (XmlBoundsLayer) layer;
  • applications/editors/josm/plugins/imagery_offset_db/build.xml

    r32046 r32329  
    55    <property name="commit.message" value="Imagery Offset Database"/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="9168"/>
     7    <property name="plugin.main.version" value="10279"/>
    88        <property name="plugin.canloadatruntime" value="true"/>
    99
  • applications/editors/josm/plugins/imagery_offset_db/src/iodb/ImageryOffsetTools.java

    r30218 r32329  
    3030        if( Main.map == null || Main.map.mapView == null )
    3131            return null;
    32         List<ImageryLayer> layers = Main.map.mapView.getLayersOfType(ImageryLayer.class);
     32        List<ImageryLayer> layers = Main.getLayerManager().getLayersOfType(ImageryLayer.class);
    3333        for( ImageryLayer layer : layers ) {
    3434            String url = layer.getInfo().getUrl();
  • applications/editors/josm/plugins/imageryadjust/build.xml

    r31923 r32329  
    22<project name="imageryadjust" default="dist" basedir=".">
    33    <property name="commit.message" value="ImageryAdjust: Adjust while holding shortcut key"/>
    4     <property name="plugin.main.version" value="7001"/>
     4    <property name="plugin.main.version" value="10279"/>
    55
    66    <property name="plugin.author" value="Upliner"/>
  • applications/editors/josm/plugins/imageryadjust/src/imageryadjust/ImageryAdjustMapMode.java

    r31690 r32329  
    5454   
    5555    private List<? extends Layer> getVisibleLayers() {
    56         List<? extends Layer> all = new ArrayList<Layer>(Main.map.mapView.getLayersOfType(ImageryLayer.class));
     56        List<? extends Layer> all = new ArrayList<Layer>(Main.getLayerManager().getLayersOfType(ImageryLayer.class));
    5757        Iterator<? extends Layer> it = all.iterator();
    5858        while (it.hasNext()) {
     
    7676            return;
    7777        }
    78         List<ImageryLayer> layers = Main.map.mapView.getLayersOfType(ImageryLayer.class);
     78        List<ImageryLayer> layers = Main.getLayerManager().getLayersOfType(ImageryLayer.class);
    7979        if (layers.size() == 1) {
    8080            adjustingLayer = layers.get(0);
     
    159159            if (Main.map.mapView == null)
    160160                return false;
    161             return Main.map.mapView.getActiveLayer() == layer;
     161            return Main.getLayerManager().getActiveLayer() == layer;
    162162        }
    163163
     
    230230        if (Main.map == null) return false;
    231231        if (Main.map.mapView == null) return false;
    232         boolean b = ! Main.map.mapView.getLayersOfType(ImageryLayer.class).isEmpty();
     232        boolean b = ! Main.getLayerManager().getLayersOfType(ImageryLayer.class).isEmpty();
    233233        return b;
    234234    }
  • applications/editors/josm/plugins/irsrectify/build.xml

    r32306 r32329  
    55    <property name="commit.message" value="irsrectify shortcut conflict"/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="7001"/>
     7    <property name="plugin.main.version" value="10279"/>
    88
    99    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/irsrectify/src/irsrectify/IRSRectifyPlugin.java

    r27852 r32329  
    7474            data.data.addPrimitive(way);
    7575            data.data.setSelected(way.getPrimitiveId());
    76             frame.mapView.setActiveLayer(data);
     76            Main.getLayerManager().setActiveLayer(data);
    7777        }
    7878
     
    8080            if( frame == null || frame.mapView == null )
    8181                return null;
    82             for( Layer l : frame.mapView.getAllLayers() )
     82            for( Layer l : Main.getLayerManager().getLayers() )
    8383                if( l instanceof ImageryLayer )
    8484                    return (ImageryLayer)l;
     
    9090                return null;
    9191
    92             OsmDataLayer l = frame.mapView.getEditLayer();
     92            OsmDataLayer l = Main.getLayerManager().getEditLayer();
    9393            if( isOffsetLayer(l) )
    9494                return l;
    9595
    9696            // try to find among all layers
    97             for( Layer layer : frame.mapView.getAllLayers() )
     97            for( Layer layer : Main.getLayerManager().getLayers() )
    9898                if( layer instanceof OsmDataLayer && isOffsetLayer((OsmDataLayer)layer) )
    9999                    return (OsmDataLayer) layer;
  • applications/editors/josm/plugins/junctionchecking/build.xml

    r31926 r32329  
    33    <property name="commit.message" value="Changed the constructor signature of the plugin main class"/>
    44    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    5     <property name="plugin.main.version" value="7575"/>
     5    <property name="plugin.main.version" value="10279"/>
    66   
    77    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/DigraphCreationTask.java

    r30725 r32329  
    6565        //Prüfen, ob der ausgewählte Layer ein OSMDataLayer ist
    6666        if (Main.map == null
    67                 || !Main.map.isVisible() || !(Main.map.mapView.getActiveLayer() instanceof OsmDataLayer)) {
     67                || !Main.map.isVisible() || !(Main.getLayerManager().getActiveLayer() instanceof OsmDataLayer)) {
    6868            JOptionPane.showMessageDialog(Main.parent, tr("this layer is no osm data layer"));
    6969            return;
     
    8484        OSMGraph graph = new OSMGraph();
    8585        //Der vom Benutzer in JOSM ausgewählte, zur Zeit aktive Layer wird der PLugin-OSM-Layer
    86         plugin.setOsmlayer((OsmDataLayer)Main.map.mapView.getActiveLayer());
     86        plugin.setOsmlayer((OsmDataLayer)Main.getLayerManager().getActiveLayer());
    8787        Iterator<Node> it = Main.main.getCurrentDataSet().getNodes().iterator();
    8888        while (it.hasNext()) {
     
    147147        Main.map.selectMapMode(plugin.getJcMapMode());
    148148        Main.main.addLayer(plugin.getChannelDigraphLayer());
    149         Main.map.mapView.setActiveLayer(plugin.getChannelDigraphLayer());
     149        Main.getLayerManager().setActiveLayer(plugin.getChannelDigraphLayer());
    150150    }
    151151}
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/JunctionCheckTask.java

    r30737 r32329  
    9191            plugin.getChannelDigraph().addJunctioncandidateChannel(jc.getSubJunction().get(i));
    9292        }
    93         Main.map.mapView.setActiveLayer(plugin.getChannelDigraphLayer());
     93        Main.getLayerManager().setActiveLayer(plugin.getChannelDigraphLayer());
    9494    }
    9595}
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/util/RelationProducer.java

    r30737 r32329  
    4242            }
    4343        }
    44         Main.map.mapView.setActiveLayer(plugin.getOsmlayer());
     44        Main.getLayerManager().setActiveLayer(plugin.getOsmlayer());
    4545        plugin.getOsmlayer().data.setSelected(ways);
    4646
  • applications/editors/josm/plugins/mapdust/build.xml

    r31923 r32329  
    33    <!-- properties -->
    44    <property name="commit.message" value="MapDust bug reporter plugin"/>
    5     <property name="plugin.main.version" value="7001"/>
     5    <property name="plugin.main.version" value="10279"/>
    66    <property name="apidoc.dir" value="doc"/>
    77
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustPlugin.java

    r30737 r32329  
    363363            if (event.getButton() == MouseEvent.BUTTON1) {
    364364                if (event.getClickCount() == 2 && !event.isConsumed()) {
    365                     if (Main.map.mapView.getActiveLayer() == getMapdustLayer()) {
     365                    if (Main.getLayerManager().getActiveLayer() == getMapdustLayer()) {
    366366                        /* show add bug dialog */
    367367                        MapdustBug bug = mapdustGUI.getSelectedBug();
     
    620620     */
    621621    private boolean containsMapdustLayer() {
    622         boolean contains = false;
    623         List<Layer> all = Main.map.mapView.getAllLayersAsList();
    624         if (mapdustLayer != null && all.contains(mapdustLayer)) {
    625             contains = true;
    626         }
    627         return contains;
     622        return mapdustLayer != null && Main.getLayerManager().containsLayer(mapdustLayer);
    628623    }
    629624
  • applications/editors/josm/plugins/mapillary/gradle.properties

    r32285 r32329  
    55plugin.icon=images/icon24.png
    66plugin.link=https://wiki.openstreetmap.org/wiki/JOSM/Plugins/Mapillary
    7 plugin.main.version=8433
     7plugin.main.version=10279
    88plugin.requires=apache-commons;apache-http
    99plugin.version=1.1.5
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java

    r32078 r32329  
    111111      MapView.addEditLayerChangeListener(this, false);
    112112      MapView.addLayerChangeListener(this);
    113       if (Main.map.mapView.getEditLayer() != null)
    114         Main.map.mapView.getEditLayer().data.addDataSetListener(this);
     113      if (Main.getLayerManager().getEditLayer() != null)
     114        Main.getLayerManager().getEditLayer().data.addDataSetListener(this);
    115115      if (MapillaryDownloader.getMode() == MapillaryDownloader.MODES.Automatic)
    116116        MapillaryDownloader.automaticDownload();
     
    223223    Main.map.mapView.removeMouseMotionListener(this.mode);
    224224    MapView.removeEditLayerChangeListener(this);
    225     if (Main.map.mapView.getEditLayer() != null)
    226       Main.map.mapView.getEditLayer().data.removeDataSetListener(this);
     225    if (Main.getLayerManager().getEditLayer() != null)
     226      Main.getLayerManager().getEditLayer().data.removeDataSetListener(this);
    227227    clearInstance();
    228228    super.destroy();
     
    286286  public synchronized void paint(final Graphics2D g, final MapView mv, final Bounds box) {
    287287    g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    288     if (Main.map.mapView.getActiveLayer() == this) {
     288    if (Main.getLayerManager().getActiveLayer() == this) {
    289289      // paint remainder
    290290      g.setPaint(this.hatched);
     
    323323      selectedImageKey = selectedImage.getSequence().getKey();
    324324    }
    325     g.setStroke(new BasicStroke(this == Main.map.mapView.getActiveLayer() ? 3 : 2));
     325    g.setStroke(new BasicStroke(this == Main.getLayerManager().getActiveLayer() ? 3 : 2));
    326326    for (MapillarySequence seq : getData().getSequences()) {
    327327      if (selectedImageKey != null && selectedImageKey.equals(seq.getKey())) {
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryDownloadAction.java

    r31973 r32329  
    4848    }
    4949    // Successive calls to this action toggle the active layer between the OSM data layer and the mapillary layer
    50     Main.map.mapView.setActiveLayer(
    51         Main.map.mapView.getActiveLayer() == MapillaryLayer.getInstance()
    52           ? Main.map.mapView.getEditLayer()
     50    Main.getLayerManager().setActiveLayer(
     51        Main.getLayerManager().getActiveLayer() == MapillaryLayer.getInstance()
     52          ? Main.getLayerManager().getEditLayer()
    5353          : MapillaryLayer.getInstance()
    5454    );
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryDownloader.java

    r32064 r32329  
    152152  public static void automaticDownload() {
    153153    MapillaryLayer layer = MapillaryLayer.getInstance();
    154     if (Main.map.mapView.getEditLayer() == null)
     154    if (Main.getLayerManager().getEditLayer() == null)
    155155      return;
    156156    if (isAreaTooBig()) {
     
    160160    if (getMode() != MODES.Automatic)
    161161      throw new IllegalStateException("Must be in automatic mode.");
    162     for (Bounds bounds : Main.map.mapView.getEditLayer().data
     162    for (Bounds bounds : Main.getLayerManager().getEditLayer().data
    163163        .getDataSourceBounds()) {
    164164      if (!layer.getData().getBounds().contains(bounds)) {
     
    177177  private static boolean isAreaTooBig() {
    178178    double area = 0;
    179     for (Bounds bounds : Main.map.mapView.getEditLayer().data.getDataSourceBounds()) {
     179    for (Bounds bounds : Main.getLayerManager().getEditLayer().data.getDataSourceBounds()) {
    180180      area += bounds.getArea();
    181181    }
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/JoinMode.java

    r31974 r32329  
    7171  public void mouseMoved(MouseEvent e) {
    7272    this.lastPos = e;
    73     if (!(Main.map.mapView.getActiveLayer() instanceof MapillaryLayer))
     73    if (!(Main.getLayerManager().getActiveLayer() instanceof MapillaryLayer))
    7474      return;
    7575    MapillaryAbstractImage closestTemp = getClosest(e.getPoint());
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/SelectMode.java

    r32199 r32329  
    5252      return;
    5353    MapillaryAbstractImage closest = getClosest(e.getPoint());
    54     if (!(Main.map.mapView.getActiveLayer() instanceof MapillaryLayer)
     54    if (!(Main.getLayerManager().getActiveLayer() instanceof MapillaryLayer)
    5555            && closest != null && Main.map.mapMode == Main.map.mapModeSelect) {
    5656      this.lastClicked = this.closest;
    5757      this.data.setSelectedImage(closest);
    5858      return;
    59     } else if (Main.map.mapView.getActiveLayer() != MapillaryLayer
     59    } else if (Main.getLayerManager().getActiveLayer() != MapillaryLayer
    6060            .getInstance())
    6161      return;
     
    9898  @Override
    9999  public void mouseDragged(MouseEvent e) {
    100     if (Main.map.mapView.getActiveLayer() != MapillaryLayer.getInstance()) {
     100    if (Main.getLayerManager().getActiveLayer() != MapillaryLayer.getInstance()) {
    101101      return;
    102102    }
     
    156156  @Override
    157157  public void mouseMoved(MouseEvent e) {
    158     if (Main.map.mapView.getActiveLayer() instanceof OsmDataLayer
     158    if (Main.getLayerManager().getActiveLayer() instanceof OsmDataLayer
    159159            && Main.map.mapMode != Main.map.mapModeSelect) {
    160160      return;
     
    167167
    168168    if (closestTemp != null
    169             && Main.map.mapView.getActiveLayer() instanceof OsmDataLayer
     169            && Main.getLayerManager().getActiveLayer() instanceof OsmDataLayer
    170170            && !this.imageHighlighted) {
    171171      Main.map.mapMode.putValue("active", Boolean.FALSE);
     
    173173
    174174    } else if (closestTemp == null
    175             && Main.map.mapView.getActiveLayer() instanceof OsmDataLayer
     175            && Main.getLayerManager().getActiveLayer() instanceof OsmDataLayer
    176176            && this.imageHighlighted && this.nothingHighlighted) {
    177177      this.nothingHighlighted = false;
     
    179179
    180180    } else if (this.imageHighlighted && !this.nothingHighlighted
    181             && Main.map.mapView.getEditLayer().data != null
    182             && Main.map.mapView.getActiveLayer() instanceof OsmDataLayer) {
    183 
    184       for (OsmPrimitive primivitive : Main.map.mapView.getEditLayer().data
     181            && Main.getLayerManager().getEditLayer().data != null
     182            && Main.getLayerManager().getActiveLayer() instanceof OsmDataLayer) {
     183
     184      for (OsmPrimitive primivitive : Main.getLayerManager().getEditLayer().data
    185185              .allPrimitives()) {
    186186        primivitive.setHighlighted(false);
  • applications/editors/josm/plugins/photoadjust/build.xml

    r32015 r32329  
    55    <property name="commit.message" value="Commit message"/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="9416"/>
     7    <property name="plugin.main.version" value="10279"/>
    88
    99    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/PhotoAdjustMapMode.java

    r31962 r32329  
    133133        // GeoImageLayer.  GeoImageLayer's are handled by the plug-in
    134134        // directly.
    135         if (! (Main.map.mapView.getActiveLayer() instanceof GeoImageLayer)) {
     135        if (! (Main.getLayerManager().getActiveLayer() instanceof GeoImageLayer)) {
    136136            activateMode();
    137137        }
     
    208208    private boolean hasLayersToAdjust() {
    209209        if (Main.map == null || Main.map.mapView == null) return false;
    210         return ! Main.map.mapView.getLayersOfType(GeoImageLayer.class).isEmpty();
     210        return ! Main.getLayerManager().getLayersOfType(GeoImageLayer.class).isEmpty();
    211211    }
    212212
     
    217217     */
    218218    private List<GeoImageLayer> getVisibleGeoImageLayers() {
    219         List<GeoImageLayer> all = new ArrayList<>(Main.map.mapView.getLayersOfType(GeoImageLayer.class));
     219        List<GeoImageLayer> all = new ArrayList<>(Main.getLayerManager().getLayersOfType(GeoImageLayer.class));
    220220        Iterator<GeoImageLayer> it = all.iterator();
    221221        while (it.hasNext()) {
  • applications/editors/josm/plugins/piclayer/build.xml

    r31926 r32329  
    33    <property name="commit.message" value="[josm/PicLayer] - #12045 add ability to localize dialog titles"/>
    44    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    5     <property name="plugin.main.version" value="7817"/>
     5    <property name="plugin.main.version" value="10279"/>
    66       
    77    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerPlugin.java

    r31729 r32329  
    158158                new SavePictureCalibrationAction((PicLayerAbstract) arg0).actionPerformed(null);
    159159        }
    160         // Why should I do all these checks now?
    161         boolean enable = Main.map != null && Main.map.mapView != null && Main.map.mapView.getAllLayers() != null && Main.map.mapView.getAllLayers().size() != 0;
     160        boolean enable = !Main.getLayerManager().getLayers().isEmpty();
    162161        newLayerFromFileAction.setEnabled(enable);
    163162        newLayerFromClipboardAction.setEnabled(enable);
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/GenericPicTransformAction.java

    r30356 r32329  
    5757    public void mousePressed(MouseEvent e) {
    5858        // Start action
    59         if ( Main.map.mapView.getActiveLayer() instanceof PicLayerAbstract ) {
    60             currentLayer = (PicLayerAbstract)Main.map.mapView.getActiveLayer();
     59        if ( Main.getLayerManager().getActiveLayer() instanceof PicLayerAbstract ) {
     60            currentLayer = (PicLayerAbstract)Main.getLayerManager().getActiveLayer();
    6161
    6262            if ( currentLayer != null && e.getButton() == MouseEvent.BUTTON1 ) {
     
    9999
    100100    protected void updateDrawPoints(boolean value) {
    101         Layer active = Main.map.mapView.getActiveLayer();
     101        Layer active = Main.getLayerManager().getActiveLayer();
    102102        if (active instanceof PicLayerAbstract) {
    103103            ((PicLayerAbstract)active).setDrawPoints(value);
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/newlayer/NewLayerFromFileAction.java

    r31729 r32329  
    119119            // or at the bottom of the stack if there is no such layer yet
    120120            // The next layers we load will be placed one after the other after this first layer
    121             int newLayerPos = Main.map.mapView.getAllLayers().size();
    122             for(Layer l : Main.map.mapView.getLayersOfType(PicLayerAbstract.class)) {
     121            int newLayerPos = Main.getLayerManager().getLayers().size();
     122            for(Layer l : Main.getLayerManager().getLayersOfType(PicLayerAbstract.class)) {
    123123                int pos = Main.map.mapView.getLayerPos(l);
    124124                if (pos < newLayerPos) newLayerPos = pos;
  • applications/editors/josm/plugins/rasterfilters/.project

    r32286 r32329  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<projectDescription>
    3         <name>rasterfilters</name>
     3        <name>JOSM-rasterfilters</name>
    44        <comment>JavaCC Nature</comment>
    55        <projects>
  • applications/editors/josm/plugins/rasterfilters/build.xml

    r31504 r32329  
    1010       
    1111        <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    12         <property name="plugin.main.version" value="8625" />
     12        <property name="plugin.main.version" value="10279" />
    1313        <property name="plugin.version" value="1.0.1"/>
    1414
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/RasterFiltersPlugin.java

    r31635 r32329  
    119119                }
    120120
    121                 if (Main.map.mapView.getAllLayersAsList().size() == 0) {
     121                if (Main.getLayerManager().getLayers().isEmpty()) {
    122122
    123123                        Container container = filterButton.getParent();
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/actions/ShowLayerFiltersDialog.java

    r32146 r32329  
    5151        public void actionPerformed(ActionEvent e) {
    5252
    53                 Layer layer = Main.map.mapView.getActiveLayer();
     53                Layer layer = Main.getLayerManager().getActiveLayer();
    5454
    5555                if (layer instanceof ImageryLayer) {
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/model/FiltersManager.java

    r31947 r32329  
    131131
    132132                filter.changeFilterState(filterState.encodeJson());
    133                 Main.map.mapView.getActiveLayer().setFilterStateChanged();
     133                Main.getLayerManager().getActiveLayer().setFilterStateChanged();
    134134
    135135                fp.createBottomPanel(this);
     
    155155                        filtersMap.get(filterId).changeFilterState(filterState.encodeJson());
    156156
    157                 if (Main.map.mapView.getActiveLayer() != null) {
    158                         Main.map.mapView.getActiveLayer().setFilterStateChanged();
     157                if (Main.getLayerManager().getActiveLayer() != null) {
     158                        Main.getLayerManager().getActiveLayer().setFilterStateChanged();
    159159                }
    160160
     
    239239                }
    240240
    241                 Main.map.mapView.getActiveLayer().setFilterStateChanged();
     241                Main.getLayerManager().getActiveLayer().setFilterStateChanged();
    242242
    243243        }
     
    255255                        disabledFilters.add(filtersMap.get(filterId));
    256256
    257                         Main.map.mapView.getActiveLayer().setFilterStateChanged();
     257                        Main.getLayerManager().getActiveLayer().setFilterStateChanged();
    258258
    259259                } else {
     
    262262                        disabledFilters.remove(filtersMap.get(filterId));
    263263
    264                         Main.map.mapView.getActiveLayer().setFilterStateChanged();
     264                        Main.getLayerManager().getActiveLayer().setFilterStateChanged();
    265265
    266266                }
  • applications/editors/josm/plugins/routes/build.xml

    r32310 r32329  
    22<project name="routes" default="dist" basedir=".">
    33    <property name="commit.message" value="Changed the constructor signature of the plugin main class"/>
    4     <property name="plugin.main.version" value="8811"/>
     4    <property name="plugin.main.version" value="10279"/>
    55    <property name="josm" location="../../core/dist/josm-custom.jar"/>
    66    <property name="plugin.dist.dir" value="../../dist"/>
  • applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RoutesPlugin.java

    r30738 r32329  
    7979    private void checkLayers() {
    8080        if (Main.map != null && Main.map.mapView != null) {
    81             for (Layer layer:Main.map.mapView.getAllLayers()) {
     81            for (Layer layer:Main.getLayerManager().getLayers()) {
    8282                if (layer instanceof OsmDataLayer) {
    8383                    if (!isShown) {
  • applications/editors/josm/plugins/routing/build.xml

    r31926 r32329  
    55    <property name="commit.message" value="added one-way support in roundabouts"/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="7001"/>
     7    <property name="plugin.main.version" value="10279"/>
    88
    99    <!--
  • applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingGraph.java

    r30737 r32329  
    350350        Graph<Node,OsmEdge> g;
    351351        double totalWeight = 0;
    352         RoutingLayer layer = (RoutingLayer)Main.map.mapView.getActiveLayer();
     352        RoutingLayer layer = (RoutingLayer)Main.getLayerManager().getActiveLayer();
    353353        RoutingModel routingModel = layer.getRoutingModel();
    354354
  • applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/AddRouteNodeAction.java

    r29586 r32329  
    8383            // Search for nearest highway node
    8484            Node node = null;
    85             if (Main.map.mapView.getActiveLayer() instanceof RoutingLayer) {
    86                 RoutingLayer layer = (RoutingLayer)Main.map.mapView.getActiveLayer();
     85            if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
     86                RoutingLayer layer = (RoutingLayer)Main.getLayerManager().getActiveLayer();
    8787                node = layer.getNearestHighwayNode(e.getPoint());
    8888                if(node == null) {
  • applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/MoveRouteNodeAction.java

    r29595 r32329  
    9696        // If left button is pressed
    9797        if (e.getButton() == MouseEvent.BUTTON1) {
    98             if (Main.map.mapView.getActiveLayer() instanceof RoutingLayer) {
     98            if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
    9999                requestFocusInMapView();
    100                 RoutingLayer layer = (RoutingLayer)Main.map.mapView.getActiveLayer();
     100                RoutingLayer layer = (RoutingLayer)Main.getLayerManager().getActiveLayer();
    101101                RoutingModel routingModel = layer.getRoutingModel();
    102102                // Search for the nearest node in the list
     
    129129
    130130    private void searchAndReplaceNode(Point point) {
    131         if (Main.map.mapView.getActiveLayer() instanceof RoutingLayer) {
    132             RoutingLayer layer = (RoutingLayer)Main.map.mapView.getActiveLayer();
     131        if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
     132            RoutingLayer layer = (RoutingLayer)Main.getLayerManager().getActiveLayer();
    133133            RoutingModel routingModel = layer.getRoutingModel();
    134134            RoutingDialog routingDialog = RoutingPlugin.getInstance().getRoutingDialog();
  • applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/RemoveRouteNodeAction.java

    r29586 r32329  
    8484        // If left button is clicked
    8585        if (e.getButton() == MouseEvent.BUTTON1) {
    86             if (Main.map.mapView.getActiveLayer() instanceof RoutingLayer) {
    87                 RoutingLayer layer = (RoutingLayer)Main.map.mapView.getActiveLayer();
     86            if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
     87                RoutingLayer layer = (RoutingLayer)Main.getLayerManager().getActiveLayer();
    8888                RoutingModel routingModel = layer.getRoutingModel();
    8989                // Search for the nearest node in the list
  • applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingDialog.java

    r30532 r32329  
    131131    public void refresh() {
    132132        clearNodes();
    133         if (Main.map.mapView.getActiveLayer() instanceof RoutingLayer) {
    134             RoutingLayer routingLayer = (RoutingLayer)Main.map.mapView.getActiveLayer();
     133        if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
     134            RoutingLayer routingLayer = (RoutingLayer)Main.getLayerManager().getActiveLayer();
    135135            RoutingModel routingModel = routingLayer.getRoutingModel();
    136136            for (Node n : routingModel.getSelectedNodes()) {
  • applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingMenu.java

    r31646 r32329  
    9393        rshorter.addItemListener(new ItemListener() {
    9494            public void itemStateChanged(ItemEvent e) {
    95                 if (Main.map.mapView.getActiveLayer() instanceof RoutingLayer) {
    96                     RoutingLayer layer = (RoutingLayer)Main.map.mapView.getActiveLayer();
     95                if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
     96                    RoutingLayer layer = (RoutingLayer)Main.getLayerManager().getActiveLayer();
    9797                    RoutingModel routingModel = layer.getRoutingModel();
    9898                    if (e.getStateChange()==ItemEvent.SELECTED) {
     
    122122        cbmi.addItemListener(new ItemListener() {
    123123            public void itemStateChanged(ItemEvent e) {
    124                 if (Main.map.mapView.getActiveLayer() instanceof RoutingLayer) {
    125                     RoutingLayer layer = (RoutingLayer)Main.map.mapView.getActiveLayer();
     124                if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
     125                    RoutingLayer layer = (RoutingLayer)Main.getLayerManager().getActiveLayer();
    126126                    RoutingModel routingModel = layer.getRoutingModel();
    127127                    if (e.getStateChange()==ItemEvent.SELECTED)
     
    142142        reverseMI.addActionListener(new ActionListener() {
    143143            public void actionPerformed(ActionEvent e) {
    144                 if (Main.map.mapView.getActiveLayer() instanceof RoutingLayer) {
    145                     RoutingLayer layer = (RoutingLayer)Main.map.mapView.getActiveLayer();
     144                if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
     145                    RoutingLayer layer = (RoutingLayer)Main.getLayerManager().getActiveLayer();
    146146                    RoutingModel routingModel = layer.getRoutingModel();
    147147                    routingModel.reverseNodes();
     
    155155        clearMI.addActionListener(new ActionListener() {
    156156            public void actionPerformed(ActionEvent e) {
    157                 if (Main.map.mapView.getActiveLayer() instanceof RoutingLayer) {
    158                     RoutingLayer layer = (RoutingLayer)Main.map.mapView.getActiveLayer();
     157                if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
     158                    RoutingLayer layer = (RoutingLayer)Main.getLayerManager().getActiveLayer();
    159159                    RoutingModel routingModel = layer.getRoutingModel();
    160160                    // Reset routing nodes and paths
     
    171171            public void actionPerformed(ActionEvent e) {
    172172
    173                 if (Main.map.mapView.getActiveLayer() instanceof RoutingLayer) {
    174                     RoutingLayer layer = (RoutingLayer)Main.map.mapView.getActiveLayer();
     173                if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
     174                    RoutingLayer layer = (RoutingLayer)Main.getLayerManager().getActiveLayer();
    175175                    RoutingModel routingModel = layer.getRoutingModel();
    176176                    routingModel.routingGraph.resetGraph();
  • applications/editors/josm/plugins/sds/build.xml

    r31768 r32329  
    55    <property name="commit.message" value=""/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="8415"/>
     7    <property name="plugin.main.version" value="10279"/>
    88
    99    <!--
  • applications/editors/josm/plugins/sds/src/org/openstreetmap/hot/sds/SdsMenu.java

    r31646 r32329  
    5555
    5656    void setEnabledState() {
    57         boolean en = (Main.map != null) && (Main.map.mapView != null) && (Main.map.mapView.getActiveLayer() instanceof OsmDataLayer);
     57        boolean en = Main.getLayerManager().getActiveLayer() instanceof OsmDataLayer;
    5858        loadItem.setEnabled(en);
    5959        saveItem.setEnabled(en);
  • applications/editors/josm/plugins/sds/src/org/openstreetmap/hot/sds/SdsSaveAction.java

    r30738 r32329  
    3737    public boolean doSave() {
    3838        Layer layer = null;
    39         if (Main.isDisplayingMapView() && (Main.map.mapView.getActiveLayer() instanceof OsmDataLayer))
    40             layer = Main.map.mapView.getActiveLayer();
     39        if (Main.getLayerManager().getActiveLayer() instanceof OsmDataLayer)
     40            layer = Main.getLayerManager().getActiveLayer();
    4141
    4242        if (layer == null)
  • applications/editors/josm/plugins/surveyor/build.xml

    r31926 r32329  
    77    <property name="commit.message" value="Changed the constructor signature of the plugin main class"/>
    88    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    9     <property name="plugin.main.version" value="8863"/>
     9    <property name="plugin.main.version" value="10279"/>
    1010    <property name="livegpsplugin.jar" value="${plugin.dist.dir}/livegps.jar"/>
    1111
  • applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/SetWaypointAction.java

    r30646 r32329  
    125125    public GpxLayer getGpxLayer() {
    126126        if(liveGpsLayer == null) {
    127             Collection<Layer> layers = Main.map.mapView.getAllLayers();
     127            Collection<Layer> layers = Main.getLayerManager().getLayers();
    128128            for (Layer layer : layers) {
    129129                if(layer instanceof LiveGpsLayer) {
  • applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/util/LayerUtil.java

    r17384 r32329  
    2424        Layer result = null;
    2525        if(Main.map != null && Main.map.mapView != null) {
    26             for(Layer layer : Main.map.mapView.getAllLayers()) {
     26            for(Layer layer : Main.getLayerManager().getLayers()) {
    2727                if(layerName.equals(layer.getName()) && layerType.isAssignableFrom(layer.getClass())) {
    2828                    result = layer;
  • applications/editors/josm/plugins/turnrestrictions/build.xml

    r31926 r32329  
    44    <property name="commit.message" value="Adapt to JOSM core change (DefaultNameFormatter)"/>
    55    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    6     <property name="plugin.main.version" value="8863"/>
     6    <property name="plugin.main.version" value="10279"/>
    77
    88    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditor.java

    r30737 r32329  
    819819        public void actionPerformed(ActionEvent e) {
    820820            if (Main.main.getActiveLayer() != getLayer()){
    821                 Main.map.mapView.setActiveLayer(getLayer());
     821                Main.getLayerManager().setActiveLayer(getLayer());
    822822            }
    823823            Relation tr = getTurnRestriction();
  • applications/editors/josm/plugins/videomapping/.classpath

    r31877 r32329  
    22<classpath>
    33        <classpathentry kind="src" path="src"/>
    4         <classpathentry kind="src" path="test"/>
    54        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
    65        <classpathentry combineaccessrules="false" kind="src" path="/JOSM"/>
  • applications/editors/josm/plugins/waypoint_search/build.xml

    r30416 r32329  
    55    <property name="commit.message" value="bugfix of search when layer is added"/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="7001"/>
     7    <property name="plugin.main.version" value="10279"/>
    88
    99    <property name="plugin.author" value="Åsmund Realfsen - realfsen at gmx.net"/>
  • applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/Engine.java

    r30777 r32329  
    1818        if (gpxLayersExist()) {
    1919            //Loop over marker (waypoint) layers.. it could be more than one
    20             for (Iterator<MarkerLayer> it = Main.map.mapView.getLayersOfType(MarkerLayer.class).iterator(); it.hasNext();) {
     20            for (Iterator<MarkerLayer> it = Main.getLayerManager().getLayersOfType(MarkerLayer.class).iterator(); it.hasNext();) {
    2121                //loop over each marker (waypoint)
    2222                for (Iterator<Marker> markerIterator = it.next().data.iterator(); markerIterator.hasNext();) {
     
    3232   
    3333    static boolean gpxLayersExist() {
    34         return Main.map != null && Main.map.mapView.hasLayers() && !Main.map.mapView.getLayersOfType(MarkerLayer.class).isEmpty();
     34        return !Main.getLayerManager().getLayersOfType(MarkerLayer.class).isEmpty();
    3535    }
    3636}
Note: See TracChangeset for help on using the changeset viewer.