Class ClassBreaksRenderer
- java.lang.Object
-
- com.esri.arcgisruntime.symbology.Renderer
-
- com.esri.arcgisruntime.symbology.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 bygetClassBreaks()
. 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClassBreaksRenderer.ClassBreak
Defines a single class break as used byClassBreaksRenderer
.static class
ClassBreaksRenderer.NormalizationType
Defines the different normalization types that can be applied to values by a class breaks renderer.static class
ClassBreaksRenderer.RendererClassificationMethod
The classification method used to generate class breaks.-
Nested classes/interfaces inherited from class com.esri.arcgisruntime.symbology.Renderer
Renderer.SceneProperties
-
-
Constructor Summary
Constructors Constructor Description ClassBreaksRenderer()
Creates a new empty class breaks renderer.ClassBreaksRenderer(String fieldName, Iterable<ClassBreaksRenderer.ClassBreak> classBreaks)
Creates a new class breaks renderer with the givenClassBreaks
applied to the given field.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Symbol
getBackgroundFillSymbol()
Gets the renderer's background fill symbol which is aSimpleFillSymbol
.List<ClassBreaksRenderer.ClassBreak>
getClassBreaks()
Gets the list of class breaks.String
getDefaultLabel()
Gets the default label, suitable for showing in a legend, for values that don't fall within any of the class breaks.Symbol
getDefaultSymbol()
Gets the default symbol for values that don't fall within any of the class breaks.String
getFieldName()
Gets the name of the field that the class breaks will apply to.double
getMinValue()
Gets the minimum value of the first class break if the renderer uses continuous class breaks.String
getNormalizationField()
Gets the normalization field.double
getNormalizationTotal()
Gets the normalization total when normalization type is set toClassBreaksRenderer.NormalizationType.BY_PERCENT_OF_TOTAL
.ClassBreaksRenderer.NormalizationType
getNormalizationType()
Gets the normalization type.ClassBreaksRenderer.RendererClassificationMethod
getRendererClassificationMethod()
Gets the renderer's classification method.Symbol
getSymbol(Feature feature)
Gets the Symbol used to display the given Feature.Symbol
getSymbol(Graphic graphic)
Gets the Symbol used to display the given Graphic.void
setBackgroundFillSymbol(Symbol backgroundFillSymbol)
Sets the renderer's background fill symbol which must be aSimpleFillSymbol
.void
setDefaultLabel(String defaultLabel)
Sets the default label, 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 normalization field.void
setNormalizationTotal(double normalizationTotal)
Sets the normalization total.void
setNormalizationType(ClassBreaksRenderer.NormalizationType normalizationType)
Sets the normalization type.-
Methods inherited from class com.esri.arcgisruntime.symbology.Renderer
fromJson, getRotationExpression, getRotationType, getSceneProperties, getSymbol, getSymbol, getUnknownJson, getUnsupportedJson, setRotationExpression, setRotationType, toJson
-
-
-
-
Constructor Detail
-
ClassBreaksRenderer
public ClassBreaksRenderer()
Creates a new empty class breaks renderer.- Since:
- 100.0.0
-
ClassBreaksRenderer
public ClassBreaksRenderer(String fieldName, Iterable<ClassBreaksRenderer.ClassBreak> classBreaks)
Creates a new class breaks renderer with the givenClassBreaks
applied to the given field.- Parameters:
fieldName
- the field name that the class breaks apply toclassBreaks
- 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 aSimpleFillSymbol
.- Returns:
- background fill symbol
- Since:
- 100.4.0
-
setBackgroundFillSymbol
public void setBackgroundFillSymbol(Symbol backgroundFillSymbol)
Sets the renderer's background fill symbol which must be aSimpleFillSymbol
.- Parameters:
backgroundFillSymbol
- the background fill symbol- Throws:
IllegalArgumentException
- if backgroundFillSymbol is nullArcGISRuntimeException
- if backgroundFillSymbol is not a SimpleFillSymbol- Since:
- 100.4.0
-
getSymbol
public Symbol getSymbol(Feature feature)
Gets the Symbol used to display the given Feature.- 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:
Renderer.getSymbol(com.esri.arcgisruntime.data.Feature)
-
getSymbol
public Symbol getSymbol(Graphic graphic)
Gets the Symbol used to display the given Graphic.- 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:
Renderer.getSymbol(com.esri.arcgisruntime.mapping.view.Graphic)
-
getClassBreaks
public 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 aClassBreak
is added or removed. Note that each call to this method will return the sameListenableList
instance.- Returns:
- the class breaks list
- Since:
- 100.0.0
-
getDefaultLabel
public 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(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 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(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 String getNormalizationField()
Gets the normalization field.- Returns:
- the normalization field
- Since:
- 100.0.0
- See Also:
setNormalizationField(String)
-
setNormalizationField
public void setNormalizationField(String normalizationField)
Sets the normalization field. This field will be used to normalize the data when the normalization type is set toClassBreaksRenderer.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 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 normalization total.- Parameters:
normalizationTotal
- the normalization total- Since:
- 100.0.0
- See Also:
getNormalizationTotal()
-
getNormalizationType
public ClassBreaksRenderer.NormalizationType getNormalizationType()
Gets the 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.If this has not been set, the default value is
NONE
.- Returns:
- the
ClassBreaksRenderer.NormalizationType
type - Since:
- 100.0.0
-
setNormalizationType
public void setNormalizationType(ClassBreaksRenderer.NormalizationType normalizationType)
Sets the normalization type.- Parameters:
normalizationType
- the normalization type- Since:
- 100.0.0
- See Also:
getNormalizationType()
-
getRendererClassificationMethod
public ClassBreaksRenderer.RendererClassificationMethod getRendererClassificationMethod()
Gets the renderer's classification method.- Since:
- 100.4.0
-
-