Class KMLScreenImageImpl

    • Field Detail

      • KML_NATIVE_DIMENSION

        protected static final int KML_NATIVE_DIMENSION
        Size value that KML uses to indicate that the native image dimension should be maintained.
        See Also:
        Constant Field Values
      • KML_MAINTAIN_ASPECT_RATIO

        protected static final int KML_MAINTAIN_ASPECT_RATIO
        Size value that KML uses to indicate that the image aspect ration should be maintained.
        See Also:
        Constant Field Values
      • iconRetrievalTime

        protected long iconRetrievalTime
        Indicates the time at which the image source was specified.
    • Constructor Detail

      • KMLScreenImageImpl

        public KMLScreenImageImpl​(KMLTraversalContext tc,
                                  KMLScreenOverlay overlay)
        Create an screen image.
        Parameters:
        tc - the current KMLTraversalContext.
        overlay - the Overlay element containing.
        Throws:
        java.lang.NullPointerException - if the traversal context is null.
        java.lang.IllegalArgumentException - if the parent overlay or the traversal context is null.
    • Method Detail

      • mustResolveHref

        protected boolean mustResolveHref()
        Indicates whether or not the image source needs to be resolved. The source needs to be resolved when the KMLIcon is updated.
        Returns:
        True if the image source must be resolved.
      • resolveHref

        protected java.lang.String resolveHref()
        Resolve the HREF in this overlay's Icon element against the KML root.
        Returns:
        The resolved path to the image source.
      • initializeTexture

        protected BasicWWTexture initializeTexture()
        Create and initialize the texture from the image source. If the image is not in memory this method will request that it be loaded and return null. Overridden to set the link expiration time based on HTTP headers after the image has been retrieved.
        Overrides:
        initializeTexture in class ScreenImage
        Returns:
        The texture, or null if the texture is not yet available.
      • getSizeMode

        protected java.lang.String getSizeMode​(java.lang.Double size)
        Get the size mode for a size parameter. The KML size tag takes a numeric size attribute, but certain values of this attribute change the interpretation of the tag.
        • 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.
        Parameters:
        size - The KML size attribute
        Returns:
        One of Size.NATIVE_DIMENSION, Size.MAINTAIN_ASPECT_RATIO, or Size.EXPLICIT_DIMENSION.