Exemple #1
0
        /**
         * Indicates whether or not the image source needs to be resolved. The source needs to be resolved when the KMLIcon
         * is updated.
         *
         * @return True if the image source must be resolved.
         */
        protected bool mustResolveHref()
        {
            KMLIcon icon = this.parent.getIcon();

            //noinspection SimplifiableIfStatement
            if (icon == null || icon.getHref() == null)
            {
                return(false);
            }

            // Resolve the reference if the image hasn't been retrieved, or if the link has expired.
            return(this.getImageSource() == null || icon.getUpdateTime() > this.iconRetrievalTime);
        }
Exemple #2
0
        /**
         * Indicates whether or not the icon resource has expired.
         *
         * @return True if the icon has expired and must be refreshed.
         */
        protected bool mustRefreshIcon()
        {
            String mode;
            long   retrievalTime;

            if (this.isHighlighted())
            {
                mode          = KMLConstants.HIGHLIGHT;
                retrievalTime = this.highlightIconRetrievalTime;
            }
            else
            {
                mode          = KMLConstants.NORMAL;
                retrievalTime = this.iconRetrievalTime;
            }

            KMLIconStyle iconStyle = (KMLIconStyle)this.parent.getSubStyle(new KMLIconStyle(null), mode);
            KMLIcon      icon      = iconStyle.getIcon();

            return(icon != null && icon.getUpdateTime() > retrievalTime);
        }