Package slash.navigation.kml.binding22

Examples of slash.navigation.kml.binding22.UpdateType


        lineStyleType.setWidth(width);
        return styleType;
    }

    protected KmlType createKmlType(KmlRoute route, int startIndex, int endIndex) {
        ObjectFactory objectFactory = new ObjectFactory();
        KmlType kmlType = objectFactory.createKmlType();
        DocumentType documentType = objectFactory.createDocumentType();
        kmlType.setAbstractFeatureGroup(objectFactory.createDocument(documentType));
        documentType.setName(createDocumentName(route));
        documentType.setDescription(asDescription(route.getDescription()));
        documentType.setOpen(TRUE);

        documentType.getAbstractStyleSelectorGroup().add(objectFactory.createStyle(createLineStyle(ROUTE_LINE_STYLE, getLineWidth(), getRouteLineColor())));
        documentType.getAbstractStyleSelectorGroup().add(objectFactory.createStyle(createLineStyle(TRACK_LINE_STYLE, getLineWidth(), getTrackLineColor())));
        if (isWriteSpeed())
            for (StyleType style : createSpeedTrackColors(getSpeedLineWidth()))
                documentType.getAbstractStyleSelectorGroup().add(objectFactory.createStyle(style));

        FolderType folderType = createWayPoints(route, startIndex, endIndex);
        documentType.getAbstractFeatureGroup().add(objectFactory.createFolder(folderType));

        PlacemarkType placemarkTrack = createTrack(route, startIndex, endIndex);
        documentType.getAbstractFeatureGroup().add(objectFactory.createPlacemark(placemarkTrack));

        if (route.getCharacteristics().equals(Track) && isWriteSpeed()) {
            FolderType speed = createSpeed(route, startIndex, endIndex);
            if (speed != null)
                documentType.getAbstractFeatureGroup().add(objectFactory.createFolder(speed));
        }
        if (!route.getCharacteristics().equals(Waypoints) && isWriteMarks()) {
            FolderType marks = createMarks(route, startIndex, endIndex);
            documentType.getAbstractFeatureGroup().add(objectFactory.createFolder(marks));
        }
        return kmlType;
    }
View Full Code Here


        }
        return kmlType;
    }

    private KmlType createKmlType(List<KmlRoute> routes) {
        ObjectFactory objectFactory = new ObjectFactory();
        KmlType kmlType = objectFactory.createKmlType();
        DocumentType documentType = objectFactory.createDocumentType();
        kmlType.setAbstractFeatureGroup(objectFactory.createDocument(documentType));
        documentType.setOpen(TRUE);

        documentType.getAbstractStyleSelectorGroup().add(objectFactory.createStyle(createLineStyle(ROUTE_LINE_STYLE, getLineWidth(), getRouteLineColor())));
        documentType.getAbstractStyleSelectorGroup().add(objectFactory.createStyle(createLineStyle(TRACK_LINE_STYLE, getLineWidth(), getTrackLineColor())));
        if (isWriteSpeed())
            for (StyleType style : createSpeedTrackColors(getSpeedLineWidth()))
                documentType.getAbstractStyleSelectorGroup().add(objectFactory.createStyle(style));

        for (KmlRoute route : routes) {
            switch (route.getCharacteristics()) {
                case Waypoints:
                    FolderType wayPoints = createWayPoints(route, 0, route.getPositionCount());
                    documentType.getAbstractFeatureGroup().add(objectFactory.createFolder(wayPoints));
                    break;
                case Route:
                    FolderType routeFolder = objectFactory.createFolderType();
                    routeFolder.setName(createPlacemarkName(ROUTE, route));
                    documentType.getAbstractFeatureGroup().add(objectFactory.createFolder(routeFolder));

                    PlacemarkType routePlacemarks = createRoute(route);
                    routeFolder.getAbstractFeatureGroup().add(objectFactory.createPlacemark(routePlacemarks));
                    if (isWriteMarks())
                        routeFolder.getAbstractFeatureGroup().add(objectFactory.createFolder(createMarks(route, 0, route.getPositionCount())));
                    break;
                case Track:
                    FolderType trackFolder = objectFactory.createFolderType();
                    trackFolder.setName(createPlacemarkName(TRACK, route));
                    documentType.getAbstractFeatureGroup().add(objectFactory.createFolder(trackFolder));

                    PlacemarkType track = createTrack(route, 0, route.getPositionCount());
                    trackFolder.getAbstractFeatureGroup().add(objectFactory.createPlacemark(track));
                    if (isWriteSpeed()) {
                        FolderType speed = createSpeed(route, 0, route.getPositionCount());
                        if (speed != null)
                            trackFolder.getAbstractFeatureGroup().add(objectFactory.createFolder(speed));
                    }
                    if (isWriteMarks())
                        trackFolder.getAbstractFeatureGroup().add(objectFactory.createFolder(createMarks(route, 0, route.getPositionCount())));
                    break;
                default:
                    throw new IllegalArgumentException("Unknown RouteCharacteristics " + route.getCharacteristics());
            }
        }
View Full Code Here

        }
        return line;
    }

    private FolderType createWayPoints(KmlRoute route, int startIndex, int endIndex) {
        ObjectFactory objectFactory = new ObjectFactory();
        FolderType folderType = objectFactory.createFolderType();
        folderType.setName(WAYPOINTS);
        List<KmlPosition> positions = route.getPositions();
        for (int i = startIndex; i < endIndex; i++) {
            KmlPosition position = positions.get(i);
            PlacemarkType placemarkType = objectFactory.createPlacemarkType();
            folderType.getAbstractFeatureGroup().add(objectFactory.createPlacemark(placemarkType));
            placemarkType.setName(trimLineFeedsAndCommas(asName(isWriteName() ? position.getDescription() : null)));
            placemarkType.setDescription(trimLineFeedsAndCommas(asDesc(isWriteDesc() ? position.getDescription() : null)));
            PointType pointType = objectFactory.createPointType();
            placemarkType.setAbstractGeometryGroup(objectFactory.createPoint(pointType));
            pointType.getCoordinates().add(createCoordinates(position, false));
        }
        return folderType;
    }
