Ignore:
Timestamp:
2006-11-07T23:33:22+01:00 (18 years ago)
Author:
nick
Message:

Added ability to move landsat layer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • utils/josm/plugins/landsat/src/landsat/LandsatLayer.java

    r1443 r1553  
    77import java.awt.Toolkit;
    88import java.io.IOException;
     9import java.util.ArrayList;
    910
    1011import javax.swing.Icon;
     
    2021import org.openstreetmap.josm.gui.dialogs.LayerListPopup;
    2122import org.openstreetmap.josm.gui.layer.Layer;
     23import org.openstreetmap.josm.data.coor.EastNorth;
    2224
    2325/**
     
    2931        private static Icon icon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(LandsatPlugin.class.getResource("/images/wms.png")));
    3032
    31         private final LandsatImage landsatImage;
     33        private final ArrayList<LandsatImage> landsatImages;
    3234
    3335        private final String url;
     
    4749
    4850                this.url = url;
    49                 landsatImage = new LandsatImage(url);
     51                //landsatImage = new LandsatImage(url);
     52                landsatImages = new ArrayList<LandsatImage>();
    5053        }
    5154
     
    5356        {
    5457                MapView mv = Main.map.mapView;
     58                LandsatImage landsatImage = new LandsatImage(url);
    5559                landsatImage.grab(mv);
     60                landsatImages.add(landsatImage);
    5661        }
    5762
     
    6065        {
    6166                MapView mv = Main.map.mapView;
     67                LandsatImage landsatImage = new LandsatImage(url);
    6268                landsatImage.grab(mv,minlat,minlon,maxlat,maxlon);
     69                landsatImages.add(landsatImage);
    6370        }
    6471
     
    7986
    8087        @Override public void paint(Graphics g, final MapView mv) {
    81                 landsatImage.paint(g,mv);
     88                for(LandsatImage landsatImage : landsatImages) {
     89                        landsatImage.paint(g,mv);
     90                }
    8291        }
    8392
     
    97106                                new JMenuItem(new LayerListPopup.InfoAction(this))};
    98107        }
     108
     109        public LandsatImage findImage(EastNorth eastNorth)
     110        {
     111                for(LandsatImage landsatImage : landsatImages) {
     112                        if (landsatImage.contains(eastNorth))  {
     113                                return landsatImage;
     114                        }
     115                }
     116                return null;
     117        }
    99118}
Note: See TracChangeset for help on using the changeset viewer.