Search in sources :

Example 1 with Tour

use of slash.navigation.gopal.binding5.Tour in project RouteConverter by cpesch.

the class GoPal3RouteFormat method createGoPal.

private Tour createGoPal(GoPalRoute route, int startIndex, int endIndex) {
    ObjectFactory objectFactory = new ObjectFactory();
    Tour tour = objectFactory.createTour();
    tour.setOptions(createOptions(route));
    for (int i = startIndex; i < endIndex; i++) {
        GoPalPosition position = route.getPosition(i);
        Tour.Dest dest = objectFactory.createTourDest();
        if (position.getX() != null)
            dest.setLongitude(position.getX());
        if (position.getY() != null)
            dest.setLatitude(position.getY());
        dest.setCity(position.getCity());
        if (position.getCountry() != null)
            dest.setCountry(position.getCountry());
        if (position.getHouseNumber() != null)
            dest.setHouse(position.getHouseNumber());
        dest.setStreet(position.getStreet());
        dest.setZip(position.getZipCode());
        if (i == startIndex)
            dest.setStartPos((short) 1);
        tour.getDest().add(dest);
    }
    return tour;
}
Also used : ObjectFactory(slash.navigation.gopal.binding3.ObjectFactory) Tour(slash.navigation.gopal.binding3.Tour)

Example 2 with Tour

use of slash.navigation.gopal.binding5.Tour in project RouteConverter by cpesch.

the class GoPal5RouteFormat method createGoPal.

private Tour createGoPal(GoPalRoute route, int startIndex, int endIndex) {
    ObjectFactory objectFactory = new ObjectFactory();
    Tour tour = objectFactory.createTour();
    tour.setRouteOptions(createRouteOptions(route));
    for (int i = startIndex; i < endIndex; i++) {
        GoPalPosition position = route.getPosition(i);
        if (i == startIndex) {
            tour.setStart(createStart(position));
        } else {
            tour.getDestination().add(createDestination(position));
        }
    }
    return tour;
}
Also used : ObjectFactory(slash.navigation.gopal.binding5.ObjectFactory) Tour(slash.navigation.gopal.binding5.Tour)

Example 3 with Tour

use of slash.navigation.gopal.binding5.Tour in project RouteConverter by cpesch.

the class GoPal3RouteFormat method read.

public void read(InputStream source, ParserContext<GoPalRoute> context) throws IOException {
    Tour tour = unmarshal3(source);
    context.appendRoute(process(tour));
}
Also used : Tour(slash.navigation.gopal.binding3.Tour)

Example 4 with Tour

use of slash.navigation.gopal.binding5.Tour in project RouteConverter by cpesch.

the class GoPal5RouteFormat method read.

public void read(InputStream source, ParserContext<GoPalRoute> context) throws IOException {
    Tour tour = unmarshal5(source);
    context.appendRoute(process(tour));
}
Also used : Tour(slash.navigation.gopal.binding5.Tour)

Example 5 with Tour

use of slash.navigation.gopal.binding5.Tour in project RouteConverter by cpesch.

the class GoPal7RouteFormat method createGoPal.

private Tour createGoPal(GoPalRoute route, int startIndex, int endIndex) {
    ObjectFactory objectFactory = new ObjectFactory();
    Tour tour = objectFactory.createTour();
    tour.setRouteOptions(createRouteOptions(route));
    for (int i = startIndex; i < endIndex; i++) {
        GoPalPosition position = route.getPosition(i);
        if (i == startIndex) {
            tour.setStart(createStart(position));
        } else {
            tour.getDestination().add(createDestination(position));
        }
    }
    return tour;
}
Also used : ObjectFactory(slash.navigation.gopal.binding5.ObjectFactory) Tour(slash.navigation.gopal.binding5.Tour)

Aggregations

Tour (slash.navigation.gopal.binding5.Tour)4 Tour (slash.navigation.gopal.binding3.Tour)2 ObjectFactory (slash.navigation.gopal.binding5.ObjectFactory)2 ObjectFactory (slash.navigation.gopal.binding3.ObjectFactory)1