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.

See Also:
Serialized Form

Field Summary
static String 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE

public static final String TYPE
See Also:
Constant Field Values
Constructor Detail

UniqueValueRenderer

public UniqueValueRenderer()
Instantiates an empty UniqueValueRenderer object.


UniqueValueRenderer

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

Throws:
Exception
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.

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.

getField2

public String getField2()
Gets the second attribute field.

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

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.

getField3

public String getField3()
Gets the third attribute field

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

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.

getFieldDelimiter

public String getFieldDelimiter()
Gets field delimiter.

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

setFieldDelimiter

public void setFieldDelimiter(String fieldDelimiter)
Sets field delimiter

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

getDefaultSymbol

public Symbol getDefaultSymbol()
Gets the default symbol.

Returns:
the default symbol used for unmatched values.

setDefaultSymbol

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

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

getDefaultLabel

public String getDefaultLabel()
Gets the default label.

Returns:
the default label.

setDefaultLabel

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

Parameters:
defaultLabel - the default label to set.

getUniqueValueInfos

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

Returns:
the list of unique values.

setUniqueValueInfos

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

Parameters:
uniqueValueInfos - the unique value list

addUniqueValue

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

Parameters:
uniqueValue - the unique value to add.

removeUniqueValue

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

Parameters:
uniqueValue - the unique value to remove.

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 based on the properties of the graphic.

toJson

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

Specified by:
toJson in interface Renderer<Graphic>
Returns:
a JSON string.
Throws:
Exception


Copyright © 2012. All Rights Reserved.