Changeset 27494 in osm for applications


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

'ImageryAdjust: show visible layers only'

Location:
applications/editors/josm/plugins/imageryadjust
Files:
2 edited

Legend:

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

    r27038 r27494  
    3030<project name="imageryadjust" default="dist" basedir=".">
    3131    <!-- enter the SVN commit message -->
    32     <property name="commit.message" value="Commit message"/>
     32    <property name="commit.message" value="ImageryAdjust: show visible layers only"/>
    3333    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    34     <property name="plugin.main.version" value="4549"/>
     34    <property name="plugin.main.version" value="4667"/>
    3535    <!--
    3636      ************************************************
  • 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.