gov.nasa.worldwind.ogc.kml
Class KMLStyleMap
java.lang.Object
gov.nasa.worldwind.util.xml.AbstractXMLEventParser
gov.nasa.worldwind.ogc.kml.KMLAbstractObject
gov.nasa.worldwind.ogc.kml.KMLAbstractStyleSelector
gov.nasa.worldwind.ogc.kml.KMLStyleMap
- All Implemented Interfaces:
- MessageListener, XMLEventParser
public class KMLStyleMap
- extends KMLAbstractStyleSelector
Represents the KML StyleMap element and provides access to its contents.
| Methods inherited from class gov.nasa.worldwind.util.xml.AbstractXMLEventParser |
allocate, doAddCharacters, doAddEventAttribute, doParseEventAttributes, doParseEventContent, freeResources, getAConstructor, getCharacters, getField, getField, getFields, getNamespaceURI, getParent, hasField, hasField, hasFields, mergeFields, newInstance, overrideFields, parse, parseCharacterContent, removeField, setField, setField, setFields, setParent |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
pairs
protected List<KMLPair> pairs
KMLStyleMap
public KMLStyleMap(String namespaceURI)
- Construct an instance.
- Parameters:
namespaceURI - the qualifying namespace URI. May be null to indicate no namespace qualification.
addPair
protected void addPair(KMLPair pair)
applyChange
public void applyChange(KMLAbstractObject sourceValues)
- Overrides:
applyChange in class KMLAbstractObject
doAddEventContent
protected void doAddEventContent(Object o,
XMLEventParserContext ctx,
XMLEvent event,
Object... args)
throws XMLStreamException
- Overrides:
doAddEventContent in class AbstractXMLEventParser
- Throws:
XMLStreamException
getPairs
public List<KMLPair> getPairs()
getStyleFromMap
public KMLAbstractStyleSelector getStyleFromMap(String styleState)
- Returns a specified style from the style map.
- Parameters:
styleState - the style key, either KMLConstants.NORMAL or KMLConstants.HIGHLIGHT. If null,
KMLConstants.NORMAL is used.
- Returns:
- the requested style, or null if it does not exist in the map.
getStyleUrlFromMap
public KMLStyleUrl getStyleUrlFromMap(String styleState)
- Returns a specified style URL from the style map.
- Parameters:
styleState - the style key, either KMLConstants.NORMAL or KMLConstants.HIGHLIGHT. If null,
KMLConstants.NORMAL is used.
- Returns:
- the requested style URL, or null if it does not exist in the map.
mergePairs
protected void mergePairs(KMLStyleMap sourceMap)
- Merge a list of incoming pairs with the current list. If an incoming pair has the same ID as an
existing one, replace the existing one, otherwise just add the incoming one.
- Parameters:
sourceMap - the incoming pairs.
mergeSubStyles
public KMLAbstractSubStyle mergeSubStyles(KMLAbstractSubStyle subStyle,
String styleState)
- Obtains the map's effective style for a specified style type (IconStyle, ListStyle, etc.) and state
(normal or highlight). The returned style is the result of merging values from the map's style
selectors and style URL for the indicated sub-style type, with precedence given to style selectors.
Remote styleUrls that have not yet been resolved are not included in the result. In this case the returned
sub-style is marked with the value
AVKey.UNRESOLVED.
- Parameters:
styleState - the style mode, either \"normal\" or \"highlight\".subStyle - an instance of the KMLAbstractSubStyle class desired, such
as KMLIconStyle. The effective style values are accumulated
and merged into this instance. The instance should not be one from within the KML document
because its values may be overridden and augmented. The instance specified is the return value
of this method.
- Returns:
- the sub-style values for the specified type and state. The reference returned is the same one passed in
as the
subStyle argument.