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

de.micromata.opengis.kml.v_2_2_0.ScreenOverlay 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.atom.Link;
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 }
 * 

* The {@code }child of {@code }specifies the image to be used as the overlay. This file * 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 screen overlay. *

*

* This element draws an image overlay fixed to the screen. Sample uses for ScreenOverlays * are compasses, logos, and heads-up displays. ScreenOverlay sizing is determined * by the {@code } element. Positioning of the overlay is handled by mapping a point * in the image specified by {@code }to a point on the screen specified by {@code }. * Then the image is rotated by rotation degrees about a point relative to the screen * specified by {@code }. *

* * Syntax: *
<ScreenOverlay 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 --> * * <!-- inherited from Overlay element --> * <color>ffffffff</color> <!-- kml:color --> * <drawOrder>0</drawOrder> <!-- int --> * <Icon>...</Icon> * * <!-- specific to ScreenOverlay --> * <overlayXY x="double" y="double" xunits="fraction" yunits="fraction"/> * <!-- vec2 --> * <!-- xunits and yunits can be one of: fraction, pixels, or insetPixels --> * <screenXY x="double" y="double" xunits="fraction" yunits="fraction"/> * <!-- vec2 --> * <rotationXY x="double" y="double" xunits="fraction" yunits"fraction"/> * <!-- vec2 --> * <size x="double" y="double" xunits="fraction" yunits="fraction"/> * <!-- vec2 --> * <rotation>0</rotation> <!-- float --> * </ScreenOverlay>
*/ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ScreenOverlayType", propOrder = { "overlayXY", "screenXY", "rotationXY", "size", "rotation", "screenOverlaySimpleExtension", "screenOverlayObjectExtension" }) @XmlRootElement(name = "ScreenOverlay", namespace = "http://www.opengis.net/kml/2.2") public class ScreenOverlay extends Overlay implements Cloneable { /** * {@code } *

* Specifies a point on (or outside of) the overlay image that is mapped to the screen * coordinate ({@code }). It requires x and y values, and the units for those values. *

*

* The x and y values can be specified in three different ways: as pixels ("pixels"), * as fractions of the image ("fraction"), or as inset pixels ("insetPixels"), which * is an offset in pixels from the upper right corner of the image. The x and y positions * can be specified in different ways—for example, x can be in pixels and y can be * a fraction. The origin of the coordinate system is in the lower left corner of the * image. x - Either the number of pixels, a fractional component of the image, or * a pixel inset indicating the x component of a point on the overlay image. y - Either * the number of pixels, a fractional component of the image, or a pixel inset indicating * the y component of a point on the overlay image. xunits - Units in which the x value * is specified. A value of "fraction" indicates the x value is a fraction of the image. * A value of "pixels" indicates the x value in pixels. A value of "insetPixels" indicates * the indent from the right edge of the image. yunits - Units in which the y value * is specified. A value of "fraction" indicates the y value is a fraction of the image. * A value of "pixels" indicates the y value in pixels. A value of "insetPixels" indicates * the indent from the top edge of the image. *

