- All Implemented Interfaces:
JsonSerializable
A class breaks renderer contains a collection of ranges (or class breaks). Each ClassBreak
has a
MinValue
, MaxValue
,
and a unique Symbol
. The ranges reflect a
specific ClassBreaksRenderer.RendererClassificationMethod
, such as equal interval, natural breaks, quantile, standard
deviation and manual classification.
ClassBreaksRenderer contains properties for setting the field that the class breaks refer
to and also for controlling normalization. It also defines a default label and symbol to display for
values that don't fall within any of the class breaks. You can add or remove a ClassBreak
from this
renderer via the getClassBreaks()
collection.
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
.
For discontinuous class breaks, set both a min and a max value in each ClassBreak
.
- Since:
- 100.0.0
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Defines a single class break as used byClassBreaksRenderer
.static enum
Defines the different normalization types that can be applied to values by a class breaks renderer.static enum
The classification method used to generate class breaks.Nested classes/interfaces inherited from class com.esri.arcgisruntime.symbology.Renderer
Renderer.SceneProperties
-
Constructor Summary
ConstructorDescriptionCreates a new empty class breaks renderer.ClassBreaksRenderer
(String fieldName, Iterable<ClassBreaksRenderer.ClassBreak> classBreaks) Creates a new class breaks renderer with the given class breaks applied to the given field. -
Method Summary
Modifier and TypeMethodDescriptionGets the renderer's background fill symbol.Gets the collection of class breaks which define each range in this renderer.Gets the label used for the default symbol, suitable for showing in a legend, for values that don't fall within any of the class breaks.Gets the default symbol for values that don't fall within any of the class breaks.Gets the name of the field that the class breaks will apply to.double
Gets the minimum value of the first class break if the renderer uses continuous class breaks.Gets the renderer's normalization field.double
Gets the renderer's normalization total.Gets the renderer's normalization type.Gets the renderer's classification method.Returns the symbol that is used to visualize the given feature.Returns the symbol that is used to visualize the given graphic.void
setBackgroundFillSymbol
(Symbol backgroundFillSymbol) Sets the renderer's background fill symbol.void
setDefaultLabel
(String defaultLabel) Sets the label used for the default symbol, suitable for showing in a legend, for values that don't fall within any of the class breaks.void
setDefaultSymbol
(Symbol defaultSymbol) Sets the default symbol for values that don't fall within any of the class breaks.void
setFieldName
(String fieldName) Sets the name of the field that the class breaks will apply to.void
setMinValue
(double minValue) Sets the minimum value of the first class break if the renderer uses continuous class breaks.void
setNormalizationField
(String normalizationField) Sets the renderer's normalization field.void
setNormalizationTotal
(double normalizationTotal) Sets the renderer's normalization total.void
setNormalizationType
(ClassBreaksRenderer.NormalizationType normalizationType) Sets the renderer's normalization type.Methods inherited from class com.esri.arcgisruntime.symbology.Renderer
fromJson, getRotationExpression, getRotationType, getSceneProperties, getSymbol, getSymbol, getSymbol, getSymbol, getSymbol, getSymbol, getUnknownJson, getUnsupportedJson, setRotationExpression, setRotationType, toJson
-
Constructor Details
-
ClassBreaksRenderer
public ClassBreaksRenderer()Creates a new empty class breaks renderer.- Since:
- 100.0.0
-
ClassBreaksRenderer
Creates a new class breaks renderer with the given class breaks applied to the given field.- Parameters:
fieldName
- the field name that the class breaks apply toclassBreaks
- the collection of class breaks to apply to the given field- Since:
- 100.0.0
-
-
Method Details
-
getBackgroundFillSymbol
Gets the renderer's background fill symbol.- Returns:
- background fill symbol, or null if none
- Since:
- 100.4.0
-
setBackgroundFillSymbol
Sets the renderer's background fill symbol.- Parameters:
backgroundFillSymbol
- the renderer's background fill symbol- Throws:
IllegalArgumentException
- if backgroundFillSymbol is null- Since:
- 100.4.0
-
getSymbol
Returns the symbol that is used to visualize the given feature.If the renderer is a
DictionaryRenderer
and its associatedDictionarySymbolStyle
references a style file hosted on ArcGIS Online or an ArcGIS Enterprise portal (also referred to as a web style), this method returns null. If the layer has rendered and the symbol is already drawn on the view, this method returns a validMultilayerSymbol
. If you want to get the symbol before the layer is rendered, useDictionarySymbolStyle.getSymbolAsync(Map)
.- Specified by:
getSymbol
in classRenderer
- Parameters:
feature
- the Feature to get a Symbol from, not null- Returns:
- the Symbol of the Feature that was passed
- Throws:
IllegalArgumentException
- if feature is null- Since:
- 100.0.0
- See Also:
-
getSymbol
Returns the symbol that is used to visualize the given graphic.If the renderer is a
DictionaryRenderer
and its associatedDictionarySymbolStyle
references a style file hosted on ArcGIS Online or an ArcGIS Enterprise portal (also referred to as a web style), this method returns null. If the layer has rendered and the symbol is already drawn on the view, this method returns a validMultilayerSymbol
. If you want to get the symbol before the layer is rendered, useDictionarySymbolStyle.getSymbolAsync(Map)
.- Specified by:
getSymbol
in classRenderer
- Parameters:
graphic
- the Graphic to get a Symbol from, not null- Returns:
- the Symbol of the Graphic that was passed
- Throws:
IllegalArgumentException
- if graphic is null- Since:
- 100.0.0
- See Also:
-
getClassBreaks
Gets the collection of class breaks which define each range in this renderer.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 aClassBreak
is added or removed. Note that each call to this method will return the sameListenableList
instance.- Returns:
- the collection of class breaks which define each range in this renderer
- Since:
- 100.0.0
-
getDefaultLabel
Gets the label used for the default symbol, 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
Sets the label used for the default symbol, 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
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
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
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
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.This will set the minimum value of the first class break in a renderer containing continuous class breaks where each
ClassBreaksRenderer.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.- Returns:
- the min value for this renderer
- Since:
- 100.0.0
- See Also:
-
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
ClassBreaksRenderer.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
Gets the renderer's normalization field.This field will be used to normalize the data when the
getNormalizationType()
is set toClassBreaksRenderer.NormalizationType.BY_FIELD
.- Returns:
- the normalization field
- Since:
- 100.0.0
- See Also:
-
setNormalizationField
Sets the renderer's normalization field.This field will be used to normalize the data when the
getNormalizationType()
is set toClassBreaksRenderer.NormalizationType.BY_FIELD
.- Parameters:
normalizationField
- the new normalization field- Since:
- 100.0.0
-
getNormalizationTotal
public double getNormalizationTotal()Gets the renderer's normalization total.This is the normalization total when
getNormalizationType()
is set toClassBreaksRenderer.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 renderer's normalization total.This is the normalization total when
getNormalizationType()
is set toClassBreaksRenderer.NormalizationType.BY_PERCENT_OF_TOTAL
. This means that the minimum and maximum values in each class break are defined as percentages of this total.- Parameters:
normalizationTotal
- the normalization total- Since:
- 100.0.0
- See Also:
-
getNormalizationType
Gets the renderer's normalization type.If this property is not
ClassBreaksRenderer.NormalizationType.NONE
, then the class breaks contain a normalized min/max value instead of the actual value. In this case, the type will indicate the way in which the value in the field given bygetFieldName()
should be normalized before comparing with the class breaks.The default value is
NormalizationType.NONE
.- Returns:
- the
ClassBreaksRenderer.NormalizationType
type - Since:
- 100.0.0
-
setNormalizationType
Sets the renderer's normalization type.If this property is not
ClassBreaksRenderer.NormalizationType.NONE
, then the class breaks contain a normalized min/max value instead of the actual value. In this case, the type will indicate the way in which the value in the field given bygetFieldName()
should be normalized before comparing with the class breaks.- Parameters:
normalizationType
- the normalization type- Since:
- 100.0.0
- See Also:
-
getRendererClassificationMethod
Gets the renderer's classification method.- Since:
- 100.4.0
-