Class KMLPointPlacemarkImpl

    • Field Detail

      • highlightAttributesResolved

        protected boolean highlightAttributesResolved
      • normalAttributesResolved

        protected boolean normalAttributesResolved
      • iconRetrievalTime

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

        protected long highlightIconRetrievalTime
        Indicates the time at which the highlight image source was specified.
      • DEFAULT_LABEL_SCALE_THRESHOLD

        public static final double DEFAULT_LABEL_SCALE_THRESHOLD
        See Also:
        Constant Field Values
      • labelScaleThreshold

        protected double labelScaleThreshold
        Placemark labels with a scale less than this threshold will only be drawn when the placemark is highlighted. This logic supports KML files with many placemarks with small labels, and drawing all the labels would be too cluttered.
    • Constructor Detail

      • KMLPointPlacemarkImpl

        public KMLPointPlacemarkImpl​(KMLTraversalContext tc,
                                     KMLPlacemark placemark,
                                     KMLAbstractGeometry geom)
        Create an instance.
        Parameters:
        tc - the current KMLTraversalContext.
        placemark - the Placemark element containing the Point.
        geom - the KMLPoint geometry.
        Throws:
        java.lang.NullPointerException - if the geometry is null.
        java.lang.IllegalArgumentException - if the parent placemark or the traversal context is null.
    • Method Detail

      • mustRefreshIcon

        protected boolean mustRefreshIcon()
        Indicates whether or not the icon resource has expired.
        Returns:
        True if the icon has expired and must be refreshed.
      • initializeTexture

        protected WWTexture initializeTexture​(java.lang.String address)
        Load a texture. If the texture source is not available locally, this method requests the texture source and returns null. Overridden to set the expiration time of the placemark's icon based on the HTTP headers of the linked resource.
        Overrides:
        initializeTexture in class PointPlacemark
        Parameters:
        address - Path or URL to the image to load into a texture.
        Returns:
        The new texture, or null if the texture could not be created because the resource is not yet available locally.
      • createPickedObject

        protected PickedObject createPickedObject​(DrawContext dc,
                                                  java.awt.Color pickColor)
        Create a PickedObject for this placemark. The PickedObject returned by this method will be added to the pick list to represent the current placemark.
        Overrides:
        createPickedObject in class PointPlacemark
        Parameters:
        dc - Active draw context.
        pickColor - Unique color for this PickedObject.
        Returns:
        A new picked object.
      • mustDrawLabel

        protected boolean mustDrawLabel()
        Draw the label if the label scale is greater than the label scale threshold, if the image scale is zero (only the text is rendered, there is no image), or if the placemark is highlighted.
        Overrides:
        mustDrawLabel in class PointPlacemark
        Returns:
        True if the label must be drawn.
      • makeAttributesCurrent

        protected PointPlacemarkAttributes makeAttributesCurrent​(java.lang.String attrType)
        Determine and set the PointPlacemark attributes from the KML Feature fields.
        Parameters:
        attrType - the type of attributes, either KMLConstants.NORMAL or KMLConstants.HIGHLIGHT.
        Returns:
        The new attributes, or null if there are no attributes defined. Returns a partially empty attributes bundle marked unresolved if any of placemark KML styles are unresolved.
      • getInitialAttributes

        protected PointPlacemarkAttributes getInitialAttributes​(java.lang.String attrType)
        Get the initial attributes for this feature. These attributes will be changed to reflect the feature's style.
        Parameters:
        attrType - KMLConstants.NORMAL or KMLConstants.HIGHLIGHT.
        Returns:
        New placemark attributes.
      • getLabelScaleThreshold

        public double getLabelScaleThreshold()
        Get the label scale threshold. The placemark label will be drawn if the label scale is greater than or equal to this threshold, or if the placemark is highlighted.
        Returns:
        Label scale threshold.
        See Also:
        setLabelScaleThreshold(double)
      • setLabelScaleThreshold

        public void setLabelScaleThreshold​(double labelScaleThreshold)
        Set the label scale threshold. The placemark label will be drawn if the label scale is greater or equal to than this threshold, or if the placemark is highlighted.
        Parameters:
        labelScaleThreshold - New label scale threshold.
        See Also:
        getLabelScaleThreshold()