* * * */ protected Vec2 overlayXY; /** * {@code } *

* Center the image: *

*

* Center the image: {@code * * Place the image on the top left: {@code } * Place the image at the right of the screen: {@code } } *

*

* For example, {@code } indicates * a point in the middle of the screen. *

*

* Here are some examples: *

*

* Place the image at the right of the screen: *

*

* Place the image on the top left: *

*

* Specifies a point relative to the screen origin that the overlay image is mapped * to. The x and y values can be specified in three different ways: as pixels ("pixels"), * as fractions of the screen ("fraction"), or as inset pixels ("insetPixels"), which * is an offset in pixels from the upper right corner of the screen. The x and y positions * can be specified in different ways—for example, x can be in pixels and y can be * a fraction. The origin of the coordinate system is in the lower left corner of the * screen. x - Either the number of pixels, a fractional component of the screen, or * a pixel inset indicating the x component of a point on the screen. y - Either the * number of pixels, a fractional component of the screen, or a pixel inset indicating * the y component of a point on the screen. xunits - Units in which the x value is * specified. A value of "fraction" indicates the x value is a fraction of the screen. * A value of "pixels" indicates the x value in pixels. A value of "insetPixels" indicates * the indent from the right edge of the screen. yunits - Units in which the y value * is specified. A value of fraction indicates the y value is a fraction of the screen. * A value of "pixels" indicates the y value in pixels. A value of "insetPixels" indicates * the indent from the top edge of the screen. *

* * * */ protected Vec2 screenXY; /** * {@code } *

* Point relative to the screen about which the screen overlay is rotated. *

* * * */ protected Vec2 rotationXY; /** * {@code } *

* For example: *

*

* Specifies the size of the image for the screen overlay, as follows: A value of −1 * indicates to use the native dimension A value of 0 indicates to maintain the aspect * ratio A value of n sets the value of the dimension *

*

* To force the image to resize to 100px by 500px: *

*

* To force the image to retain its horizontal dimension, but to take up 20 percent * of the vertical screen space: *

*

* To force the image to retain its original x and y dimensions, set the values to * −1: *

*

* To force the image to retain its original x and y dimensions, set the values to * −1: {@code } To force the image * to retain its horizontal dimension, but to take up 20 percent of the vertical screen * space: {@code } To force the image * to resize to 100px by 500px: {@code } *

* * * */ protected Vec2 size; /** * rotation *

* Adjusts how the photo is placed inside the field of view. This element is useful * if your photo has been rotated and deviates slightly from a desired horizontal view. *

*

* Indicates the angle of rotation of the parent object. A value of 0 means no rotation. * The value is an angle in degrees counterclockwise starting from north. Use ±180 * to indicate the rotation of the parent object from 0. The center of the rotation, * if not (.5,.5), is specified in {@code }. *

* * * */ @XmlElement(defaultValue = "0.0") protected double rotation; @XmlElement(name = "ScreenOverlaySimpleExtensionGroup") @XmlSchemaType(name = "anySimpleType") protected List screenOverlaySimpleExtension; /** * {@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 = "ScreenOverlayObjectExtensionGroup") protected List screenOverlayObjectExtension; public ScreenOverlay() { super(); } /** * * * @return * possible object is * {@link Vec2} * */ public Vec2 getOverlayXY() { return overlayXY; } /** * * * @param value * allowed object is * {@link Vec2} * */ public void setOverlayXY(Vec2 value) { this.overlayXY = value; } /** * * * @return * possible object is * {@link Vec2} * */ public Vec2 getScreenXY() { return screenXY; } /** * * * @param value * allowed object is * {@link Vec2} * */ public void setScreenXY(Vec2 value) { this.screenXY = value; } /** * * * @return * possible object is * {@link Vec2} * */ public Vec2 getRotationXY() { return rotationXY; } /** * * * @param value * allowed object is * {@link Vec2} * */ public void setRotationXY(Vec2 value) { this.rotationXY = value; } /** * * * @return * possible object is * {@link Vec2} * */ public Vec2 getSize() { return size; } /** * * * @param value * allowed object is * {@link Vec2} * */ public void setSize(Vec2 value) { this.size = value; } /** * * * @return * possible object is * {@link Double} * */ public double getRotation() { return rotation; } /** * * * @param value * allowed object is * {@link Double} * */ public void setRotation(double value) { this.rotation = value; } /** * * */ public List getScreenOverlaySimpleExtension() { if (screenOverlaySimpleExtension == null) { screenOverlaySimpleExtension = new ArrayList(); } return this.screenOverlaySimpleExtension; } /** * * */ public List getScreenOverlayObjectExtension() { if (screenOverlayObjectExtension == null) { screenOverlayObjectExtension = new ArrayList(); } return this.screenOverlayObjectExtension; } @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); long temp; result = ((prime*result)+((overlayXY == null)? 0 :overlayXY.hashCode())); result = ((prime*result)+((screenXY == null)? 0 :screenXY.hashCode())); result = ((prime*result)+((rotationXY == null)? 0 :rotationXY.hashCode())); result = ((prime*result)+((size == null)? 0 :size.hashCode())); temp = Double.doubleToLongBits(rotation); result = ((prime*result)+((int)(temp^(temp >>>(32))))); result = ((prime*result)+((screenOverlaySimpleExtension == null)? 0 :screenOverlaySimpleExtension.hashCode())); result = ((prime*result)+((screenOverlayObjectExtension == null)? 0 :screenOverlayObjectExtension.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 ScreenOverlay) == false) { return false; } ScreenOverlay other = ((ScreenOverlay) obj); if (overlayXY == null) { if (other.overlayXY!= null) { return false; } } else { if (overlayXY.equals(other.overlayXY) == false) { return false; } } if (screenXY == null) { if (other.screenXY!= null) { return false; } } else { if (screenXY.equals(other.screenXY) == false) { return false; } } if (rotationXY == null) { if (other.rotationXY!= null) { return false; } } else { if (rotationXY.equals(other.rotationXY) == false) { return false; } } if (size == null) { if (other.size!= null) { return false; } } else { if (size.equals(other.size) == false) { return false; } } if (rotation!= other.rotation) { return false; } if (screenOverlaySimpleExtension == null) { if (other.screenOverlaySimpleExtension!= null) { return false; } } else { if (screenOverlaySimpleExtension.equals(other.screenOverlaySimpleExtension) == false) { return false; } } if (screenOverlayObjectExtension == null) { if (other.screenOverlayObjectExtension!= null) { return false; } } else { if (screenOverlayObjectExtension.equals(other.screenOverlayObjectExtension) == false) { return false; } } return true; } /** * Creates a new instance of {@link Vec2} and set it to overlayXY. * * This method is a short version for: * {@code * Vec2 vec2 = new Vec2(); * this.setOverlayXY(vec2); } * * */ public Vec2 createAndSetOverlayXY() { Vec2 newValue = new Vec2(); this.setOverlayXY(newValue); return newValue; } /** * Creates a new instance of {@link Vec2} and set it to screenXY. * * This method is a short version for: * {@code * Vec2 vec2 = new Vec2(); * this.setScreenXY(vec2); } * * */ public Vec2 createAndSetScreenXY() { Vec2 newValue = new Vec2(); this.setScreenXY(newValue); return newValue; } /** * Creates a new instance of {@link Vec2} and set it to rotationXY. * * This method is a short version for: * {@code * Vec2 vec2 = new Vec2(); * this.setRotationXY(vec2); } * * */ public Vec2 createAndSetRotationXY() { Vec2 newValue = new Vec2(); this.setRotationXY(newValue); return newValue; } /** * Creates a new instance of {@link Vec2} and set it to size. * * This method is a short version for: * {@code * Vec2 vec2 = new Vec2(); * this.setSize(vec2); } * * */ public Vec2 createAndSetSize() { Vec2 newValue = new Vec2(); this.setSize(newValue); return newValue; } /** * * * @param screenOverlaySimpleExtension * Objects of the following type are allowed in the list: {@link Object} */ public void setScreenOverlaySimpleExtension(final List screenOverlaySimpleExtension) { this.screenOverlaySimpleExtension = screenOverlaySimpleExtension; } /** * add a value to the screenOverlaySimpleExtension property collection * * @param screenOverlaySimpleExtension * Objects of the following type are allowed in the list: {@link Object} * @return * true (as general contract of Collection.add). */ public ScreenOverlay addToScreenOverlaySimpleExtension(final Object screenOverlaySimpleExtension) { this.getScreenOverlaySimpleExtension().add(screenOverlaySimpleExtension); return this; } /** * * * @param screenOverlayObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} */ public void setScreenOverlayObjectExtension(final List screenOverlayObjectExtension) { this.screenOverlayObjectExtension = screenOverlayObjectExtension; } /** * add a value to the screenOverlayObjectExtension property collection * * @param screenOverlayObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} * @return * true (as general contract of Collection.add). */ public ScreenOverlay addToScreenOverlayObjectExtension(final AbstractObject screenOverlayObjectExtension) { this.getScreenOverlayObjectExtension().add(screenOverlayObjectExtension); return this; } /** * * */ @Obvious @Override public void setObjectSimpleExtension(final List objectSimpleExtension) { super.setObjectSimpleExtension(objectSimpleExtension); } @Obvious @Override public ScreenOverlay addToObjectSimpleExtension(final Object objectSimpleExtension) { super.getObjectSimpleExtension().add(objectSimpleExtension); return this; } /** * * */ @Obvious @Override public void setStyleSelector(final List styleSelector) { super.setStyleSelector(styleSelector); } @Obvious @Override public ScreenOverlay addToStyleSelector(final StyleSelector styleSelector) { super.getStyleSelector().add(styleSelector); return this; } /** * * */ @Obvious @Override public void setFeatureSimpleExtension(final List featureSimpleExtension) { super.setFeatureSimpleExtension(featureSimpleExtension); } @Obvious @Override public ScreenOverlay addToFeatureSimpleExtension(final Object featureSimpleExtension) { super.getFeatureSimpleExtension().add(featureSimpleExtension); return this; } /** * * */ @Obvious @Override public void setFeatureObjectExtension(final List featureObjectExtension) { super.setFeatureObjectExtension(featureObjectExtension); } @Obvious @Override public ScreenOverlay addToFeatureObjectExtension(final AbstractObject featureObjectExtension) { super.getFeatureObjectExtension().add(featureObjectExtension); return this; } /** * * */ @Obvious @Override public void setOverlaySimpleExtension(final List overlaySimpleExtension) { super.setOverlaySimpleExtension(overlaySimpleExtension); } @Obvious @Override public ScreenOverlay addToOverlaySimpleExtension(final Object overlaySimpleExtension) { super.getOverlaySimpleExtension().add(overlaySimpleExtension); return this; } /** * * */ @Obvious @Override public void setOverlayObjectExtension(final List overlayObjectExtension) { super.setOverlayObjectExtension(overlayObjectExtension); } @Obvious @Override public ScreenOverlay addToOverlayObjectExtension(final AbstractObject overlayObjectExtension) { super.getOverlayObjectExtension().add(overlayObjectExtension); return this; } /** * fluent setter * * * @param overlayXY * required parameter */ public ScreenOverlay withOverlayXY(final Vec2 overlayXY) { this.setOverlayXY(overlayXY); return this; } /** * fluent setter * * * @param screenXY * required parameter */ public ScreenOverlay withScreenXY(final Vec2 screenXY) { this.setScreenXY(screenXY); return this; } /** * fluent setter * * * @param rotationXY * required parameter */ public ScreenOverlay withRotationXY(final Vec2 rotationXY) { this.setRotationXY(rotationXY); return this; } /** * fluent setter * * * @param size * required parameter */ public ScreenOverlay withSize(final Vec2 size) { this.setSize(size); return this; } /** * fluent setter * * * @param rotation * required parameter */ public ScreenOverlay withRotation(final double rotation) { this.setRotation(rotation); return this; } /** * fluent setter * * * @param screenOverlaySimpleExtension * required parameter */ public ScreenOverlay withScreenOverlaySimpleExtension(final List screenOverlaySimpleExtension) { this.setScreenOverlaySimpleExtension(screenOverlaySimpleExtension); return this; } /** * fluent setter * * * @param screenOverlayObjectExtension * required parameter */ public ScreenOverlay withScreenOverlayObjectExtension(final List screenOverlayObjectExtension) { this.setScreenOverlayObjectExtension(screenOverlayObjectExtension); return this; } @Obvious @Override public ScreenOverlay withObjectSimpleExtension(final List objectSimpleExtension) { super.withObjectSimpleExtension(objectSimpleExtension); return this; } @Obvious @Override public ScreenOverlay withId(final String id) { super.withId(id); return this; } @Obvious @Override public ScreenOverlay withTargetId(final String targetId) { super.withTargetId(targetId); return this; } @Obvious @Override public ScreenOverlay withName(final String name) { super.withName(name); return this; } @Obvious @Override public ScreenOverlay withVisibility(final Boolean visibility) { super.withVisibility(visibility); return this; } @Obvious @Override public ScreenOverlay withOpen(final Boolean open) { super.withOpen(open); return this; } @Obvious @Override public ScreenOverlay withAtomAuthor(final Author atomAuthor) { super.withAtomAuthor(atomAuthor); return this; } @Obvious @Override public ScreenOverlay withAtomLink(final Link atomLink) { super.withAtomLink(atomLink); return this; } @Obvious @Override public ScreenOverlay withAddress(final String address) { super.withAddress(address); return this; } @Obvious @Override public ScreenOverlay withXalAddressDetails(final AddressDetails xalAddressDetails) { super.withXalAddressDetails(xalAddressDetails); return this; } @Obvious @Override public ScreenOverlay withPhoneNumber(final String phoneNumber) { super.withPhoneNumber(phoneNumber); return this; } @Obvious @Override public ScreenOverlay withSnippet(final Snippet snippet) { super.withSnippet(snippet); return this; } @Obvious @Override public ScreenOverlay withSnippetd(final String snippetd) { super.withSnippetd(snippetd); return this; } @Obvious @Override public ScreenOverlay withDescription(final String description) { super.withDescription(description); return this; } @Obvious @Override public ScreenOverlay withAbstractView(final AbstractView abstractView) { super.withAbstractView(abstractView); return this; } @Obvious @Override public ScreenOverlay withTimePrimitive(final TimePrimitive timePrimitive) { super.withTimePrimitive(timePrimitive); return this; } @Obvious @Override public ScreenOverlay withStyleUrl(final String styleUrl) { super.withStyleUrl(styleUrl); return this; } @Obvious @Override public ScreenOverlay withStyleSelector(final List styleSelector) { super.withStyleSelector(styleSelector); return this; } @Obvious @Override public ScreenOverlay withRegion(final Region region) { super.withRegion(region); return this; } @Obvious @Override public ScreenOverlay withMetadata(final Metadata metadata) { super.withMetadata(metadata); return this; } @Obvious @Override public ScreenOverlay withExtendedData(final ExtendedData extendedData) { super.withExtendedData(extendedData); return this; } @Obvious @Override public ScreenOverlay withFeatureSimpleExtension(final List featureSimpleExtension) { super.withFeatureSimpleExtension(featureSimpleExtension); return this; } @Obvious @Override public ScreenOverlay withFeatureObjectExtension(final List featureObjectExtension) { super.withFeatureObjectExtension(featureObjectExtension); return this; } @Obvious @Override public ScreenOverlay withColor(final String color) { super.withColor(color); return this; } @Obvious @Override public ScreenOverlay withDrawOrder(final int drawOrder) { super.withDrawOrder(drawOrder); return this; } @Obvious @Override public ScreenOverlay withIcon(final Icon icon) { super.withIcon(icon); return this; } @Obvious @Override public ScreenOverlay withOverlaySimpleExtension(final List overlaySimpleExtension) { super.withOverlaySimpleExtension(overlaySimpleExtension); return this; } @Obvious @Override public ScreenOverlay withOverlayObjectExtension(final List overlayObjectExtension) { super.withOverlayObjectExtension(overlayObjectExtension); return this; } @Override public ScreenOverlay clone() { ScreenOverlay copy; copy = ((ScreenOverlay) super.clone()); copy.overlayXY = ((overlayXY == null)?null:((Vec2) overlayXY.clone())); copy.screenXY = ((screenXY == null)?null:((Vec2) screenXY.clone())); copy.rotationXY = ((rotationXY == null)?null:((Vec2) rotationXY.clone())); copy.size = ((size == null)?null:((Vec2) size.clone())); copy.screenOverlaySimpleExtension = new ArrayList((getScreenOverlaySimpleExtension().size())); for (Object iter: screenOverlaySimpleExtension) { copy.screenOverlaySimpleExtension.add(iter); } copy.screenOverlayObjectExtension = new ArrayList((getScreenOverlayObjectExtension().size())); for (AbstractObject iter: screenOverlayObjectExtension) { copy.screenOverlayObjectExtension.add(iter.clone()); } return copy; } }