Line | |
---|
1 | package nanolog;
|
---|
2 |
|
---|
3 | import javax.swing.*;
|
---|
4 | import org.openstreetmap.josm.Main;
|
---|
5 | import org.openstreetmap.josm.gui.layer.GpxLayer;
|
---|
6 | import org.openstreetmap.josm.gui.layer.Layer;
|
---|
7 |
|
---|
8 | /**
|
---|
9 | * A dialog to choose GPS trace.
|
---|
10 | *
|
---|
11 | * @author zverik
|
---|
12 | */
|
---|
13 | public 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.