示例#1
0
        protected void doPreRender(KMLTraversalContext tc, DrawContext dc)
        {
            if (this.getRenderable() == null)
            {
                this.initializeRenderable(tc);
            }

            KMLRenderable r = this.getRenderable();

            if (r != null)
            {
                r.preRender(tc, dc);
            }
        }
示例#2
0
        protected void doRender(KMLTraversalContext tc, DrawContext dc)
        {
            // We've already initialized the screen image renderable during the preRender pass. Render the screen image
            // without any further preparation.

            KMLRenderable r = this.getRenderable();

            if (r != null)
            {
                r.render(tc, dc);
            }

            // Render the feature balloon (if any)
            this.renderBalloon(tc, dc);
        }
示例#3
0
        protected bool isFeatureActive(KMLTraversalContext tc, DrawContext dc)
        {
            if (this.getVisibility() != null && !this.getVisibility())
            {
                return(false);
            }

            KMLRegion region = this.getRegion();

            if (region == null)
            {
                region = tc.peekRegion();
            }

            return(region == null || region.isActive(tc, dc));
        }
示例#4
0
        /**
         * Create the renderable that will represent the overlay.
         *
         * @param tc the current KML traversal context.
         */
        protected void initializeRenderable(KMLTraversalContext tc)
        {
            final String altitudeMode = this.getAltitudeMode();

            if ("absolute".Equals(altitudeMode))
            {
                this.renderable = new KMLGroundOverlayPolygonImpl(tc, this);
            }
            else // Default to clampToGround
            {
                // If the overlay has an icon, create a surface image renderable. Otherwise, create a surface polygon to
                // render the overlay as a colored polygon.
                if (this.getIcon() != null && this.getIcon().getHref() != null)
                {
                    this.renderable = new KMLSurfaceImageImpl(tc, this);
                }
                else
                {
                    this.renderable = new KMLSurfacePolygonImpl(tc, this);
                }
            }
        }
示例#5
0
 /**
  * Create the renderable that will represent the overlay.
  *
  * @param tc the current KML traversal context.
  */
 protected void initializeRenderable(KMLTraversalContext tc)
 {
     renderable = new KMLScreenImageImpl(tc, this);
 }