Package com.esri.arcgisruntime.symbology
Class Symbol
- java.lang.Object
-
- com.esri.arcgisruntime.symbology.Symbol
-
- All Implemented Interfaces:
JsonSerializable
- Direct Known Subclasses:
CompositeSymbol
,FillSymbol
,LineSymbol
,MarkerSymbol
,MultilayerSymbol
,SceneSymbol
public class Symbol extends java.lang.Object implements JsonSerializable
Defines a generic symbol and is the base class for all symbols.- Since:
- 100.0.0
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ListenableFuture<android.graphics.Bitmap>
createSwatchAsync(int backgroundColor, float screenScale)
Creates a swatch asynchronously with the given background color and screen scale.ListenableFuture<android.graphics.Bitmap>
createSwatchAsync(int width, int height, float screenScale, int backgroundColor)
Creates a swatch asynchronously with the given width, height, screen scale and background colorListenableFuture<android.graphics.Bitmap>
createSwatchAsync(int width, int height, float screenScale, int backgroundColor, Geometry geometry)
Creates a swatch asynchronously from a Geometry object.ListenableFuture<android.graphics.Bitmap>
createSwatchAsync(android.content.Context context, int backgroundColor)
Creates a swatch with the given background color based on symbol size and display defaults.static Symbol
fromJson(java.lang.String json)
Creates a Symbol instance from a JSON string.java.util.Map<java.lang.String,java.lang.Object>
getUnknownJson()
If this object was created from JSON, this method gets unknown data from the source JSON.java.util.Map<java.lang.String,java.lang.Object>
getUnsupportedJson()
If this object was created from JSON, this method gets unsupported data from the source JSON.java.lang.String
toJson()
Serializes this object to a JSON string.
-
-
-
Method Detail
-
fromJson
public static Symbol fromJson(java.lang.String json)
Creates a Symbol instance from a JSON string.- Parameters:
json
- a JSON string that represents a Symbol- Returns:
- a Symbol instance
- Throws:
java.lang.IllegalArgumentException
- if json is null or empty- Since:
- 100.0.0
-
toJson
public java.lang.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 java.util.Map<java.lang.String,java.lang.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 java.util.Map<java.lang.String,java.lang.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
-
createSwatchAsync
public ListenableFuture<android.graphics.Bitmap> createSwatchAsync(int width, int height, float screenScale, int backgroundColor, Geometry geometry)
Creates a swatch asynchronously from a Geometry object. The specified geometry should be in density-independent pixels (dps) with the point {0,0} corresponding to the center point of the swatch image. The X-axis increases toward the right hand side of the swatch image. The Y-axis increases towards the top of the swatch image. The geometry type should correspond to the symbol type. For example, Points for MarkerSymbols, Polylines for LineSymbols and Polygons for FillSymbols. The spatial reference of the geometry is ignored.- Parameters:
width
- width of the image in dpheight
- height of the image in dpscreenScale
- number of pixels per dp, see android.util.DisplayMetrics.densitybackgroundColor
- background color of the swatch as 0xAARRGGBBgeometry
- geometry of the swatch symbol- Returns:
- a ListenableFuture that represents the async operation of creating the swatch
- Throws:
java.lang.IllegalArgumentException
- if either backgroundColor or geometry is nulljava.lang.IllegalArgumentException
- if width or height is less than 1java.lang.IllegalArgumentException
- if screenScale is 0 or less- Since:
- 100.0.0
-
createSwatchAsync
public ListenableFuture<android.graphics.Bitmap> createSwatchAsync(android.content.Context context, int backgroundColor)
Creates a swatch with the given background color based on symbol size and display defaults.- Parameters:
context
- the current execution contextbackgroundColor
- background color of the swatch as 0xAARRGGBB- Returns:
- a ListenableFuture that represents the async operation of creating the swatch
- Throws:
java.lang.IllegalArgumentException
- if context is null- Since:
- 100.0.0
-
createSwatchAsync
public ListenableFuture<android.graphics.Bitmap> createSwatchAsync(int backgroundColor, float screenScale)
Creates a swatch asynchronously with the given background color and screen scale.- Parameters:
backgroundColor
- background color of the swatch as 0xAARRGGBBscreenScale
- number of pixels per dp, see android.util.DisplayMetrics.density- Returns:
- a ListenableFuture that represents the async operation of creating the swatch
- Throws:
java.lang.IllegalArgumentException
- if screenScale is 0 or less- Since:
- 100.3.0
-
createSwatchAsync
public ListenableFuture<android.graphics.Bitmap> createSwatchAsync(int width, int height, float screenScale, int backgroundColor)
Creates a swatch asynchronously with the given width, height, screen scale and background color- Parameters:
width
- width of the image in dpheight
- height of the image in dpscreenScale
- number of pixels per dp, android.util.DisplayMetrics.densitybackgroundColor
- background color of the swatch as 0xAARRGGBB- Returns:
- a ListenableFuture that represents the async operation of creating the swatch
- Throws:
java.lang.IllegalArgumentException
- if width is less than 1java.lang.IllegalArgumentException
- if height is less than 1java.lang.IllegalArgumentException
- if screenScale is 0 or less- Since:
- 100.3.0
-
-