com.esri.adf.web.data.renderer
Class WebUniqueValueRenderer

java.lang.Object
  extended by com.esri.adf.web.data.renderer.WebUniqueValueRenderer
All Implemented Interfaces:
WebRenderer, java.io.Serializable

public class WebUniqueValueRenderer
extends java.lang.Object
implements WebRenderer

WebUniqueValueRenderer is a renderer that is used for rendering features differently depending on the values of three fields. The fields must be of type String. The values of the fields set on a are concatenated and than compared to the concatenation of the tree corresponding fields of a feature.

  For example,
    WebUniqueValueRenderer wuvr = new WebUniqueValueRenderer();
    wuvr.setDefaultSymbol(defaultMarkerSymbol);
    wuvr.setDefaultLabel("Default Label");
    wuvr.setField1("TYPE");
    wuvr.setField2(null);
    wuvr.setField3(null);
    wuvr.setFieldDelimiter(null);
    
    ArrayList<WebUniqueValueInfo> infos = new ArrayList<WebUniqueValueInfo>(5);
    
    WebSimpleMarkerSymbol redMS = new WebSimpleMarkerSymbol();
    redMS.setColor("255,0,0");
    redMS.setWidth(15);
    redMS.setMarkerType(WebSimpleMarkerSymbol.CIRCLE);
    WebUniqueValueInfo uvi = new WebUniqueValueInfo("Red Color", "Red Color", "1", redMS);
    infos.add(uvi);
    
    WebSimpleMarkerSymbol greenMS = new WebSimpleMarkerSymbol();
    greenMS.setColor("0,255,0");
    greenMS.setWidth(25);
    greenMS.setMarkerType(WebSimpleMarkerSymbol.CIRCLE);
    uvi = new WebUniqueValueInfo("Green Color", "Green Color", "2", greenMS);
    infos.add(uvi);
    
    wuvr.setUniquValueInfos(infos);
 
When features of a GraphicsLayer are rendered using an instance of WebUniqueValueRenderer shown above, all the features with the value "1" in the "TYPE" field are shown in red color, while those with the value "2" are shown in green color.

See Also:
Serialized Form

Constructor Summary
WebUniqueValueRenderer()
           
 
Method Summary
 java.lang.String getDefaultLabel()
          Returnds the default label.
 WebSymbol getDefaultSymbol()
          Returns the default symbol.
 java.lang.String getField1()
          Returns the name of the first field.
 java.lang.String getField2()
          Returns the name of the second field.
 java.lang.String getField3()
          Returns the name of the third field.
 java.lang.String getFieldDelimiter()
          Returns the field delimiter.
 java.lang.String getType()
          Returns the type of the renderer as "Unique Value Renderer"
 java.util.List<WebUniqueValueInfo> getUniqueValueInfos()
          Returns the list of UniqueValueInfos.
 void setDefaultLabel(java.lang.String defaultLabel)
          Sets the default label.
 void setDefaultSymbol(WebSymbol defaultSymbol)
          Sets the default symbol.
 void setField1(java.lang.String field1)
          Sets the name of the first field.
 void setField2(java.lang.String field2)
          Sets the name of the second field.
 void setField3(java.lang.String field3)
          Sets the name of the third field.
 void setFieldDelimiter(java.lang.String fieldDelimiter)
          Sets the field delimiter.
 void setUniqueValueInfos(java.util.List<? extends WebUniqueValueInfo> uniqueValueInfos)
          Sets the list of UniqueValueInfos.
 void setUniquValueInfos(java.util.List<? extends WebUniqueValueInfo> uniqueValueInfos)
          Deprecated. replaced by setUniqueValueInfos(List)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebUniqueValueRenderer

public WebUniqueValueRenderer()
Method Detail

getType

public java.lang.String getType()
Returns the type of the renderer as "Unique Value Renderer"

Specified by:
getType in interface WebRenderer
Returns:
the string representation of renderer type

setUniqueValueInfos

public void setUniqueValueInfos(java.util.List<? extends WebUniqueValueInfo> uniqueValueInfos)
Sets the list of UniqueValueInfos.

Parameters:
uniqueValueInfos - the list of UniqueValueInfos

getUniqueValueInfos

public java.util.List<WebUniqueValueInfo> getUniqueValueInfos()
Returns the list of UniqueValueInfos.

Returns:
the list of UniqueValueInfos

setDefaultLabel

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

Parameters:
defaultLabel - the default label to be used in TOC

getDefaultLabel

public java.lang.String getDefaultLabel()
Returnds the default label.

Returns:
the default label

setDefaultSymbol

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

Parameters:
defaultSymbol - the default symbol

getDefaultSymbol

public WebSymbol getDefaultSymbol()
Returns the default symbol.

Returns:
the default symbol

setField1

public void setField1(java.lang.String field1)
Sets the name of the first field.

Parameters:
field1 - the name of the first field

getField1

public java.lang.String getField1()
Returns the name of the first field.

Returns:
the name of the first field

setField2

public void setField2(java.lang.String field2)
Sets the name of the second field.

Parameters:
field2 - the name of the first field

getField2

public java.lang.String getField2()
Returns the name of the second field.

Returns:
the name of the second field

setField3

public void setField3(java.lang.String field3)
Sets the name of the third field.

Parameters:
field3 - the name of the first field

getField3

public java.lang.String getField3()
Returns the name of the third field.

Returns:
the name of the third field

setFieldDelimiter

public void setFieldDelimiter(java.lang.String fieldDelimiter)
Sets the field delimiter.

Parameters:
fieldDelimiter - the field delimiter

getFieldDelimiter

public java.lang.String getFieldDelimiter()
Returns the field delimiter.

Returns:
a field delimiter

setUniquValueInfos

@Deprecated
public void setUniquValueInfos(java.util.List<? extends WebUniqueValueInfo> uniqueValueInfos)
Deprecated. replaced by setUniqueValueInfos(List)