All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.micromata.opengis.kml.v_2_2_0.Link Maven / Gradle / Ivy

Go to download

This is JavaAPIforKMml, Micromata's library for use with applications that want to parse, generate and operate on KML. It is an implementation of the OGC KML 2.2 standard. It is written entirely in Java and makes heavy use of JAXB.

There is a newer version: 3.0.4
Show newest version

package de.micromata.opengis.kml.v_2_2_0;

import de.micromata.opengis.kml.v_2_2_0.annotations.Obvious;
import jakarta.xml.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;


/**
 * {@code } (required). see {@code }.
 * 

* {@code } specifies the location of any of the following: *

*

* If the file specified in {@code }is a local file, the {@code } and {@code } * elements are not used. *

*

* KML files fetched by network links Image files used in any Overlay (the {@code }element * specifies the image in an Overlay; {@code }has the same fields as {@code }) Model files * used in the {@code } element *

*

* Specifies the URL of the website containing this KML or KMZ file. Be sure to include * the namespace for this element in any KML file that uses it: xmlns:atom="http://www.w3.org/2005/Atom" * (see the sample that follows). *

*

* Specifies the file to load and optional refresh parameters. See {@code }. *

*

* The {@code } element replaces the {@code } element of NetworkLink contained in earlier * KML releases and adds functionality for the {@code } element (introduced in KML * 2.1). In Google Earth releases 3.0 and earlier, the {@code } element is ignored. *

*

* The file is conditionally loaded and refreshed, depending on the refresh parameters * supplied here. Two different sets of refresh parameters can be specified: one set * is based on time ({@code } and {@code }) and one is based on the current * "camera" view ({@code } and {@code }). In addition, Link specifies * whether to scale the bounding box parameters that are sent to the server ({@code } * and provides a set of optional viewing parameters that can be sent to the server * ({@code }) as well as a set of optional parameters containing version and language * information. *

*

* Tip: To display the top-level Folder or Document within a Network Link in the List * View, assign an ID to the Folder or Document. Without this ID, only the child object * names are displayed in the List View. *

*

* When a file is fetched, the URL that is sent to the server is composed of three * pieces of information: *

*

* the href (Hypertext Reference) that specifies the file to load. an arbitrary format * string that is created from (a) parameters that you specify in the {@code } * element or (b) bounding box parameters (this is the default and is used if no {@code } * element is included in the file). a second format string that is specified in the * {@code } element. *

* * Syntax: *
<Link id="ID">
 *   <!-- specific to Link -->
 *   <href>...</href>                      <!-- string -->
 *   <refreshMode>onChange</refreshMode>   
 *     <!-- refreshModeEnum: onChange, onInterval, or onExpire -->   
 *   <refreshInterval>4</refreshInterval>  <!-- float -->
 *   <viewRefreshMode>never</viewRefreshMode> 
 *     <!-- viewRefreshModeEnum: never, onStop, onRequest, onRegion -->
 *   <viewRefreshTime>4</viewRefreshTime>  <!-- float -->
 *   <viewBoundScale>1</viewBoundScale>    <!-- float -->
 *   <viewFormat>BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]</viewFormat>
 *                                         <!-- string -->
 *   <httpQuery>...</httpQuery>            <!-- string -->
 * </Link>
* * Extends: * * * Contained By: * * * * See Also: * {@code } * {@code } * * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "LinkType", propOrder = { "refreshMode", "refreshInterval", "viewRefreshMode", "viewRefreshTime", "viewBoundScale", "viewFormat", "httpQuery", "linkSimpleExtension", "linkObjectExtension" }) @XmlRootElement(name = "Link", namespace = "http://www.opengis.net/kml/2.2") public class Link extends BasicLink implements Cloneable { /** * RefreshMode *

* onChange, onInterval, onExpire *

* * See Also: * See {@code } * * * */ @XmlElement(defaultValue = "onChange") protected RefreshMode refreshMode; /** * {@code } *

* Indicates to refresh the file every n seconds. *

* * * */ @XmlElement(defaultValue = "4.0") protected double refreshInterval; /** * ViewRefreshMode *

* never, onRequest, onStop, onRegion *

* * See Also: * See {@code } * * * */ @XmlElement(defaultValue = "never") protected ViewRefreshMode viewRefreshMode; /** * {@code } *

* After camera movement stops, specifies the number of seconds to wait before refreshing * the view. (See {@code } and onStop above.) *

* * * */ @XmlElement(defaultValue = "4.0") protected double viewRefreshTime; /** * {@code } *

* Scales the BBOX parameters before sending them to the server. A value less than * 1 specifies to use less than the full view (screen). A value greater than 1 specifies * to fetch an area that extends beyond the edges of the current view. *

* * * */ @XmlElement(defaultValue = "1.0") protected double viewBoundScale; /** * {@code } *

* BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth] *

*

* If you specify a {@code } of onStop and do not include the {@code } * tag in the file, the following information is automatically appended to the query * string: *

*

* If you specify an empty {@code } tag, no information is appended to the query * string. *

*

* Specifies the format of the query string that is appended to the Link's {@code }before * the file is fetched.(If the {@code }specifies a local file, this element is ignored.) *

*

* This information matches the Web Map Service (WMS) bounding box specification. *

*

* You can also specify a custom set of viewing parameters to add to the query string. * If you supply a format string, it is used instead of the BBOX information. If you * also want the BBOX information, you need to add those parameters along with the * custom parameters. *

*

* You can use any of the following parameters in your format string (and Google Earth * will substitute the appropriate current value at the time it creates the query string): * [lookatLon], [lookatLat] - longitude and latitude of the point that LookAt is * viewing [lookatRange], [lookatTilt], [lookatHeading] - values used by the LookAt * element (see descriptions of {@code }, {@code }, and {@code } in LookAt) [lookatTerrainLon], * [lookatTerrainLat], [lookatTerrainAlt] - point on the terrain in degrees/meters * that LookAt is viewing [cameraLon], [cameraLat], [cameraAlt] - degrees/meters * of the eyepoint for the camera [horizFov], [vertFov] - horizontal, vertical field * of view for the camera [horizPixels], [vertPixels] - size in pixels of the 3D viewer * [terrainEnabled] - indicates whether the 3D viewer is showing terrain *

* * * */ protected String viewFormat; /** * {@code } *

* Appends information to the query string, based on the parameters specified. (Google * Earth substitutes the appropriate current value at the time it creates the query * string.) The following parameters are supported: [clientVersion] [kmlVersion] [clientName] * [language] *

* * * */ protected String httpQuery; @XmlElement(name = "LinkSimpleExtensionGroup") @XmlSchemaType(name = "anySimpleType") protected List linkSimpleExtension; /** * {@code } *

* This is an abstract base class and cannot be used directly in a KML file. It provides * the id attribute, which allows unique identification of a KML element, and the targetId * attribute, which is used to reference objects that have already been loaded into * Google Earth. The id attribute must be assigned if the Update mechanism is to * be used. *

* * Syntax: *
<!-- abstract element; do not create -->
     * <!-- Object id="ID" targetId="NCName" -->
     * <!-- /Object> -->
* * * */ @XmlElement(name = "LinkObjectExtensionGroup") protected List linkObjectExtension; public Link() { super(); } /** * * * @return * possible object is * {@link RefreshMode} * */ public RefreshMode getRefreshMode() { return refreshMode; } /** * * * @param value * allowed object is * {@link RefreshMode} * */ public void setRefreshMode(RefreshMode value) { this.refreshMode = value; } /** * * * @return * possible object is * {@link Double} * */ public double getRefreshInterval() { return refreshInterval; } /** * * * @param value * allowed object is * {@link Double} * */ public void setRefreshInterval(double value) { this.refreshInterval = value; } /** * * * @return * possible object is * {@link ViewRefreshMode} * */ public ViewRefreshMode getViewRefreshMode() { return viewRefreshMode; } /** * * * @param value * allowed object is * {@link ViewRefreshMode} * */ public void setViewRefreshMode(ViewRefreshMode value) { this.viewRefreshMode = value; } /** * * * @return * possible object is * {@link Double} * */ public double getViewRefreshTime() { return viewRefreshTime; } /** * * * @param value * allowed object is * {@link Double} * */ public void setViewRefreshTime(double value) { this.viewRefreshTime = value; } /** * * * @return * possible object is * {@link Double} * */ public double getViewBoundScale() { return viewBoundScale; } /** * * * @param value * allowed object is * {@link Double} * */ public void setViewBoundScale(double value) { this.viewBoundScale = value; } /** * * * @return * possible object is * {@link String} * */ public String getViewFormat() { return viewFormat; } /** * * * @param value * allowed object is * {@link String} * */ public void setViewFormat(String value) { this.viewFormat = value; } /** * * * @return * possible object is * {@link String} * */ public String getHttpQuery() { return httpQuery; } /** * * * @param value * allowed object is * {@link String} * */ public void setHttpQuery(String value) { this.httpQuery = value; } /** * * */ public List getLinkSimpleExtension() { if (linkSimpleExtension == null) { linkSimpleExtension = new ArrayList(); } return this.linkSimpleExtension; } /** * * */ public List getLinkObjectExtension() { if (linkObjectExtension == null) { linkObjectExtension = new ArrayList(); } return this.linkObjectExtension; } @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); long temp; result = ((prime*result)+((refreshMode == null)? 0 :refreshMode.hashCode())); temp = Double.doubleToLongBits(refreshInterval); result = ((prime*result)+((int)(temp^(temp >>>(32))))); result = ((prime*result)+((viewRefreshMode == null)? 0 :viewRefreshMode.hashCode())); temp = Double.doubleToLongBits(viewRefreshTime); result = ((prime*result)+((int)(temp^(temp >>>(32))))); temp = Double.doubleToLongBits(viewBoundScale); result = ((prime*result)+((int)(temp^(temp >>>(32))))); result = ((prime*result)+((viewFormat == null)? 0 :viewFormat.hashCode())); result = ((prime*result)+((httpQuery == null)? 0 :httpQuery.hashCode())); result = ((prime*result)+((linkSimpleExtension == null)? 0 :linkSimpleExtension.hashCode())); result = ((prime*result)+((linkObjectExtension == null)? 0 :linkObjectExtension.hashCode())); return result; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (super.equals(obj) == false) { return false; } if ((obj instanceof Link) == false) { return false; } Link other = ((Link) obj); if (refreshMode == null) { if (other.refreshMode!= null) { return false; } } else { if (refreshMode.equals(other.refreshMode) == false) { return false; } } if (refreshInterval!= other.refreshInterval) { return false; } if (viewRefreshMode == null) { if (other.viewRefreshMode!= null) { return false; } } else { if (viewRefreshMode.equals(other.viewRefreshMode) == false) { return false; } } if (viewRefreshTime!= other.viewRefreshTime) { return false; } if (viewBoundScale!= other.viewBoundScale) { return false; } if (viewFormat == null) { if (other.viewFormat!= null) { return false; } } else { if (viewFormat.equals(other.viewFormat) == false) { return false; } } if (httpQuery == null) { if (other.httpQuery!= null) { return false; } } else { if (httpQuery.equals(other.httpQuery) == false) { return false; } } if (linkSimpleExtension == null) { if (other.linkSimpleExtension!= null) { return false; } } else { if (linkSimpleExtension.equals(other.linkSimpleExtension) == false) { return false; } } if (linkObjectExtension == null) { if (other.linkObjectExtension!= null) { return false; } } else { if (linkObjectExtension.equals(other.linkObjectExtension) == false) { return false; } } return true; } /** * * * @param linkSimpleExtension * Objects of the following type are allowed in the list: {@link Object} */ public void setLinkSimpleExtension(final List linkSimpleExtension) { this.linkSimpleExtension = linkSimpleExtension; } /** * add a value to the linkSimpleExtension property collection * * @param linkSimpleExtension * Objects of the following type are allowed in the list: {@link Object} * @return * true (as general contract of Collection.add). */ public Link addToLinkSimpleExtension(final Object linkSimpleExtension) { this.getLinkSimpleExtension().add(linkSimpleExtension); return this; } /** * * * @param linkObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} */ public void setLinkObjectExtension(final List linkObjectExtension) { this.linkObjectExtension = linkObjectExtension; } /** * add a value to the linkObjectExtension property collection * * @param linkObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} * @return * true (as general contract of Collection.add). */ public Link addToLinkObjectExtension(final AbstractObject linkObjectExtension) { this.getLinkObjectExtension().add(linkObjectExtension); return this; } /** * * */ @Obvious @Override public void setObjectSimpleExtension(final List objectSimpleExtension) { super.setObjectSimpleExtension(objectSimpleExtension); } @Obvious @Override public Link addToObjectSimpleExtension(final Object objectSimpleExtension) { super.getObjectSimpleExtension().add(objectSimpleExtension); return this; } /** * * */ @Obvious @Override public void setBasicLinkSimpleExtension(final List basicLinkSimpleExtension) { super.setBasicLinkSimpleExtension(basicLinkSimpleExtension); } @Obvious @Override public Link addToBasicLinkSimpleExtension(final Object basicLinkSimpleExtension) { super.getBasicLinkSimpleExtension().add(basicLinkSimpleExtension); return this; } /** * * */ @Obvious @Override public void setBasicLinkObjectExtension(final List basicLinkObjectExtension) { super.setBasicLinkObjectExtension(basicLinkObjectExtension); } @Obvious @Override public Link addToBasicLinkObjectExtension(final AbstractObject basicLinkObjectExtension) { super.getBasicLinkObjectExtension().add(basicLinkObjectExtension); return this; } /** * fluent setter * * * @param refreshMode * required parameter */ public Link withRefreshMode(final RefreshMode refreshMode) { this.setRefreshMode(refreshMode); return this; } /** * fluent setter * * * @param refreshInterval * required parameter */ public Link withRefreshInterval(final double refreshInterval) { this.setRefreshInterval(refreshInterval); return this; } /** * fluent setter * * * @param viewRefreshMode * required parameter */ public Link withViewRefreshMode(final ViewRefreshMode viewRefreshMode) { this.setViewRefreshMode(viewRefreshMode); return this; } /** * fluent setter * * * @param viewRefreshTime * required parameter */ public Link withViewRefreshTime(final double viewRefreshTime) { this.setViewRefreshTime(viewRefreshTime); return this; } /** * fluent setter * * * @param viewBoundScale * required parameter */ public Link withViewBoundScale(final double viewBoundScale) { this.setViewBoundScale(viewBoundScale); return this; } /** * fluent setter * * * @param viewFormat * required parameter */ public Link withViewFormat(final String viewFormat) { this.setViewFormat(viewFormat); return this; } /** * fluent setter * * * @param httpQuery * required parameter */ public Link withHttpQuery(final String httpQuery) { this.setHttpQuery(httpQuery); return this; } /** * fluent setter * * * @param linkSimpleExtension * required parameter */ public Link withLinkSimpleExtension(final List linkSimpleExtension) { this.setLinkSimpleExtension(linkSimpleExtension); return this; } /** * fluent setter * * * @param linkObjectExtension * required parameter */ public Link withLinkObjectExtension(final List linkObjectExtension) { this.setLinkObjectExtension(linkObjectExtension); return this; } @Obvious @Override public Link withObjectSimpleExtension(final List objectSimpleExtension) { super.withObjectSimpleExtension(objectSimpleExtension); return this; } @Obvious @Override public Link withId(final String id) { super.withId(id); return this; } @Obvious @Override public Link withTargetId(final String targetId) { super.withTargetId(targetId); return this; } @Obvious @Override public Link withHref(final String href) { super.withHref(href); return this; } @Obvious @Override public Link withBasicLinkSimpleExtension(final List basicLinkSimpleExtension) { super.withBasicLinkSimpleExtension(basicLinkSimpleExtension); return this; } @Obvious @Override public Link withBasicLinkObjectExtension(final List basicLinkObjectExtension) { super.withBasicLinkObjectExtension(basicLinkObjectExtension); return this; } @Override public Link clone() { Link copy; copy = ((Link) super.clone()); copy.linkSimpleExtension = new ArrayList((getLinkSimpleExtension().size())); for (Object iter: linkSimpleExtension) { copy.linkSimpleExtension.add(iter); } copy.linkObjectExtension = new ArrayList((getLinkObjectExtension().size())); for (AbstractObject iter: linkObjectExtension) { copy.linkObjectExtension.add(iter.clone()); } return copy; } }