public class

SymbolHelper

extends Object
implements SymbolFactory
java.lang.Object
   ↳ com.esri.core.symbol.SymbolHelper

Class Overview

A convenient class which parses JSON representation of the symbol into a Symbol instance.

Summary

Public Constructors
SymbolHelper()
Public Methods
static Symbol createSymbol(JsonParser parser)
Creates a Symbol instance using specified JsonParser instance.
static Bitmap getLegendImage(Symbol symbol, int widthInPixels, int heightInPixels)
Returns a Bitmap image for the symbol.
static Bitmap getLegendImage(Symbol symbol, Geometry geometry, int widthInPixels, int heightInPixels, int backgroundColor)
Returns a Bitmap image for the symbol.
static Bitmap[] getLegendImages(Symbol[] symbols, Geometry[] geometries, int widthInPixels, int heightInPixels, int color)
Returns a Bitmap array
static Bitmap[] getLegendImages(Symbol[] symbols, int widthInPixels, int heightInPixels)
Returns a Bitmap array
Symbol getSymbol(JsonParser parser)
Creates a symbol.
static final Symbol parseSymbol(JsonNode node)
Parses a symbol JSON node and returns the proper symbol object.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.esri.core.symbol.SymbolFactory

Public Constructors

public SymbolHelper ()

Public Methods

public static Symbol createSymbol (JsonParser parser)

Creates a Symbol instance using specified JsonParser instance.

Parameters
parser JsonParser: JsonParser instance, which is a JSON representation of the symbol.
Returns
Symbol a Symbol instance, which can be PictureMarkerSymbol, SimpleMarkerSymbol,SimpleLineSymbol ,SimpleFillSymbol, TextSymbol or MultiLayerSymbol.

public static Bitmap getLegendImage (Symbol symbol, int widthInPixels, int heightInPixels)

Returns a Bitmap image for the symbol. The symbol will be rendered on the default geometry with transparent background. It calls the method getLegendImage(Symbol, Geometry, int , int , int)

Parameters
symbol Symbol: a Symbol object;
widthInPixels int: image width in pixels;
heightInPixels int: image height in pixels
Returns
Bitmap a Bitmap object.

public static Bitmap getLegendImage (Symbol symbol, Geometry geometry, int widthInPixels, int heightInPixels, int backgroundColor)

Returns a Bitmap image for the symbol.

Parameters
symbol Symbol: a Symbol object
geometry Geometry: a geometry
widthInPixels int: image width in pixels;
heightInPixels int: image height in pixels;
backgroundColor int: integer
Returns
Bitmap a Bitmap object.

public static Bitmap[] getLegendImages (Symbol[] symbols, Geometry[] geometries, int widthInPixels, int heightInPixels, int color)

Returns a Bitmap array

Parameters
symbols Symbol: an array of Bitmap
geometries Geometry: an array of Geometry
widthInPixels int: image width in pixels
heightInPixels int: image width in pixels
color int: integer
Returns
Bitmap[] an array of Bitmap objects.

public static Bitmap[] getLegendImages (Symbol[] symbols, int widthInPixels, int heightInPixels)

Returns a Bitmap array

Parameters
symbols Symbol: an array of Bitmap
widthInPixels int: image width in pixels
heightInPixels int: image width in pixels
Returns
Bitmap[] an array of Bitmap objects.

public Symbol getSymbol (JsonParser parser)

Creates a symbol.

Parameters
parser JsonParser: parser containing symbol information in JSON format.
Returns
Symbol a symbol.

public static final Symbol parseSymbol (JsonNode node)

Parses a symbol JSON node and returns the proper symbol object.

Parameters
node JsonNode: the node
Returns
Symbol the symbol
Throws
Exception exception is thrown if the JSON node invalid.