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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WebUniqueValueRenderer
public WebUniqueValueRenderer()
getType
public 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(List<? extends WebUniqueValueInfo> uniqueValueInfos)
- Sets the list of
UniqueValueInfo
s.
- Parameters:
uniqueValueInfos
- the list of UniqueValueInfo
s
getUniqueValueInfos
public List<WebUniqueValueInfo> getUniqueValueInfos()
- Returns the list of
UniqueValueInfo
s.
- Returns:
- the list of
UniqueValueInfo
s
setDefaultLabel
public void setDefaultLabel(String defaultLabel)
- Sets the default label.
- Parameters:
defaultLabel
- the default label to be used in TOC
getDefaultLabel
public 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(String field1)
- Sets the name of the first field.
- Parameters:
field1
- the name of the first field
getField1
public String getField1()
- Returns the name of the first field.
- Returns:
- the name of the first field
setField2
public void setField2(String field2)
- Sets the name of the second field.
- Parameters:
field2
- the name of the first field
getField2
public String getField2()
- Returns the name of the second field.
- Returns:
- the name of the second field
setField3
public void setField3(String field3)
- Sets the name of the third field.
- Parameters:
field3
- the name of the first field
getField3
public String getField3()
- Returns the name of the third field.
- Returns:
- the name of the third field
setFieldDelimiter
public void setFieldDelimiter(String fieldDelimiter)
- Sets the field delimiter.
- Parameters:
fieldDelimiter
- the field delimiter
getFieldDelimiter
public String getFieldDelimiter()
- Returns the field delimiter.
- Returns:
- a field delimiter
setUniquValueInfos
@Deprecated
public void setUniquValueInfos(List<? extends WebUniqueValueInfo> uniqueValueInfos)
- Deprecated. replaced by
setUniqueValueInfos(List)
clearValues
public void clearValues()
addValues
public void addValues(List<? extends String> values)
render
public void render(List<? extends WebGeometry> geometries,
WebElementConverter converter)
throws Exception
- Description copied from interface:
WebActiveRenderer
- Applies the rendering strategy of this renderer to the passed geometries.
- Specified by:
render
in interface WebActiveRenderer
- Parameters:
geometries
- a list of geometries to be renderedconverter
- a converter to be used for rendering geometries
- Throws:
Exception
- is thrown if something goes wrong