Package slash.navigation.gpx

Examples of slash.navigation.gpx.Gpx11Format


    @SuppressWarnings("UnusedDeclaration")
    public GpxRoute asGpx11Format() {
        if (getFormat() instanceof Gpx11Format)
            return (GpxRoute) this;
        return asGpxFormat(new Gpx11Format());
    }
View Full Code Here


            // result from GPSBabel-based format which allows only one route but is represented by GPX 1.0
            if (result instanceof BabelFormat)
                continue;

            // default for multiple routes is GPX 1.1
            result = new Gpx11Format();
        }
        return result;
    }
View Full Code Here

                parser.addNavigationFileParserListener(listener);

                try {
                    invokeAndWait(new Runnable() {
                        public void run() {
                            Gpx11Format gpxFormat = new Gpx11Format();
                            formatAndRoutesModel.setRoutes(new FormatAndRoutes(gpxFormat, new GpxRoute(gpxFormat)));
                            urlModel.clear();
                        }
                    });

                    final ParserResult result = parser.read(url, formats);
                    if (result.isSuccessful()) {
                        log.info("Opened: " + path);
                        final NavigationFormat format = result.getFormat();
                        countRead(format);
                        if (!checkReadFormat(format))
                            return;
                        invokeLater(new Runnable() {
                            public void run() {
                                formatAndRoutesModel.setRoutes(new FormatAndRoutes(format, result.getAllRoutes()));
                                comboBoxChoosePositionList.setModel(formatAndRoutesModel);
                                urlModel.setString(path);
                                recentUrlsModel.addUrl(url);

                                if (urls.size() > 1) {
                                    List<URL> append = new ArrayList<>(urls);
                                    append.remove(0);
                                    // this way the route is always marked as modified :-(
                                    appendPositionList(-1, append);
                                }
                            }
                        });

                    } else {
                        invokeLater(new Runnable() {
                            public void run() {
                                Gpx11Format gpxFormat = new Gpx11Format();
                                formatAndRoutesModel.setRoutes(new FormatAndRoutes(gpxFormat, new GpxRoute(gpxFormat)));
                            }
                        });
                        r.handleUnsupportedFormat(path);
                    }
View Full Code Here

            return;

        RouteConverter r = RouteConverter.getInstance();
        startWaitCursor(r.getFrame().getRootPane());
        try {
            Gpx11Format gpxFormat = new Gpx11Format();
            GpxRoute gpxRoute = new GpxRoute(gpxFormat);
            gpxRoute.setName(MessageFormat.format(RouteConverter.getBundle().getString("new-positionlist-name"), 1));
            formatAndRoutesModel.setRoutes(new FormatAndRoutes(gpxFormat, gpxRoute));
            urlModel.clear();
            prepareForNewPositionList();
View Full Code Here

        recentFormatsModel.removeAllFormats();
    }

    @Test
    public void testAddFormat() throws IOException {
        NavigationFormat format = new Gpx11Format();
        recentFormatsModel.addFormat(format);
        assertEquals(asList(format), recentFormatsModel.getFormats());
    }
View Full Code Here

        assertEquals(asList(format), recentFormatsModel.getFormats());
    }

    @Test
    public void testAddExistingFormat() throws IOException {
        NavigationFormat format = new Gpx11Format();
        recentFormatsModel.addFormat(format);
        recentFormatsModel.addFormat(format);
        recentFormatsModel.addFormat(format);
        assertEquals(asList(format), recentFormatsModel.getFormats());
    }
View Full Code Here

        assertEquals(asList(format), recentFormatsModel.getFormats());
    }

    @Test
    public void testReadExistingFormatBug() throws IOException {
        NavigationFormat first = new Gpx11Format();
        NavigationFormat second = new Kml22Format();
        NavigationFormat third = new Tcx2Format();
        recentFormatsModel.addFormat(first);
        recentFormatsModel.addFormat(second);
        recentFormatsModel.addFormat(first);
View Full Code Here

    }

    @Test
    public void testConvertColumbusV900ToGpx() throws IOException {
        convertRoundtrip(TEST_PATH + "from-columbusv900-professional.csv", new ColumbusV900ProfessionalFormat(), new Gpx10Format());
        convertRoundtrip(TEST_PATH + "from-columbusv900-professional.csv", new ColumbusV900ProfessionalFormat(), new Gpx11Format());
    }
View Full Code Here

    }

    @Test
    public void testConvertGoPalTrackToGpx() throws IOException {
        convertRoundtrip(TEST_PATH + "from-gopal.trk", new GoPalTrackFormat(), new Gpx10Format());
        convertRoundtrip(TEST_PATH + "from-gopal.trk", new GoPalTrackFormat(), new Gpx11Format());
    }
View Full Code Here

    }

    @Test
    public void testConvertGpsTunerToGpx() throws IOException {
        convertRoundtrip(TEST_PATH + "from-gpstuner.trk", new GpsTunerFormat(), new Gpx10Format());
        convertRoundtrip(TEST_PATH + "from-gpstuner.trk", new GpsTunerFormat(), new Gpx11Format());
    }
View Full Code Here

TOP

Related Classes of slash.navigation.gpx.Gpx11Format

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.