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

de.micromata.opengis.kml.v_2_2_0.Overlay 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 java.util.ArrayList;
import java.util.List;


/**
 * {@code }
 * 

* This is an abstract element and cannot be used directly in a KML file. {@code } * is the base type for image overlays drawn on the planet surface or on the screen. * {@code }specifies the image to use and can be configured to reload images based on * a timer or by camera changes. This element also includes specifications for stacking * order of multiple overlays and for adding color and transparency values to the base * image. *

* * Syntax: *
<!-- abstract element; do not create -->
 * <!-- Overlay id="ID" -->                    <!-- GroundOverlay,ScreenOverlay -->
 *   <!-- 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 Overlay --> * <color>ffffffff</color> <!-- kml:color --> * <drawOrder>0</drawOrder> <!-- int --> * <Icon> * <href>...</href> * </Icon> * <!-- /Overlay -->
* * Extends: * * * Extended By: * * * * * * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "AbstractOverlayType", propOrder = { "color", "drawOrder", "icon", "overlaySimpleExtension", "overlayObjectExtension" }) @XmlSeeAlso({ ScreenOverlay.class, PhotoOverlay.class, GroundOverlay.class }) public abstract class Overlay extends Feature implements Cloneable { /** * {@code } *

* Color and opacity (alpha) values are expressed in hexadecimal notation. The range * of values for any one color is 0 to 255 (00 to ff). For alpha, 00 is fully transparent * and ff is fully opaque. The order of expression is aabbggrr, where aa=alpha (00 * to ff); bb=blue (00 to ff); gg=green (00 to ff); rr=red (00 to ff). For example, * if you want to apply a blue color with 50 percent opacity to an overlay, you would * specify the following: {@code 7fff0000}, where alpha=0x7f, blue=0xff, green=0x00, * and red=0x00. *

*

* Color values are expressed in hexadecimal notation, including opacity (alpha) values. * The order of expression is alpha, blue, green, red (aabbggrr). The range of values * for any one color is 0 to 255 (00 to ff). For opacity, 00 is fully transparent and * ff is fully opaque. For example, if you want to apply a blue color with 50 percent * opacity to an overlay, you would specify the following: {@code 7fff0000} *

*

* Note: The {@code } element has been deprecated. Use {@code } instead. *

* * * */ @XmlElement(defaultValue = "ffffffff") protected String color; /** * {@code } *

* This element defines the stacking order for the images in overlapping overlays. * Overlays with higher {@code } values are drawn on top of overlays with lower * {@code } values. *

* * * */ @XmlElement(defaultValue = "0") protected int drawOrder; /** * {@code } *

* {@code Sunset.jpg } *

*

* A custom Icon. In {@code }, the only child element of {@code } is {@code : : } * An HTTP address or a local file specification used to load an icon. *

*

* Defines an image associated with an Icon style or overlay. {@code } has the same child * elements as {@code }. The required {@code }child element defines the location of the * image to be used as the overlay or as the icon for the placemark. This location * can either be on a local file system or a remote web server. *

*

* Defines the image associated with the Overlay. The {@code } element defines the location * of the image to be used as the Overlay. This location can be either on a local file * system or on a web server. If this element is omitted or contains no {@code }, a rectangle * is drawn using the color and size defined by the ground or screen overlay. {@code * icon.jpg } *

* * Syntax: *
<Icon id="ID">
     *   <!-- specific to Icon -->
     *   <href>...</href>                      <!-- anyURI -->
     *   <refreshMode>onChange</refreshMode>   
     *     <!-- kml:refreshModeEnum: onChange, onInterval, or onExpire -->   
     *   <refreshInterval>4</refreshInterval>  <!-- float -->
     *   <viewRefreshMode>never</viewRefreshMode> 
     *     <!-- kml:viewRefreshModeEnum: never, onStop, onRequest, onRegion -->
     *   <viewRefreshTime>4</viewRefreshTime>  <!-- float -->
     *   <viewBoundScale>1</viewBoundScale>    <!-- float -->
     *   <viewFormat>...</viewFormat>          <!-- string -->
     *   <httpQuery>...</httpQuery>            <!-- string -->
     *   </Icon>
* * Contained By: * * * * * * */ @XmlElement(name = "Icon") protected Icon icon; @XmlElement(name = "AbstractOverlaySimpleExtensionGroup") @XmlSchemaType(name = "anySimpleType") protected List overlaySimpleExtension; /** * {@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 = "AbstractOverlayObjectExtensionGroup") protected List overlayObjectExtension; public Overlay() { super(); } /** * * * @return * possible object is * {@link String} * */ public String getColor() { return color; } /** * * * @param value * allowed object is * {@link String} * */ public void setColor(String value) { this.color = value; } /** * * * @return * possible object is * {@link Integer} * */ public int getDrawOrder() { return drawOrder; } /** * * * @param value * allowed object is * {@link Integer} * */ public void setDrawOrder(int value) { this.drawOrder = value; } /** * * * @return * possible object is * {@link de.micromata.opengis.kml.v_2_2_0.Link} * */ public Icon getIcon() { return icon; } /** * * * @param value * allowed object is * {@link de.micromata.opengis.kml.v_2_2_0.Link} * */ public void setIcon(Icon value) { this.icon = value; } /** * * */ public List getOverlaySimpleExtension() { if (overlaySimpleExtension == null) { overlaySimpleExtension = new ArrayList(); } return this.overlaySimpleExtension; } /** * * */ public List getOverlayObjectExtension() { if (overlayObjectExtension == null) { overlayObjectExtension = new ArrayList(); } return this.overlayObjectExtension; } @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = ((prime*result)+((color == null)? 0 :color.hashCode())); result = ((prime*result)+ drawOrder); result = ((prime*result)+((icon == null)? 0 :icon.hashCode())); result = ((prime*result)+((overlaySimpleExtension == null)? 0 :overlaySimpleExtension.hashCode())); result = ((prime*result)+((overlayObjectExtension == null)? 0 :overlayObjectExtension.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 Overlay) == false) { return false; } Overlay other = ((Overlay) obj); if (color == null) { if (other.color!= null) { return false; } } else { if (color.equals(other.color) == false) { return false; } } if (drawOrder!= other.drawOrder) { return false; } if (icon == null) { if (other.icon!= null) { return false; } } else { if (icon.equals(other.icon) == false) { return false; } } if (overlaySimpleExtension == null) { if (other.overlaySimpleExtension!= null) { return false; } } else { if (overlaySimpleExtension.equals(other.overlaySimpleExtension) == false) { return false; } } if (overlayObjectExtension == null) { if (other.overlayObjectExtension!= null) { return false; } } else { if (overlayObjectExtension.equals(other.overlayObjectExtension) == false) { return false; } } return true; } /** * Creates a new instance of {@link Icon} and set it to icon. * * This method is a short version for: * {@code * Icon icon = new Icon(); * this.setIcon(icon); } * * */ public Icon createAndSetIcon() { Icon newValue = new Icon(); this.setIcon(newValue); return newValue; } /** * * * @param overlaySimpleExtension * Objects of the following type are allowed in the list: {@link Object} */ public void setOverlaySimpleExtension(final List overlaySimpleExtension) { this.overlaySimpleExtension = overlaySimpleExtension; } /** * add a value to the overlaySimpleExtension property collection * * @param overlaySimpleExtension * Objects of the following type are allowed in the list: {@link Object} * @return * true (as general contract of Collection.add). */ public Overlay addToOverlaySimpleExtension(final Object overlaySimpleExtension) { this.getOverlaySimpleExtension().add(overlaySimpleExtension); return this; } /** * * * @param overlayObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} */ public void setOverlayObjectExtension(final List overlayObjectExtension) { this.overlayObjectExtension = overlayObjectExtension; } /** * add a value to the overlayObjectExtension property collection * * @param overlayObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} * @return * true (as general contract of Collection.add). */ public Overlay addToOverlayObjectExtension(final AbstractObject overlayObjectExtension) { this.getOverlayObjectExtension().add(overlayObjectExtension); return this; } /** * * */ @Obvious @Override public void setObjectSimpleExtension(final List objectSimpleExtension) { super.setObjectSimpleExtension(objectSimpleExtension); } @Obvious @Override public Overlay addToObjectSimpleExtension(final Object objectSimpleExtension) { super.getObjectSimpleExtension().add(objectSimpleExtension); return this; } /** * * */ @Obvious @Override public void setStyleSelector(final List styleSelector) { super.setStyleSelector(styleSelector); } @Obvious @Override public Overlay addToStyleSelector(final StyleSelector styleSelector) { super.getStyleSelector().add(styleSelector); return this; } /** * * */ @Obvious @Override public void setFeatureSimpleExtension(final List featureSimpleExtension) { super.setFeatureSimpleExtension(featureSimpleExtension); } @Obvious @Override public Overlay addToFeatureSimpleExtension(final Object featureSimpleExtension) { super.getFeatureSimpleExtension().add(featureSimpleExtension); return this; } /** * * */ @Obvious @Override public void setFeatureObjectExtension(final List featureObjectExtension) { super.setFeatureObjectExtension(featureObjectExtension); } @Obvious @Override public Overlay addToFeatureObjectExtension(final AbstractObject featureObjectExtension) { super.getFeatureObjectExtension().add(featureObjectExtension); return this; } /** * fluent setter * * * @param color * required parameter */ public Overlay withColor(final String color) { this.setColor(color); return this; } /** * fluent setter * * * @param drawOrder * required parameter */ public Overlay withDrawOrder(final int drawOrder) { this.setDrawOrder(drawOrder); return this; } /** * fluent setter * * * @param icon * required parameter */ public Overlay withIcon(final Icon icon) { this.setIcon(icon); return this; } /** * fluent setter * * * @param overlaySimpleExtension * required parameter */ public Overlay withOverlaySimpleExtension(final List overlaySimpleExtension) { this.setOverlaySimpleExtension(overlaySimpleExtension); return this; } /** * fluent setter * * * @param overlayObjectExtension * required parameter */ public Overlay withOverlayObjectExtension(final List overlayObjectExtension) { this.setOverlayObjectExtension(overlayObjectExtension); return this; } @Obvious @Override public Overlay withObjectSimpleExtension(final List objectSimpleExtension) { super.withObjectSimpleExtension(objectSimpleExtension); return this; } @Obvious @Override public Overlay withId(final String id) { super.withId(id); return this; } @Obvious @Override public Overlay withTargetId(final String targetId) { super.withTargetId(targetId); return this; } @Obvious @Override public Overlay withName(final String name) { super.withName(name); return this; } @Obvious @Override public Overlay withVisibility(final Boolean visibility) { super.withVisibility(visibility); return this; } @Obvious @Override public Overlay withOpen(final Boolean open) { super.withOpen(open); return this; } @Obvious @Override public Overlay withAtomAuthor(final Author atomAuthor) { super.withAtomAuthor(atomAuthor); return this; } @Obvious @Override public Overlay withAtomLink(final de.micromata.opengis.kml.v_2_2_0.atom.Link atomLink) { super.withAtomLink(atomLink); return this; } @Obvious @Override public Overlay withAddress(final String address) { super.withAddress(address); return this; } @Obvious @Override public Overlay withXalAddressDetails(final AddressDetails xalAddressDetails) { super.withXalAddressDetails(xalAddressDetails); return this; } @Obvious @Override public Overlay withPhoneNumber(final String phoneNumber) { super.withPhoneNumber(phoneNumber); return this; } @Obvious @Override public Overlay withSnippet(final Snippet snippet) { super.withSnippet(snippet); return this; } @Obvious @Override public Overlay withSnippetd(final String snippetd) { super.withSnippetd(snippetd); return this; } @Obvious @Override public Overlay withDescription(final String description) { super.withDescription(description); return this; } @Obvious @Override public Overlay withAbstractView(final AbstractView abstractView) { super.withAbstractView(abstractView); return this; } @Obvious @Override public Overlay withTimePrimitive(final TimePrimitive timePrimitive) { super.withTimePrimitive(timePrimitive); return this; } @Obvious @Override public Overlay withStyleUrl(final String styleUrl) { super.withStyleUrl(styleUrl); return this; } @Obvious @Override public Overlay withStyleSelector(final List styleSelector) { super.withStyleSelector(styleSelector); return this; } @Obvious @Override public Overlay withRegion(final Region region) { super.withRegion(region); return this; } @Obvious @Override public Overlay withMetadata(final Metadata metadata) { super.withMetadata(metadata); return this; } @Obvious @Override public Overlay withExtendedData(final ExtendedData extendedData) { super.withExtendedData(extendedData); return this; } @Obvious @Override public Overlay withFeatureSimpleExtension(final List featureSimpleExtension) { super.withFeatureSimpleExtension(featureSimpleExtension); return this; } @Obvious @Override public Overlay withFeatureObjectExtension(final List featureObjectExtension) { super.withFeatureObjectExtension(featureObjectExtension); return this; } @Override public Overlay clone() { Overlay copy; copy = ((Overlay) super.clone()); copy.icon = ((icon == null)?null:((Icon) icon.clone())); copy.overlaySimpleExtension = new ArrayList((getOverlaySimpleExtension().size())); for (Object iter: overlaySimpleExtension) { copy.overlaySimpleExtension.add(iter); } copy.overlayObjectExtension = new ArrayList((getOverlayObjectExtension().size())); for (AbstractObject iter: overlayObjectExtension) { copy.overlayObjectExtension.add(iter.clone()); } return copy; } }