source: osm/applications/editors/josm/plugins/NanoLog/src/nanolog/GPXChooser.java@ 30836

Last change on this file since 30836 was 30491, checked in by zverik, 11 years ago

wow, it works

File size: 716 bytes
Line 
1package nanolog;
2
3import javax.swing.*;
4import org.openstreetmap.josm.Main;
5import org.openstreetmap.josm.gui.layer.GpxLayer;
6import org.openstreetmap.josm.gui.layer.Layer;
7
8/**
9 * A dialog to choose GPS trace.
10 *
11 * @author zverik
12 */
13public class GPXChooser extends JDialog {
14 public static GpxLayer chooseLayer() {
15 // temporary plug: return first found local layer
16 return topLayer();
17 }
18
19 public static GpxLayer topLayer() {
20 // return first found local layer
21 for( Layer layer : Main.map.mapView.getAllLayers() ) {
22 if( layer instanceof GpxLayer && ((GpxLayer)layer).isLocalFile() )
23 return (GpxLayer)layer;
24 }
25 return null;
26 }
27}
Note: See TracBrowser for help on using the repository browser.