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

de.micromata.opengis.kml.v_2_2_0.NetworkLink 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 de.micromata.opengis.kml.v_2_2_0.atom.Author;
import de.micromata.opengis.kml.v_2_2_0.xal.AddressDetails;
import jakarta.xml.bind.annotation.*;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

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


/**
 * {@code }
 * 

* References a KML file or KMZ archive on a local or remote network. Use the {@code } * element to specify the location of the KML file. Within that element, you can define * the refresh options for updating the file, based on time and camera change. NetworkLinks * can be used in combination with Regions to handle very large datasets efficiently. *

* * Syntax: *
<NetworkLink id="ID">
 *   <!-- inherited from Feature element --><name>...</name>                      <!-- string -->
 *   <visibility>1</visibility>            <!-- boolean -->
 *   <open>0</open>                        <!-- boolean -->
 *   <atom:author>...<atom:author>         <!-- xmlns:atom -->
 *   <atom:link>...</atom:link>            <!-- xmlns:atom -->
 *   <address>...</address>                <!-- string -->
 *   <xal:AddressDetails>...</xal:AddressDetails>  <!-- xmlns:xal -->
<phoneNumber>...</phoneNumber> <!-- string -->
<Snippet maxLines="2">...</Snippet> <!-- string --> * <description>...</description> <!-- string --> * <AbstractView>...</AbstractView> <!-- Camera or LookAt --> * <TimePrimitive>...</TimePrimitive> * <styleUrl>...</styleUrl> <!-- anyURI --> * <StyleSelector>...</StyleSelector> * <Region>...</Region> * <Metadata>...</Metadata> <!-- deprecated in KML 2.2 --> * <ExtendedData>...</ExtendedData> <!-- new in KML 2.2 --> * * <!-- specific to NetworkLink --> * <refreshVisibility>0</refreshVisibility> <!-- boolean --> * <flyToView>0</flyToView> <!-- boolean --> * <Link>...</Link> * </NetworkLink>
* * Extends: * * * Contained By: * * * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "NetworkLinkType", propOrder = { "refreshVisibility", "flyToView", "url", "link", "networkLinkSimpleExtension", "networkLinkObjectExtension" }) @XmlRootElement(name = "NetworkLink", namespace = "http://www.opengis.net/kml/2.2") public class NetworkLink extends Feature implements Cloneable { /** * {@code } *

* Boolean value. A value of 0 leaves the visibility of features within the control * of the Google Earth user. Set the value to 1 to reset the visibility of features * each time the NetworkLink is refreshed. For example, suppose a Placemark within * the linked KML file has {@code } set to 1 and the NetworkLink has {@code } * set to 1. When the file is first loaded into Google Earth, the user can clear the * check box next to the item to turn off display in the 3D viewer. However, when the * NetworkLink is refreshed, the Placemark will be made visible again, since its original * visibility state was TRUE. *

* * * */ @XmlElement(defaultValue = "0") @XmlJavaTypeAdapter(BooleanConverter.class) protected Boolean refreshVisibility; /** * {@code } *

* Boolean value. A value of 1 causes Google Earth to fly to the view of the LookAt * or Camera in the NetworkLinkControl (if it exists). If the NetworkLinkControl does * not contain an AbstractView element, Google Earth flies to the LookAt or Camera * element in the Feature child within the {@code } element in the refreshed file. If * the {@code } element does not have a LookAt or Camera specified, the view is unchanged. * For example, Google Earth would fly to the LookAt view of the parent Document, * not the LookAt of the Placemarks contained within the Document. *

* * * */ @XmlElement(defaultValue = "0") @XmlJavaTypeAdapter(BooleanConverter.class) protected Boolean flyToView; /** * {@code } * * */ @XmlElement(name = "Url") @Deprecated protected de.micromata.opengis.kml.v_2_2_0.Link url; /** * {@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 } * * * */ @XmlElement(name = "Link") protected de.micromata.opengis.kml.v_2_2_0.Link link; @XmlElement(name = "NetworkLinkSimpleExtensionGroup") @XmlSchemaType(name = "anySimpleType") protected List networkLinkSimpleExtension; /** * {@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 = "NetworkLinkObjectExtensionGroup") protected List networkLinkObjectExtension; public NetworkLink() { super(); } /** * * @return * possible object is * {@link Boolean} * */ public Boolean isRefreshVisibility() { return refreshVisibility; } /** * * * @param value * allowed object is * {@link Boolean} * */ public void setRefreshVisibility(Boolean value) { this.refreshVisibility = value; } /** * * @return * possible object is * {@link Boolean} * */ public Boolean isFlyToView() { return flyToView; } /** * * * @param value * allowed object is * {@link Boolean} * */ public void setFlyToView(Boolean value) { this.flyToView = value; } /** * * * @return * possible object is * {@link de.micromata.opengis.kml.v_2_2_0.Link} * */ public de.micromata.opengis.kml.v_2_2_0.Link getUrl() { return url; } /** * * * @param value * allowed object is * {@link de.micromata.opengis.kml.v_2_2_0.Link} * */ public void setUrl(de.micromata.opengis.kml.v_2_2_0.Link value) { this.url = value; } /** * * * @return * possible object is * {@link de.micromata.opengis.kml.v_2_2_0.Link} * */ public de.micromata.opengis.kml.v_2_2_0.Link getLink() { return link; } /** * * * @param value * allowed object is * {@link de.micromata.opengis.kml.v_2_2_0.Link} * */ public void setLink(de.micromata.opengis.kml.v_2_2_0.Link value) { this.link = value; } /** * * */ public List getNetworkLinkSimpleExtension() { if (networkLinkSimpleExtension == null) { networkLinkSimpleExtension = new ArrayList(); } return this.networkLinkSimpleExtension; } /** * * */ public List getNetworkLinkObjectExtension() { if (networkLinkObjectExtension == null) { networkLinkObjectExtension = new ArrayList(); } return this.networkLinkObjectExtension; } @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = ((prime*result)+((refreshVisibility == null)? 0 :refreshVisibility.hashCode())); result = ((prime*result)+((flyToView == null)? 0 :flyToView.hashCode())); result = ((prime*result)+((url == null)? 0 :url.hashCode())); result = ((prime*result)+((link == null)? 0 :link.hashCode())); result = ((prime*result)+((networkLinkSimpleExtension == null)? 0 :networkLinkSimpleExtension.hashCode())); result = ((prime*result)+((networkLinkObjectExtension == null)? 0 :networkLinkObjectExtension.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 NetworkLink) == false) { return false; } NetworkLink other = ((NetworkLink) obj); if (refreshVisibility == null) { if (other.refreshVisibility!= null) { return false; } } else { if (refreshVisibility.equals(other.refreshVisibility) == false) { return false; } } if (flyToView == null) { if (other.flyToView!= null) { return false; } } else { if (flyToView.equals(other.flyToView) == false) { return false; } } if (url == null) { if (other.url!= null) { return false; } } else { if (url.equals(other.url) == false) { return false; } } if (link == null) { if (other.link!= null) { return false; } } else { if (link.equals(other.link) == false) { return false; } } if (networkLinkSimpleExtension == null) { if (other.networkLinkSimpleExtension!= null) { return false; } } else { if (networkLinkSimpleExtension.equals(other.networkLinkSimpleExtension) == false) { return false; } } if (networkLinkObjectExtension == null) { if (other.networkLinkObjectExtension!= null) { return false; } } else { if (networkLinkObjectExtension.equals(other.networkLinkObjectExtension) == false) { return false; } } return true; } /** * Creates a new instance of {@link de.micromata.opengis.kml.v_2_2_0.Link} and set it to url. * * This method is a short version for: * {@code * Link link = new Link(); * this.setUrl(link); } * * */ public de.micromata.opengis.kml.v_2_2_0.Link createAndSetUrl() { de.micromata.opengis.kml.v_2_2_0.Link newValue = new de.micromata.opengis.kml.v_2_2_0.Link(); this.setUrl(newValue); return newValue; } /** * Creates a new instance of {@link de.micromata.opengis.kml.v_2_2_0.Link} and set it to link. * * This method is a short version for: * {@code * Link link = new Link(); * this.setLink(link); } * * */ public de.micromata.opengis.kml.v_2_2_0.Link createAndSetLink() { de.micromata.opengis.kml.v_2_2_0.Link newValue = new de.micromata.opengis.kml.v_2_2_0.Link(); this.setLink(newValue); return newValue; } /** * * * @param networkLinkSimpleExtension * Objects of the following type are allowed in the list: {@link Object} */ public void setNetworkLinkSimpleExtension(final List networkLinkSimpleExtension) { this.networkLinkSimpleExtension = networkLinkSimpleExtension; } /** * add a value to the networkLinkSimpleExtension property collection * * @param networkLinkSimpleExtension * Objects of the following type are allowed in the list: {@link Object} * @return * true (as general contract of Collection.add). */ public NetworkLink addToNetworkLinkSimpleExtension(final Object networkLinkSimpleExtension) { this.getNetworkLinkSimpleExtension().add(networkLinkSimpleExtension); return this; } /** * * * @param networkLinkObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} */ public void setNetworkLinkObjectExtension(final List networkLinkObjectExtension) { this.networkLinkObjectExtension = networkLinkObjectExtension; } /** * add a value to the networkLinkObjectExtension property collection * * @param networkLinkObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} * @return * true (as general contract of Collection.add). */ public NetworkLink addToNetworkLinkObjectExtension(final AbstractObject networkLinkObjectExtension) { this.getNetworkLinkObjectExtension().add(networkLinkObjectExtension); return this; } /** * * */ @Obvious @Override public void setObjectSimpleExtension(final List objectSimpleExtension) { super.setObjectSimpleExtension(objectSimpleExtension); } @Obvious @Override public NetworkLink addToObjectSimpleExtension(final Object objectSimpleExtension) { super.getObjectSimpleExtension().add(objectSimpleExtension); return this; } /** * * */ @Obvious @Override public void setStyleSelector(final List styleSelector) { super.setStyleSelector(styleSelector); } @Obvious @Override public NetworkLink addToStyleSelector(final StyleSelector styleSelector) { super.getStyleSelector().add(styleSelector); return this; } /** * * */ @Obvious @Override public void setFeatureSimpleExtension(final List featureSimpleExtension) { super.setFeatureSimpleExtension(featureSimpleExtension); } @Obvious @Override public NetworkLink addToFeatureSimpleExtension(final Object featureSimpleExtension) { super.getFeatureSimpleExtension().add(featureSimpleExtension); return this; } /** * * */ @Obvious @Override public void setFeatureObjectExtension(final List featureObjectExtension) { super.setFeatureObjectExtension(featureObjectExtension); } @Obvious @Override public NetworkLink addToFeatureObjectExtension(final AbstractObject featureObjectExtension) { super.getFeatureObjectExtension().add(featureObjectExtension); return this; } /** * fluent setter * * * @param refreshVisibility * required parameter */ public NetworkLink withRefreshVisibility(final Boolean refreshVisibility) { this.setRefreshVisibility(refreshVisibility); return this; } /** * fluent setter * * * @param flyToView * required parameter */ public NetworkLink withFlyToView(final Boolean flyToView) { this.setFlyToView(flyToView); return this; } /** * fluent setter * * * @param url * required parameter */ public NetworkLink withUrl(final de.micromata.opengis.kml.v_2_2_0.Link url) { this.setUrl(url); return this; } /** * fluent setter * * * @param link * required parameter */ public NetworkLink withLink(final de.micromata.opengis.kml.v_2_2_0.Link link) { this.setLink(link); return this; } /** * fluent setter * * * @param networkLinkSimpleExtension * required parameter */ public NetworkLink withNetworkLinkSimpleExtension(final List networkLinkSimpleExtension) { this.setNetworkLinkSimpleExtension(networkLinkSimpleExtension); return this; } /** * fluent setter * * * @param networkLinkObjectExtension * required parameter */ public NetworkLink withNetworkLinkObjectExtension(final List networkLinkObjectExtension) { this.setNetworkLinkObjectExtension(networkLinkObjectExtension); return this; } @Obvious @Override public NetworkLink withObjectSimpleExtension(final List objectSimpleExtension) { super.withObjectSimpleExtension(objectSimpleExtension); return this; } @Obvious @Override public NetworkLink withId(final String id) { super.withId(id); return this; } @Obvious @Override public NetworkLink withTargetId(final String targetId) { super.withTargetId(targetId); return this; } @Obvious @Override public NetworkLink withName(final String name) { super.withName(name); return this; } @Obvious @Override public NetworkLink withVisibility(final Boolean visibility) { super.withVisibility(visibility); return this; } @Obvious @Override public NetworkLink withOpen(final Boolean open) { super.withOpen(open); return this; } @Obvious @Override public NetworkLink withAtomAuthor(final Author atomAuthor) { super.withAtomAuthor(atomAuthor); return this; } @Obvious @Override public NetworkLink withAtomLink(final de.micromata.opengis.kml.v_2_2_0.atom.Link atomLink) { super.withAtomLink(atomLink); return this; } @Obvious @Override public NetworkLink withAddress(final String address) { super.withAddress(address); return this; } @Obvious @Override public NetworkLink withXalAddressDetails(final AddressDetails xalAddressDetails) { super.withXalAddressDetails(xalAddressDetails); return this; } @Obvious @Override public NetworkLink withPhoneNumber(final String phoneNumber) { super.withPhoneNumber(phoneNumber); return this; } @Obvious @Override public NetworkLink withSnippet(final Snippet snippet) { super.withSnippet(snippet); return this; } @Obvious @Override public NetworkLink withSnippetd(final String snippetd) { super.withSnippetd(snippetd); return this; } @Obvious @Override public NetworkLink withDescription(final String description) { super.withDescription(description); return this; } @Obvious @Override public NetworkLink withAbstractView(final AbstractView abstractView) { super.withAbstractView(abstractView); return this; } @Obvious @Override public NetworkLink withTimePrimitive(final TimePrimitive timePrimitive) { super.withTimePrimitive(timePrimitive); return this; } @Obvious @Override public NetworkLink withStyleUrl(final String styleUrl) { super.withStyleUrl(styleUrl); return this; } @Obvious @Override public NetworkLink withStyleSelector(final List styleSelector) { super.withStyleSelector(styleSelector); return this; } @Obvious @Override public NetworkLink withRegion(final Region region) { super.withRegion(region); return this; } @Obvious @Override public NetworkLink withMetadata(final Metadata metadata) { super.withMetadata(metadata); return this; } @Obvious @Override public NetworkLink withExtendedData(final ExtendedData extendedData) { super.withExtendedData(extendedData); return this; } @Obvious @Override public NetworkLink withFeatureSimpleExtension(final List featureSimpleExtension) { super.withFeatureSimpleExtension(featureSimpleExtension); return this; } @Obvious @Override public NetworkLink withFeatureObjectExtension(final List featureObjectExtension) { super.withFeatureObjectExtension(featureObjectExtension); return this; } @Override public NetworkLink clone() { NetworkLink copy; copy = ((NetworkLink) super.clone()); copy.url = ((url == null)?null:((de.micromata.opengis.kml.v_2_2_0.Link) url.clone())); copy.link = ((link == null)?null:((de.micromata.opengis.kml.v_2_2_0.Link) link.clone())); copy.networkLinkSimpleExtension = new ArrayList((getNetworkLinkSimpleExtension().size())); for (Object iter: networkLinkSimpleExtension) { copy.networkLinkSimpleExtension.add(iter); } copy.networkLinkObjectExtension = new ArrayList((getNetworkLinkObjectExtension().size())); for (AbstractObject iter: networkLinkObjectExtension) { copy.networkLinkObjectExtension.add(iter.clone()); } return copy; } }