Class KMLAbstractStyleSelector

    • Constructor Detail

      • KMLAbstractStyleSelector

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

      • mergeSubStyles

        public static KMLAbstractSubStyle mergeSubStyles​(KMLStyleUrl styleUrl,
                                                         java.util.List<KMLAbstractStyleSelector> styleSelectors,
                                                         java.lang.String styleState,
                                                         KMLAbstractSubStyle subStyle)
        Obtains the selector's effective style for a specified style type (IconStyle, ListStyle, etc.) and state (normal or highlight). The returned style is the result of merging values from the specified style selectors and style URL, with precedence given to style selectors.

        Remote styleUrls that have not yet been resolved are not included in the result. In this case the returned sub-style is marked with a field named AVKey.UNRESOLVED. The same is true when a StyleMap refers to a Style other than one internal to the KML document.

        Parameters:
        styleUrl - an applicable style URL. May be null.
        styleSelectors - a list of KMLAbstractStyleSelectors to consider when determining the effective attributes. May be null, in which case only the specified styleUrl is considered.
        styleState - the style mode, either \"normal\" or \"highlight\".
        subStyle - an instance of the KMLAbstractSubStyle class desired, such as KMLIconStyle. The effective style values are accumulated and merged into this instance. The instance should not be one from within the KML document because its values may be overridden and augmented. The instance specified is the return value of this method.
        Returns:
        the sub-style values for the specified type and state. The reference returned is the same one passed in as the subStyle argument.
        Throws:
        java.lang.IllegalArgumentException - if the sub-style parameter is null.
      • mergeSubStyles

        public static KMLAbstractSubStyle mergeSubStyles​(KMLStyleUrl styleUrl,
                                                         KMLAbstractStyleSelector styleSelector,
                                                         java.lang.String styleState,
                                                         KMLAbstractSubStyle subStyle)
        Obtains the selector's effective style for a specified style type (IconStyle, ListStyle, etc.) and state (normal or highlight). The returned style is the result of merging values from the specified style selector and style URL, with precedence given to style selector.

        Remote styleUrls that have not yet been resolved are not included in the result. In this case the returned sub-style is marked with the value AVKey.UNRESOLVED.

        Parameters:
        styleUrl - an applicable style URL. May be null.
        styleSelector - the KMLAbstractStyleSelector to consider when determining the effective attributes. May be null, in which case only the specified styleUrl is considered.
        styleState - the style mode, either \"normal\" or \"highlight\".
        subStyle - an instance of the KMLAbstractSubStyle class desired, such as KMLIconStyle. The effective style values are accumulated and merged into this instance. The instance should not be one from within the KML document because its values may be overridden and augmented. The instance specified is the return value of this method.
        Returns:
        the sub-style values for the specified type and state. The reference returned is the same one passed in as the subStyle parameter.
        Throws:
        java.lang.IllegalArgumentException - if the sub-style parameter is null.
      • markUnresolved

        protected static void markUnresolved​(boolean tf,
                                             KMLAbstractSubStyle subStyle)
        Marks a sub-style to indicate that a style URL associated with it has not yet been resolved, or removes the mark if the style URL has been resolved.
        Parameters:
        tf - true to indicate an unresolved style URL, otherwise false.
        subStyle - the sub-style to mark.