Class ClassBreaksRenderer

  • All Implemented Interfaces:
    JsonSerializable

    public final class ClassBreaksRenderer
    extends Renderer
    Defines a class breaks renderer which symbolizes each feature based on the value of some numeric field.

    Each class break for this renderer is defined by an instance of ClassBreaksRenderer.ClassBreak. The class breaks can be added to and removed from this renderer via the list returned by getClassBreaks(). This class contains properties for setting the field that the class breaks refer to and also for controlling normalization.

    Class breaks can be defined as continuous, where the minimum value of a break is defined by the maximum value of the previous class break. For continuous class breaks only the max value needs to be set on each ClassBreak instance.

    For discontinuous class breaks, set both a min and max value in each ClassBreak instance. The renderer also defines a default label and symbol to display for values that don't fall within any of the class breaks.

    Since:
    100.0.0
    See Also:
    ClassBreaksRenderer.ClassBreak, Renderer
    • Constructor Detail

      • ClassBreaksRenderer

        public ClassBreaksRenderer()
        Creates a new empty class breaks renderer.
        Since:
        100.0.0
      • ClassBreaksRenderer

        public ClassBreaksRenderer​(java.lang.String fieldName,
                                   java.lang.Iterable<ClassBreaksRenderer.ClassBreak> classBreaks)
        Creates a new class breaks renderer with the given ClassBreaks applied to the given field.
        Parameters:
        fieldName - the field name that the class breaks apply to
        classBreaks - the class breaks to apply to the given field
        Since:
        100.0.0
    • Method Detail

      • getBackgroundFillSymbol

        public Symbol getBackgroundFillSymbol()
        Gets the renderer's background fill symbol which is a SimpleFillSymbol.
        Returns:
        background fill symbol
        Since:
        100.4.0
      • setBackgroundFillSymbol

        public void setBackgroundFillSymbol​(Symbol backgroundFillSymbol)
        Sets the renderer's background fill symbol which must be a SimpleFillSymbol.
        Parameters:
        backgroundFillSymbol - the background fill symbol
        Throws:
        java.lang.IllegalArgumentException - if backgroundFillSymbol is null
        ArcGISRuntimeException - if backgroundFillSymbol is not a SimpleFillSymbol
        Since:
        100.4.0
      • getClassBreaks

        public java.util.List<ClassBreaksRenderer.ClassBreak> getClassBreaks()
        Gets the list of class breaks.

        Changes to this list will be reflected in the renderer instance. As the returned list is a ListenableList any listener registered with the list will be notified whenever a ClassBreak is added or removed. Note that each call to this method will return the same ListenableList instance.

        Returns:
        the class breaks list
        Since:
        100.0.0
      • getDefaultLabel

        public java.lang.String getDefaultLabel()
        Gets the default label, suitable for showing in a legend, for values that don't fall within any of the class breaks.
        Returns:
        the default label. If no default label was set, this returns null.
        Since:
        100.0.0
      • setDefaultLabel

        public void setDefaultLabel​(java.lang.String defaultLabel)
        Sets the default label, suitable for showing in a legend, for values that don't fall within any of the class breaks.
        Parameters:
        defaultLabel - the new default label
        Since:
        100.0.0
      • getDefaultSymbol

        public Symbol getDefaultSymbol()
        Gets the default symbol for values that don't fall within any of the class breaks.
        Returns:
        the default symbol. If no default symbol was set, this returns null.
        Since:
        100.0.0
      • setDefaultSymbol

        public void setDefaultSymbol​(Symbol defaultSymbol)
        Sets the default symbol for values that don't fall within any of the class breaks.
        Parameters:
        defaultSymbol - the new default symbol
        Since:
        100.0.0
      • getFieldName

        public java.lang.String getFieldName()
        Gets the name of the field that the class breaks will apply to.
        Returns:
        the name of the field that the class breaks will apply to
        Since:
        100.0.0
      • setFieldName

        public void setFieldName​(java.lang.String fieldName)
        Sets the name of the field that the class breaks will apply to.
        Parameters:
        fieldName - the name of the field that the class breaks will apply to
        Since:
        100.0.0
      • getMinValue

        public double getMinValue()
        Gets the minimum value of the first class break if the renderer uses continuous class breaks.
        Returns:
        the min value for this renderer
        Since:
        100.0.0
        See Also:
        setMinValue(double)
      • setMinValue

        public void setMinValue​(double minValue)
        Sets the minimum value of the first class break if the renderer uses continuous class breaks.

        This will set the minimum value of the first class break in a renderer containing continuous class breaks where each ClassBreak does not define a minimum value. In this case the minimum value of each break will be the maximum value of the preceding one. As the first class break has no class break before it, this value will define its minimum.

        Parameters:
        minValue - the new min value
        Since:
        100.0.0
      • getNormalizationField

        public java.lang.String getNormalizationField()
        Gets the normalization field.
        Returns:
        the normalization field
        Since:
        100.0.0
        See Also:
        setNormalizationField(String)
      • setNormalizationField

        public void setNormalizationField​(java.lang.String normalizationField)
        Sets the normalization field. This field will be used to normalize the data when the normalization type is set to ClassBreaksRenderer.NormalizationType.BY_FIELD.
        Parameters:
        normalizationField - the new normalization field
        Since:
        100.0.0
      • getNormalizationTotal

        public double getNormalizationTotal()
        Gets the normalization total when normalization type is set to ClassBreaksRenderer.NormalizationType.BY_PERCENT_OF_TOTAL. This means that the minimum and maximum values in each class break are defined as percentages of this total.
        Returns:
        the normalization total
        Since:
        100.0.0
      • setNormalizationTotal

        public void setNormalizationTotal​(double normalizationTotal)
        Sets the normalization total.
        Parameters:
        normalizationTotal - the normalization total
        Since:
        100.0.0
        See Also:
        getNormalizationTotal()