Class KMLAbstractContainer

    • Constructor Detail

      • KMLAbstractContainer

        protected KMLAbstractContainer​(java.lang.String namespaceURI)
        Construct an instance.
        Parameters:
        namespaceURI - the qualifying namespace URI. May be null to indicate no namespace qualification.
    • Method Detail

      • doAddEventContent

        protected void doAddEventContent​(java.lang.Object o,
                                         XMLEventParserContext ctx,
                                         javax.xml.stream.events.XMLEvent event,
                                         java.lang.Object... args)
                                  throws javax.xml.stream.XMLStreamException
        Overrides:
        doAddEventContent in class KMLAbstractFeature
        Throws:
        javax.xml.stream.XMLStreamException
      • isFeatureActive

        protected boolean isFeatureActive​(KMLTraversalContext tc,
                                          DrawContext dc)
        Indicates whether this KMLAbstractContainer is active and should be rendered on the specified DrawContext. This returns true if this container's visibility is unspecified (null) or is set to true.

        Regions do not apply directly to KML containers, because a descendant features can override the container's Region with its own. Since a descendant Region may be larger or have a less restrictive LOD range than this container, we cannot determine the visibility of the entire tree based on this container's Region. A container's Region is inherited by any descendants that do not specify a Region, and Region visibility is determined at the leaf nodes.

        Overrides:
        isFeatureActive in class KMLAbstractFeature
        Parameters:
        tc - the current KML traversal context. This parameter is ignored.
        dc - the draw context. This parameter is ignored.
        Returns:
        true if this container should be rendered, otherwise false.
      • doPreRender

        protected void doPreRender​(KMLTraversalContext tc,
                                   DrawContext dc)
        Pre-renders the KML features held by this KMLAbstractContainer.

        Pushes this container's Region on the KML traversal context's region stack before rendering the features, and pops the Region off the stack afterward. Descendant features use the KML traversal context's region stack to inherit Regions from parent containers.

        Overrides:
        doPreRender in class KMLAbstractFeature
        Parameters:
        tc - the current KML traversal context.
        dc - the current draw context.
      • doRender

        protected void doRender​(KMLTraversalContext tc,
                                DrawContext dc)
        Renders the KML features held by this KMLAbstractContainer.

        Pushes this container's Region on the KML traversal context's region stack before rendering the features, and pops the Region off the stack afterward. Descendant features use the KML traversal context's region stack to inherit Regions from parent containers.

        Overrides:
        doRender in class KMLAbstractFeature
        Parameters:
        tc - the current KML traversal context.
        dc - the current draw context.
      • beginRendering

        protected void beginRendering​(KMLTraversalContext tc,
                                      DrawContext dc)
        Prepares this KML container for rendering. This pushes this container's Region on the KML traversal context's region stack. Descendant features use the KML traversal context's region stack to inherit Regions from parent containers. This must be followed by a call to endRendering.
        Parameters:
        tc - the current KML traversal context.
        dc - the current draw context.
      • endRendering

        protected void endRendering​(KMLTraversalContext tc,
                                    DrawContext dc)
        Restores any rendering state changed during rendering. This pops this container's Region off the KML traversal context's region stack to restore the previous container's Region (if any). This must be preceded by a call to beginRendering.
        Parameters:
        tc - the current KML traversal context.
        dc - the current draw context.
      • preRenderFeatures

        protected void preRenderFeatures​(KMLTraversalContext tc,
                                         DrawContext dc)
        PreRenders this KML container's list of KML features, in the order they appear in the list. This does nothing if the list of features is empty.
        Parameters:
        tc - the current KML traversal context.
        dc - the current draw context.
      • renderFeatures

        protected void renderFeatures​(KMLTraversalContext tc,
                                      DrawContext dc)
        Draws this KML container's list of KML features, in the order they appear in the list. This does nothing if the list of features is empty.
        Parameters:
        tc - the current KML traversal context.
        dc - the current draw context.
      • mergeFeatures

        protected void mergeFeatures​(KMLAbstractContainer sourceContainer)
        Merge a list of incoming features with the current list. If an incoming feature has the same ID as an existing one, replace the existing one, otherwise add the incoming one.
        Parameters:
        sourceContainer - the incoming container of features.