com.esri.core.renderer
Class UniqueValueRenderer

java.lang.Object
  extended by com.esri.core.renderer.UniqueValueRenderer
All Implemented Interfaces:
Renderer<Graphic>, Serializable

public class UniqueValueRenderer
extends Object
implements Renderer<Graphic>

A unique value renderer symbolizes groups of graphics that have matching attributes. This is most common with nominal, or string data. For example, you could use a unique value renderer to symbolize zoning designations: yellow for "Residential", purple for "Industrial", red for "Commercial", and so on. You can also use unique value renderers on numeric fields that are coded values, or on ordinal attributes such as "First", "Second", "Third", and so on. Typically features are rendered based on the unique values of one attribute field. However, up to three fields can be combined to generate a unique value.

Since:
1.0
See Also:
Serialized Form

Field Summary
static String TYPE
          The Constant TYPE.
 
Constructor Summary
UniqueValueRenderer()
          Instantiates an empty UniqueValueRenderer object.
UniqueValueRenderer(org.codehaus.jackson.JsonNode node)
          Instantiates ClassBreak from a Json node object.
 
Method Summary
 boolean addUniqueValue(UniqueValue uniqueValue)
          Adds a unique value.
 String getDefaultLabel()
          Gets the default label.
 Symbol getDefaultSymbol()
          Gets the default symbol.
 String getField1()
          Gets the first attribute field.
 String getField2()
          Gets the second attribute field.
 String getField3()
          Gets the third attribute field.
 String getFieldDelimiter()
          Gets field delimiter.
 Symbol getSymbol(Graphic graphic)
          Returns the symbol of the unique value the graphic provided corresponds to.
 List<UniqueValue> getUniqueValueInfos()
          Gets a list of unique values.
 boolean removeUniqueValue(UniqueValue uniqueValue)
          Removes a unique value.
 void setDefaultLabel(String defaultLabel)
          Sets the default label.
 void setDefaultSymbol(Symbol defaultSymbol)
          Sets the default symbol.
 void setField1(String field1)
          Sets the first attribute field.
 void setField2(String field2)
          Sets the second attribute field.
 void setField3(String field3)
          Sets the third attribute field.
 void setFieldDelimiter(String fieldDelimiter)
          Sets field delimiter.
 void setUniqueValueInfos(List<UniqueValue> uniqueValueInfos)
          Sets unique values.
 String toJson()
          Converts into a JSON string.
 FeatureType[] toTypes(Field[] fields, Geometry.Type type)
          Creates templates out of the renderer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE

public static final String TYPE
The Constant TYPE.

See Also:
Constant Field Values
Constructor Detail

UniqueValueRenderer

public UniqueValueRenderer()
Instantiates an empty UniqueValueRenderer object.

Since:
1.0

UniqueValueRenderer

public UniqueValueRenderer(org.codehaus.jackson.JsonNode node)
                    throws Exception
Instantiates ClassBreak from a Json node object.

Parameters:
node - the node
Throws:
Exception - the exception
Since:
1.0
Method Detail

getField1

public String getField1()
Gets the first attribute field.

Returns:
the name of the attribute field the renderer uses to match values against.
Since:
1.0

setField1

public void setField1(String field1)
Sets the first attribute field.

Parameters:
field1 - the name of the attribute field the renderer uses to match values against.
Since:
1.0

getField2

public String getField2()
Gets the second attribute field.

Returns:
If needed, specifies an additional attribute field the renderer uses to match values.
Since:
1.0

setField2

public void setField2(String field2)
Sets the second attribute field.

Parameters:
field2 - If needed, specifies an additional attribute field the renderer uses to match values.
Since:
1.0

getField3

public String getField3()
Gets the third attribute field.

Returns:
If needed, specifies an additional attribute field the renderer uses to match values.
Since:
1.0

setField3

public void setField3(String field3)
Sets the third attribute field.

Parameters:
field3 - If needed, specifies an additional attribute field the renderer uses to match values.
Since:
1.0

getFieldDelimiter

public String getFieldDelimiter()
Gets field delimiter.

Returns:
string inserted between the values if multiple attribute fields are specified
Since:
1.0

setFieldDelimiter

public void setFieldDelimiter(String fieldDelimiter)
Sets field delimiter.

Parameters:
fieldDelimiter - string inserted between the values if multiple attribute fields are specified
Since:
1.0

getDefaultSymbol

public Symbol getDefaultSymbol()
Gets the default symbol.

Returns:
the default symbol used for unmatched values.
Since:
1.0

setDefaultSymbol

public void setDefaultSymbol(Symbol defaultSymbol)
Sets the default symbol.

Parameters:
defaultSymbol - the default symbol used for unmatched values.
Since:
1.0

getDefaultLabel

public String getDefaultLabel()
Gets the default label.

Returns:
the default label.
Since:
1.0

setDefaultLabel

public void setDefaultLabel(String defaultLabel)
Sets the default label.

Parameters:
defaultLabel - the default label to set.
Since:
1.0

getUniqueValueInfos

public List<UniqueValue> getUniqueValueInfos()
Gets a list of unique values.

Returns:
the list of unique values.
Since:
1.0

setUniqueValueInfos

public void setUniqueValueInfos(List<UniqueValue> uniqueValueInfos)
Sets unique values.

Parameters:
uniqueValueInfos - the unique value list
Since:
1.0

addUniqueValue

public boolean addUniqueValue(UniqueValue uniqueValue)
Adds a unique value.

Parameters:
uniqueValue - the unique value to add.
Returns:
true, if adds the unique value
Since:
1.0

removeUniqueValue

public boolean removeUniqueValue(UniqueValue uniqueValue)
Removes a unique value.

Parameters:
uniqueValue - the unique value to remove.
Returns:
true, if removes the unique value
Since:
1.0

getSymbol

public Symbol getSymbol(Graphic graphic)
Returns the symbol of the unique value the graphic provided corresponds to.

Specified by:
getSymbol in interface Renderer<Graphic>
Parameters:
graphic - the graphic to be symbolized
Returns:
the symbol
Since:
1.0

toTypes

public FeatureType[] toTypes(Field[] fields,
                             Geometry.Type type)
Creates templates out of the renderer.

Parameters:
fields - the field types.
type - the geometry type. The templates are defined on feature layers, the geometry type is defined on feature layers.
Returns:
the feature type[]
Since:
1.0

toJson

public String toJson()
              throws Exception
Converts into a JSON string.

Specified by:
toJson in interface Renderer<Graphic>
Returns:
a JSON string.
Throws:
Exception - the exception
Since:
1.0


Copyright © 2010. All Rights Reserved.