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