Class UniqueValueRenderer.UniqueValue
- java.lang.Object
-
- com.esri.arcgisruntime.symbology.UniqueValueRenderer.UniqueValue
-
- All Implemented Interfaces:
JsonSerializable
- Enclosing class:
- UniqueValueRenderer
public static final class UniqueValueRenderer.UniqueValue extends Object implements JsonSerializable
A UniqueValue object that is used in a UniqueValueRenderer.UniqueValues are used for assigning certain values to a certain Symbol. It also allows for a description and label to be assigned to those values as well.
Properties of a UniqueValue:
- Description - describes what the UniqueValue does or represents.
- Label - name that this UniqueValue can be referred by.
- Symbol - the Symbol to display.
- Values - represent certain geoelements and will have the Symbol for this UniqueValue applied to them.
Note: Values is a iterable list and the contents of this list are copied. Any subsequent changes to this list won't have any impact on the values of this object. To modify the values, use the corresponding get method for its result is modifiable.
- Since:
- 100.0.0
-
-
Constructor Summary
Constructors Constructor Description UniqueValue()
Creates a new UniqueValue with given default properties: Description, an empty string. Label - null. Symbol - an empty string. Values - an empty iterable list.UniqueValue(String description, String label, Symbol symbol, Iterable<Object> values)
Creates a new unique value (or unique combination of values) and a symbol used to display elements with this value in aUniqueValueRenderer
.UniqueValue(String description, String label, Symbol symbol, Iterable<Object> values, Iterable<Symbol> alternateSymbols)
Creates a new unique value (or unique combination of values) object with alternate symbols.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UniqueValueRenderer.UniqueValue
fromJson(String json)
Creates a UniqueValue instance from a JSON string.List<Symbol>
getAlternateSymbols()
Gets the alternate symbols for the unique value's primary symbol.String
getDescription()
Gets the description that describes what this UniqueValue does or represents.String
getLabel()
Gets the name that this UniqueValue is referred as.Symbol
getSymbol()
Gets the Symbol that this UniqueValue uses to represent the values (geoelements).Map<String,Object>
getUnknownJson()
If this object was created from JSON, this method gets unknown data from the source JSON.Map<String,Object>
getUnsupportedJson()
If this object was created from JSON, this method gets unsupported data from the source JSON.List<Object>
getValues()
Gets a modifiable list containing all the values that the Symbol for this UniqueValue will be applied to.void
setDescription(String description)
Sets the description, which gives detail information about what this UniqueValue does or represents.void
setLabel(String label)
Sets a name that this UniqueValue can be referred to.void
setSymbol(Symbol symbol)
Sets the Symbol for this UniqueValue.String
toJson()
Serializes this object to a JSON string.
-
-
-
Constructor Detail
-
UniqueValue
public UniqueValue()
Creates a new UniqueValue with given default properties:- Description, an empty string.
- Label - null.
- Symbol - an empty string.
- Values - an empty iterable list.
Only Symbol and values needs to be set for this UniqueValue to work; description and label are optional. If values is set and Symbol is still null, then when this UniqueValue is rendered, nothing will be displayed to the GeoView even if a default Symbol is set.
- Since:
- 100.0.0
-
UniqueValue
public UniqueValue(String description, String label, Symbol symbol, Iterable<Object> values)
Creates a new unique value (or unique combination of values) and a symbol used to display elements with this value in aUniqueValueRenderer
.Setting any parameter to null will set it to its default property, see
UniqueValue()
for more information.- Parameters:
description
- the description for this UniqueValue. Can be null. For example: "Parcels zoned for residential use".label
- the label for this UniqueValue. Can be null. For example: "Residential".symbol
- symbol to be used for rendering values within this UniqueValue. Can be null.values
- a unique value or unique combination of values to which the Symbol for this UniqueValue will be applied. Can be null.- Since:
- 100.0.0
-
UniqueValue
public UniqueValue(String description, String label, Symbol symbol, Iterable<Object> values, Iterable<Symbol> alternateSymbols)
Creates a new unique value (or unique combination of values) object with alternate symbols.A unique value can have alternate symbols to the primary symbol. Alternate symbols allow you to tailor the visualization of unique value at different scales by selecting different symbol for different scales. Alternate symbols are supported only when unique value's primary symbol and other symbols in alternate symbol list are of type
MultilayerSymbol
and haveSymbolReferenceProperties
defining valid min max scales at which the symbol becomes visible. Renderer will pick only one symbol at a given map scale. If primary symbol's scale range falls within the map's scale, primary symbol is used. If not, then symbols in alternate symbols list are iterated through and first symbol matching the current map scale is picked for rendering. A symbol becomes visible if the map scale is less than or equal to symbol's minimum scale and greater than symbol's maximum scale. For more information on Scale-based symbol classes and alternate symbols see the "Scale based Symbols documentation"- Parameters:
description
- a description of the unique value. "Parcels zoned for residential use", for example.label
- a label for the unique value. "Residential", for example.symbol
- a symbol used to represent elements with this unique value, may be nullvalues
- aIterable
containingObject
types that define a unique value or unique combination of valuesalternateSymbols
- the alternate symbols for the unique value. OnlyMultilayerSymbol
are supported as alternates. This param may be null.- Since:
- 100.13.0
-
-
Method Detail
-
getAlternateSymbols
public List<Symbol> getAlternateSymbols()
Gets the alternate symbols for the unique value's primary symbol. Symbols in this list should be of typeMultilayerSymbol
and must haveSymbolReferenceProperties
set with valid minimum and maximum scale at which symbol becomes visible. Renderer will pick only one symbol at a given map scale. If primary symbol's scale range falls within the map's scale, primary symbol is used. If not, then symbols in alternate symbols list are iterated through and first symbol matching the current map scale is picked for rendering. A symbol becomes visible if the map scale is less than or equal to symbol's minimum scale and greater than symbol's maximum scale.- Returns:
- the alternate symbols for the unique value's primary symbol.
- Since:
- 100.13.0
-
fromJson
public static UniqueValueRenderer.UniqueValue fromJson(String json)
Creates a UniqueValue instance from a JSON string.- Parameters:
json
- a JSON string that represents a UniqueValue- Returns:
- a UniqueValue instance
- Throws:
IllegalArgumentException
- if json is null or empty- Since:
- 100.0.0
-
toJson
public String toJson()
Description copied from interface:JsonSerializable
Serializes this object to a JSON string. Note that unknown JSON is omitted from the serialized string.- Specified by:
toJson
in interfaceJsonSerializable
- Returns:
- a JSON string
-
getUnknownJson
public Map<String,Object> getUnknownJson()
Description copied from interface:JsonSerializable
If this object was created from JSON, this method gets unknown data from the source JSON. Unknown JSON is a Map of values that were in the source JSON but are not known by the Runtime and therefore not exposed in the API.- Specified by:
getUnknownJson
in interfaceJsonSerializable
- Returns:
- an unmodifiable Map containing unknown JSON data. The keys are Strings containing names. The types of
the values depend on the types of tokens within the JSON as follows:
- a
Map<String, Object>
represents an object in the JSON - a
List<Object>
represents an array in the JSON - a
String
represents a string in the JSON - a
Double
represents a number in the JSON - a
Boolean
represents true or false in the JSON null
represents null in the JSON
- a
-
getUnsupportedJson
public Map<String,Object> getUnsupportedJson()
Description copied from interface:JsonSerializable
If this object was created from JSON, this method gets unsupported data from the source JSON. Unsupported JSON is a Map of values that are supported by webmaps and known to the version of the webmap specification the API supports (see system requirements), but are not explicitly exposed through the Runtime API.- Specified by:
getUnsupportedJson
in interfaceJsonSerializable
- Returns:
- an unmodifiable Map containing unsupported JSON data. The keys are Strings containing names. The types of
the values depend on the types of tokens within the JSON as follows:
- a
Map<String, Object>
represents an object in the JSON - a
List<Object>
represents an array in the JSON - a
String
represents a string in the JSON - a
Double
represents a number in the JSON - a
Boolean
represents true or false in the JSON null
represents null in the JSON
- a
-
getDescription
public String getDescription()
Gets the description that describes what this UniqueValue does or represents.Default value is an empty string.
- Returns:
- the description used by this UniqueValue
- Since:
- 100.0.0
- See Also:
setDescription(java.lang.String)
-
setDescription
public void setDescription(String description)
Sets the description, which gives detail information about what this UniqueValue does or represents. For example: "Parcels zoned for residential use". The description often describes the meaning behind the Symbol this UniqueValue uses.- Parameters:
description
- the description to be used for this UniqueValue- Since:
- 100.0.0
- See Also:
getDescription()
-
getLabel
public String getLabel()
Gets the name that this UniqueValue is referred as.Default value is an empty string.
- Returns:
- the label for this UniqueValue
- Since:
- 100.0.0
- See Also:
setLabel(String)
-
setLabel
public void setLabel(String label)
Sets a name that this UniqueValue can be referred to. For example: "Residential".- Parameters:
label
- the label to be used for this UniqueValue- Since:
- 100.0.0
- See Also:
getLabel()
-
getSymbol
public Symbol getSymbol()
Gets the Symbol that this UniqueValue uses to represent the values (geoelements).Default value is null.
- Returns:
- the Symbol this UniqueValue is using
- Since:
- 100.0.0
- See Also:
setSymbol(com.esri.arcgisruntime.symbology.Symbol)
-
setSymbol
public void setSymbol(Symbol symbol)
Sets the Symbol for this UniqueValue.This Symbol will be applied to the values stored in this UniqueValue.
If the Symbol is null, then this UniqueValue will not be displayed on the GeoView when rendered.
- Parameters:
symbol
- the Symbol this UniqueValue is going to use. Can be null.- Since:
- 100.0.0
- See Also:
getSymbol()
-
-