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

Last change on this file since 32638 was 32638, checked in by donvip, 8 years ago

checkstyle

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