Class WmsSublayer

  • All Implemented Interfaces:
    LayerContent

    public final class WmsSublayer
    extends Object
    implements LayerContent
    Represents a sublayer of a WmsLayer, providing data necessary for building a Table of Contents. Only named WMS sublayers have an associated WmsSublayer. A list of WmsSublayers can be obtained by calling WmsLayer.getSublayers() on a loaded WmsLayer.
    Since:
    100.2.0
    See Also:
    WmsLayer
    • Method Detail

      • setCurrentStyle

        public void setCurrentStyle​(String styleName)
        Sets the name of the style for this sublayer to use.
        Parameters:
        styleName - the name of the style to use, or an empty string to use the default style
        Throws:
        IllegalArgumentException - if styleName is null
        Since:
        100.3.0
      • getCurrentStyle

        public String getCurrentStyle()
        Gets the name of the current style of this sublayer.
        Returns:
        the name of the current style; an empty string indicates the default style is being used
        Since:
        100.2.0
      • getSublayerInfo

        public WmsLayerInfo getSublayerInfo()
        Gets metadata for this sublayer.
        Returns:
        the metadata
        Since:
        100.2.0
      • canChangeVisibility

        public boolean canChangeVisibility()
        Description copied from interface: LayerContent
        Returns whether or not we can change the visibility of this layer.
        Specified by:
        canChangeVisibility in interface LayerContent
        Returns:
        true if we can change this layer's visibility, false otherwise
      • isVisible

        public boolean isVisible()
        Description copied from interface: LayerContent
        Returns whether this layer is visible or not.
        Specified by:
        isVisible in interface LayerContent
        Returns:
        true if the layer is visible, false otherwise
      • isVisibleAtScale

        public boolean isVisibleAtScale​(double scale)
        Description copied from interface: LayerContent
        Returns whether or not this layer will be visible at the given scale.
        Specified by:
        isVisibleAtScale in interface LayerContent
        Parameters:
        scale - will the layer be visible at this scale?
        Returns:
        true if the layer will be visible at the given scale, false otherwise
      • getName

        public String getName()
        Description copied from interface: LayerContent
        Gets the name of this layer.
        Specified by:
        getName in interface LayerContent
        Returns:
        name of this layer
      • canShowInLegend

        public boolean canShowInLegend()
        Description copied from interface: LayerContent
        Returns whether or not this layer will be listed in the legend.
        Specified by:
        canShowInLegend in interface LayerContent
        Returns:
        true if this layer will be visible in the legend, false otherwise
      • setCanShowInLegend

        public void setCanShowInLegend​(boolean canShowInLegend)
        Description copied from interface: LayerContent
        Sets whether or not this layer should be visible in the legend.
        Specified by:
        setCanShowInLegend in interface LayerContent
        Parameters:
        canShowInLegend - true to show in the legend, false to omit it from the legend
      • getSubLayerContents

        public ListenableList<LayerContent> getSubLayerContents()
        Description copied from interface: LayerContent
        Returns a list of sub layers, if any. If there are no sub-layers, an empty list will be returned. This list cannot be used to add or remove sub-layers.
        Specified by:
        getSubLayerContents in interface LayerContent
        Returns:
        a read only list of sub-layers, if any