public void preRender(KMLTraversalContext tc, DrawContext dc)
        {
            // If the attributes are not inline or internal then they might not be resolved until the external KML
            // document is resolved. Therefore check to see if resolution has occurred.

            if (this.isHighlighted())
            {
                if (!this.highlightAttributesResolved)
                {
                    ShapeAttributes a = this.getHighlightAttributes();
                    if (a == null || a.isUnresolved())
                    {
                        a = this.makeAttributesCurrent(KMLConstants.HIGHLIGHT);
                        if (a != null)
                        {
                            this.setHighlightAttributes(a);
                            if (!a.isUnresolved())
                            {
                                this.highlightAttributesResolved = true;
                            }
                        }
                    }
                }
            }
            else
            {
                if (!this.normalAttributesResolved)
                {
                    ShapeAttributes a = this.getAttributes();
                    if (a == null || a.isUnresolved())
                    {
                        a = this.makeAttributesCurrent(KMLConstants.NORMAL);
                        if (a != null)
                        {
                            this.setAttributes(a);
                            if (!a.isUnresolved())
                            {
                                this.normalAttributesResolved = true;
                            }
                        }
                    }
                }
            }

            // Apply rotation the first time the polygon is rendered. This feature only applies to ground overlays with
            // position specified using a rotated LatLon box.
            if (this.mustApplyRotation)
            {
                this.applyRotation(dc);
                this.mustApplyRotation = false;
            }

            this.preRender(dc);
        }
Exemplo n.º 2
0
        public void render(KMLTraversalContext tc, DrawContext dc)
        {
            // If the attributes are not inline or internal then they might not be resolved until the external KML
            // document is resolved. Therefore check to see if resolution has occurred.

            if (this.isHighlighted())
            {
                if (!this.highlightAttributesResolved)
                {
                    ShapeAttributes a = this.getCapHighlightAttributes();
                    if (a == null || a.isUnresolved())
                    {
                        a = this.makeAttributesCurrent(KMLConstants.HIGHLIGHT);
                        if (a != null)
                        {
                            this.setCapHighlightAttributes(a);
                            this.setSideHighlightAttributes(a);
                            if (!a.isUnresolved())
                            {
                                this.highlightAttributesResolved = true;
                            }
                        }
                    }
                }
            }
            else
            {
                if (!this.normalAttributesResolved)
                {
                    ShapeAttributes a = this.getCapAttributes();
                    if (a == null || a.isUnresolved())
                    {
                        a = this.makeAttributesCurrent(KMLConstants.NORMAL);
                        if (a != null)
                        {
                            this.setCapAttributes(a);
                            this.setSideAttributes(a);
                            if (!a.isUnresolved())
                            {
                                this.normalAttributesResolved = true;
                            }
                        }
                    }
                }
            }

            this.render(dc);
        }