View Full Code Here

        }
        return folderType;
    }

    protected KmlType createKmlType(KmlRoute route, int startIndex, int endIndex) {
        ObjectFactory objectFactory = new ObjectFactory();
        KmlType kmlType = objectFactory.createKmlType();
        DocumentType documentType = objectFactory.createDocumentType();
        kmlType.setAbstractFeatureGroup(objectFactory.createDocument(documentType));
        documentType.setName(IGO_ROUTE);
        documentType.setDescription(trimLineFeedsAndCommas(asDescription(route.getDescription())));
        documentType.setOpen(TRUE);

        FolderType folderType = createWayPoints(route, startIndex, endIndex);
        documentType.getAbstractFeatureGroup().add(objectFactory.createFolder(folderType));
        return kmlType;
    }
View Full Code Here

        FolderType folderType = objectFactory.createFolderType();
        folderType.setName(WAYPOINTS);
        List<KmlPosition> positions = route.getPositions();
        for (int i = startIndex; i < endIndex; i++) {
            KmlPosition position = positions.get(i);
            PlacemarkType placemarkType = objectFactory.createPlacemarkType();
            folderType.getAbstractFeatureGroup().add(objectFactory.createPlacemark(placemarkType));
            placemarkType.setName(trimLineFeedsAndCommas(asName(isWriteName() ? position.getDescription() : null)));
            placemarkType.setDescription(trimLineFeedsAndCommas(asDesc(isWriteDesc() ? position.getDescription() : null)));
            PointType pointType = objectFactory.createPointType();
            placemarkType.setAbstractGeometryGroup(objectFactory.createPoint(pointType));
            pointType.getCoordinates().add(createCoordinates(position, false));
        }
        return folderType;
    }
View Full Code Here

            KmlPosition position = positions.get(i);
            PlacemarkType placemarkType = objectFactory.createPlacemarkType();
            folderType.getAbstractFeatureGroup().add(objectFactory.createPlacemark(placemarkType));
            placemarkType.setName(trimLineFeedsAndCommas(asName(isWriteName() ? position.getDescription() : null)));
            placemarkType.setDescription(trimLineFeedsAndCommas(asDesc(isWriteDesc() ? position.getDescription() : null)));
            PointType pointType = objectFactory.createPointType();
            placemarkType.setAbstractGeometryGroup(objectFactory.createPoint(pointType));
            pointType.getCoordinates().add(createCoordinates(position, false));
        }
        return folderType;
    }
View Full Code Here

TOP

Related Classes of slash.navigation.kml.binding22.UpdateType

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.