Changeset 33292 in osm for applications/editors


Ignore:
Timestamp:
2017-05-06T21:52:06+02:00 (8 years ago)
Author:
stoecker
Message:

don't use main when not necessary

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RoutesPlugin.java

    r33290 r33292  
    8080        if (layer instanceof OsmDataLayer) {
    8181            for (RouteLayer routeLayer : routeLayers) {
    82                 if (!Main.getLayerManager().containsLayer(routeLayer)) {
     82                if (!e.getSource().containsLayer(routeLayer)) {
    8383                    SwingUtilities.invokeLater(() -> {
    84                         Main.getLayerManager().addLayer(routeLayer);
     84                        e.getSource().addLayer(routeLayer);
    8585                    });
    8686                }
     
    9999            SwingUtilities.invokeLater(() -> {
    100100                for (RouteLayer routeLayer : routeLayers) {
    101                     if (Main.getLayerManager().containsLayer(routeLayer)) {
    102                         Main.getLayerManager().removeLayer(routeLayer);
     101                    if (e.getSource().containsLayer(routeLayer)) {
     102                        e.getSource().removeLayer(routeLayer);
    103103                    }
    104104                }
Note: See TracChangeset for help on using the changeset viewer.