Ignore:
Timestamp:
2012-01-19T19:43:24+01:00 (13 years ago)
Author:
akks
Message:

'ImageryAdjust: show visible layers only'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/imageryadjust/src/imageryadjust/ImageryAdjustMapMode.java

    r24812 r27494  
    99import java.awt.event.MouseListener;
    1010import java.awt.event.MouseMotionListener;
     11import java.util.ArrayList;
     12import java.util.Iterator;
    1113import java.util.List;
    1214
     
    4042                ImageProvider.getCursor("normal", "move"));
    4143    }
    42 
     44   
     45    private List<? extends Layer> getVisibleLayers() {
     46        List<? extends Layer> all = new ArrayList<Layer>(Main.map.mapView.getLayersOfType(ImageryLayer.class));
     47        Iterator<? extends Layer> it = all.iterator();
     48        while (it.hasNext()) {
     49            if (!it.next().isVisible()) it.remove();
     50        }
     51        return all;
     52    }
     53   
    4354    @Override public void enterMode() {
    4455        super.enterMode();
     
    5162            adjustingLayer = layers.get(0);
    5263        } else {
    53             adjustingLayer = (ImageryLayer)askAdjustLayer(Main.map.mapView.getLayersOfType(ImageryLayer.class));
     64            adjustingLayer = (ImageryLayer)askAdjustLayer(getVisibleLayers());
    5465        }
    5566        if (adjustingLayer == null)
Note: See TracChangeset for help on using the changeset viewer.