Package org.openstreetmap.josm.data.gpx

Examples of org.openstreetmap.josm.data.gpx.GpxLink


        break;
      case author:
        if (qName.equals("link")) {
          states.push(currentState);
          currentState = State.link;
          currentLink = new GpxLink(atts.getValue("href"));
        } else if (qName.equals("email")) {
          currentData.attr.put(GpxData.META_AUTHOR_EMAIL, atts
              .getValue("id")
              + "@" + atts.getValue("domain"));
        }
        break;
      case trk:
        if (qName.equals("trkseg")) {
          states.push(currentState);
          currentState = State.trkseg;
          currentTrackSeg = new ArrayList<WayPoint>();
        } else if (qName.equals("link")) {
          states.push(currentState);
          currentState = State.link;
          currentLink = new GpxLink(atts.getValue("href"));
        } else if (qName.equals("extensions")) {
          states.push(currentState);
          currentState = State.ext;
        }
        break;
      case metadata:
        if (qName.equals("author")) {
          states.push(currentState);
          currentState = State.author;
        } else if (qName.equals("extensions")) {
          states.push(currentState);
          currentState = State.ext;
        } else if (qName.equals("copyright")) {
          states.push(currentState);
          currentState = State.copyright;
          currentData.attr.put(GpxData.META_COPYRIGHT_AUTHOR, atts
              .getValue("author"));
        } else if (qName.equals("link")) {
          states.push(currentState);
          currentState = State.link;
          currentLink = new GpxLink(atts.getValue("href"));
        }
        break;
      case trkseg:
        if (qName.equals("trkpt")) {
          states.push(currentState);
          currentState = State.wpt;
          currentWayPoint = new WayPoint(parseLatLon(atts));
        }
        break;
      case wpt:
        if (qName.equals("link")) {
          states.push(currentState);
          currentState = State.link;
          currentLink = new GpxLink(atts.getValue("href"));
        } else if (qName.equals("extensions")) {
          states.push(currentState);
          currentState = State.ext;
        }
        break;
      case rte:
        if (qName.equals("link")) {
          states.push(currentState);
          currentState = State.link;
          currentLink = new GpxLink(atts.getValue("href"));
        } else if (qName.equals("rtept")) {
          states.push(currentState);
          currentState = State.wpt;
          currentWayPoint = new WayPoint(parseLatLon(atts));
        } else if (qName.equals("extensions")) {
View Full Code Here


        } else if (qName.equals("type")) {
          currentLink.type = accumulator.toString();
        } else if (qName.equals("link")) {
          if (currentLink.uri == null && accumulator != null
              && accumulator.toString().length() != 0) {
            currentLink = new GpxLink(accumulator.toString());
          }
          currentState = states.pop();
        }
        if (currentState == State.author) {
          currentData.attr.put(GpxData.META_AUTHOR_LINK, currentLink);
View Full Code Here

                    data.attr.put(META_COPYRIGHT_AUTHOR, atts.getValue("author"));
                    break;
                case "link":
                    states.push(currentState);
                    currentState = State.link;
                    currentLink = new GpxLink(atts.getValue("href"));
                }
                break;
            case author:
                switch (localName) {
                case "link":
                    states.push(currentState);
                    currentState = State.link;
                    currentLink = new GpxLink(atts.getValue("href"));
                    break;
                case "email":
                    data.attr.put(META_AUTHOR_EMAIL, atts.getValue("id") + "@" + atts.getValue("domain"));
                }
                break;
            case trk:
                switch (localName) {
                case "trkseg":
                    states.push(currentState);
                    currentState = State.trkseg;
                    currentTrackSeg = new ArrayList<>();
                    break;
                case "link":
                    states.push(currentState);
                    currentState = State.link;
                    currentLink = new GpxLink(atts.getValue("href"));
                    break;
                case "extensions":
                    states.push(currentState);
                    currentState = State.ext;
                    currentExtensions = new Extensions();
                }
                break;
            case trkseg:
                if ("trkpt".equals(localName)) {
                    states.push(currentState);
                    currentState = State.wpt;
                    currentWayPoint = new WayPoint(parseLatLon(atts));
                }
                break;
            case wpt:
                switch (localName) {
                case "link":
                    states.push(currentState);
                    currentState = State.link;
                    currentLink = new GpxLink(atts.getValue("href"));
                    break;
                case "extensions":
                    states.push(currentState);
                    currentState = State.ext;
                    currentExtensions = new Extensions();
                    break;
                }
                break;
            case rte:
                switch (localName) {
                case "link":
                    states.push(currentState);
                    currentState = State.link;
                    currentLink = new GpxLink(atts.getValue("href"));
                    break;
                case "rtept":
                    states.push(currentState);
                    currentState = State.wpt;
                    currentWayPoint = new WayPoint(parseLatLon(atts));
View Full Code Here

                case "type":
                    currentLink.type = accumulator.toString();
                    break;
                case "link":
                    if (currentLink.uri == null && accumulator != null && accumulator.toString().length() != 0) {
                        currentLink = new GpxLink(accumulator.toString());
                    }
                    currentState = states.pop();
                    break;
                }
                if (currentState == State.author) {
View Full Code Here

            String urlname = (String) attr.get("urlname");
            if (url != null) {
                if (!attr.containsKey(META_LINKS)) {
                    attr.put(META_LINKS, new LinkedList<GpxLink>());
                }
                GpxLink link = new GpxLink(url);
                link.text = urlname;
                @SuppressWarnings({ "unchecked", "rawtypes" })
                Collection<GpxLink> links = (Collection<GpxLink>) attr.get(META_LINKS);
                links.add(link);
            }
View Full Code Here

    }

    @Override
    public WayPoint convertToWayPoint() {
        WayPoint wpt = super.convertToWayPoint();
        GpxLink link = new GpxLink(webUrl.toString());
        link.type = "web";
        wpt.attr.put(GpxConstants.META_LINKS, Collections.singleton(link));
        return wpt;
    }
View Full Code Here

    }

    @Override
    public WayPoint convertToWayPoint() {
        WayPoint wpt = super.convertToWayPoint();
        GpxLink link = new GpxLink(imageUrl.toString());
        link.type = "image";
        wpt.attr.put(GpxConstants.META_LINKS, Collections.singleton(link));
        return wpt;
    }
View Full Code Here

    }

    @Override
    public WayPoint convertToWayPoint() {
        WayPoint wpt = super.convertToWayPoint();
        GpxLink link = new GpxLink(audioUrl.toString());
        link.type = "audio";
        wpt.attr.put(GpxConstants.META_LINKS, Collections.singleton(link));
        wpt.addExtension("offset", Double.toString(offset));
        wpt.addExtension("sync-offset", Double.toString(syncOffset));
        return wpt;
View Full Code Here

TOP

Related Classes of org.openstreetmap.josm.data.gpx.GpxLink

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.