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

de.micromata.opengis.kml.v_2_2_0.ColorStyle 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 {@code }}
 * 

* This is an abstract element and cannot be used directly in a KML file. It provides * elements for specifying the color and color mode of extended style types. *

* * Syntax: *
<!-- abstract element; do not create -->
 * <!-- ColorStyle id="ID" -->          <!-- IconStyle,LabelStyle,LineStyle,PolyStyle -->
 *   <color>ffffffff</color>            <!-- kml:color -->
 *   <colorMode>normal</colorMode>      <!-- kml:colorModeEnum: normal or random -->
 * <!-- /ColorStyle -->
* * Extends: * * * Extended By: * * * * * * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "AbstractColorStyleType", propOrder = { "color", "colorMode", "colorStyleSimpleExtension", "colorStyleObjectExtension" }) @XmlSeeAlso({ LabelStyle.class, LineStyle.class, PolyStyle.class, IconStyle.class }) public abstract class ColorStyle extends SubStyle 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; /** * ColorMode *

* normal, random *

* * See Also: * See any element that extends {@code } * * * */ @XmlElement(defaultValue = "normal") protected ColorMode colorMode; @XmlElement(name = "AbstractColorStyleSimpleExtensionGroup") @XmlSchemaType(name = "anySimpleType") protected List colorStyleSimpleExtension; /** * {@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 = "AbstractColorStyleObjectExtensionGroup") protected List colorStyleObjectExtension; public ColorStyle() { 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 ColorMode} * */ public ColorMode getColorMode() { return colorMode; } /** * * * @param value * allowed object is * {@link ColorMode} * */ public void setColorMode(ColorMode value) { this.colorMode = value; } /** * * */ public List getColorStyleSimpleExtension() { if (colorStyleSimpleExtension == null) { colorStyleSimpleExtension = new ArrayList(); } return this.colorStyleSimpleExtension; } /** * * */ public List getColorStyleObjectExtension() { if (colorStyleObjectExtension == null) { colorStyleObjectExtension = new ArrayList(); } return this.colorStyleObjectExtension; } @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = ((prime*result)+((color == null)? 0 :color.hashCode())); result = ((prime*result)+((colorMode == null)? 0 :colorMode.hashCode())); result = ((prime*result)+((colorStyleSimpleExtension == null)? 0 :colorStyleSimpleExtension.hashCode())); result = ((prime*result)+((colorStyleObjectExtension == null)? 0 :colorStyleObjectExtension.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 ColorStyle) == false) { return false; } ColorStyle other = ((ColorStyle) obj); if (color == null) { if (other.color!= null) { return false; } } else { if (color.equals(other.color) == false) { return false; } } if (colorMode == null) { if (other.colorMode!= null) { return false; } } else { if (colorMode.equals(other.colorMode) == false) { return false; } } if (colorStyleSimpleExtension == null) { if (other.colorStyleSimpleExtension!= null) { return false; } } else { if (colorStyleSimpleExtension.equals(other.colorStyleSimpleExtension) == false) { return false; } } if (colorStyleObjectExtension == null) { if (other.colorStyleObjectExtension!= null) { return false; } } else { if (colorStyleObjectExtension.equals(other.colorStyleObjectExtension) == false) { return false; } } return true; } /** * * * @param colorStyleSimpleExtension * Objects of the following type are allowed in the list: {@link Object} */ public void setColorStyleSimpleExtension(final List colorStyleSimpleExtension) { this.colorStyleSimpleExtension = colorStyleSimpleExtension; } /** * add a value to the colorStyleSimpleExtension property collection * * @param colorStyleSimpleExtension * Objects of the following type are allowed in the list: {@link Object} * @return * true (as general contract of Collection.add). */ public ColorStyle addToColorStyleSimpleExtension(final Object colorStyleSimpleExtension) { this.getColorStyleSimpleExtension().add(colorStyleSimpleExtension); return this; } /** * * * @param colorStyleObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} */ public void setColorStyleObjectExtension(final List colorStyleObjectExtension) { this.colorStyleObjectExtension = colorStyleObjectExtension; } /** * add a value to the colorStyleObjectExtension property collection * * @param colorStyleObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} * @return * true (as general contract of Collection.add). */ public ColorStyle addToColorStyleObjectExtension(final AbstractObject colorStyleObjectExtension) { this.getColorStyleObjectExtension().add(colorStyleObjectExtension); return this; } /** * * */ @Obvious @Override public void setObjectSimpleExtension(final List objectSimpleExtension) { super.setObjectSimpleExtension(objectSimpleExtension); } @Obvious @Override public ColorStyle addToObjectSimpleExtension(final Object objectSimpleExtension) { super.getObjectSimpleExtension().add(objectSimpleExtension); return this; } /** * * */ @Obvious @Override public void setSubStyleSimpleExtension(final List subStyleSimpleExtension) { super.setSubStyleSimpleExtension(subStyleSimpleExtension); } @Obvious @Override public ColorStyle addToSubStyleSimpleExtension(final Object subStyleSimpleExtension) { super.getSubStyleSimpleExtension().add(subStyleSimpleExtension); return this; } /** * * */ @Obvious @Override public void setSubStyleObjectExtension(final List subStyleObjectExtension) { super.setSubStyleObjectExtension(subStyleObjectExtension); } @Obvious @Override public ColorStyle addToSubStyleObjectExtension(final AbstractObject subStyleObjectExtension) { super.getSubStyleObjectExtension().add(subStyleObjectExtension); return this; } /** * fluent setter * * * @param color * required parameter * @return * ColorStyle */ public ColorStyle withColor(final String color) { this.setColor(color); return this; } /** * fluent setter * * * @param colorMode * required parameter * @return * ColorStyle */ public ColorStyle withColorMode(final ColorMode colorMode) { this.setColorMode(colorMode); return this; } /** * fluent setter * * * @param colorStyleSimpleExtension * required parameter * @return * ColorStyle */ public ColorStyle withColorStyleSimpleExtension(final List colorStyleSimpleExtension) { this.setColorStyleSimpleExtension(colorStyleSimpleExtension); return this; } /** * fluent setter * * * @param colorStyleObjectExtension * required parameter * @return * ColorStyle */ public ColorStyle withColorStyleObjectExtension(final List colorStyleObjectExtension) { this.setColorStyleObjectExtension(colorStyleObjectExtension); return this; } @Obvious @Override public ColorStyle withObjectSimpleExtension(final List objectSimpleExtension) { super.withObjectSimpleExtension(objectSimpleExtension); return this; } @Obvious @Override public ColorStyle withId(final String id) { super.withId(id); return this; } @Obvious @Override public ColorStyle withTargetId(final String targetId) { super.withTargetId(targetId); return this; } @Obvious @Override public ColorStyle withSubStyleSimpleExtension(final List subStyleSimpleExtension) { super.withSubStyleSimpleExtension(subStyleSimpleExtension); return this; } @Obvious @Override public ColorStyle withSubStyleObjectExtension(final List subStyleObjectExtension) { super.withSubStyleObjectExtension(subStyleObjectExtension); return this; } @Override public ColorStyle clone() { ColorStyle copy; copy = ((ColorStyle) super.clone()); copy.colorStyleSimpleExtension = new ArrayList((getColorStyleSimpleExtension().size())); for (Object iter: colorStyleSimpleExtension) { copy.colorStyleSimpleExtension.add(iter); } copy.colorStyleObjectExtension = new ArrayList((getColorStyleObjectExtension().size())); for (AbstractObject iter: colorStyleObjectExtension) { copy.colorStyleObjectExtension.add(iter.clone()); } return copy; } }