com.esri.core.renderer
Class ClassBreaksRenderer

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

public class ClassBreaksRenderer
extends Object
implements Renderer<Graphic>

A class breaks renderer symbolizes each graphic based on the value of some numeric attribute. Graphics with similar values for the attribute get the same symbol. The "breaks" define the values at which the symbology changes.Each break has a value range determined by its maximum value and implicit minimum value.

For example, suppose you have a "buildings" layer with an attribute that defines the building age. You want to symbolize buildings constructed since the year 2000 in green, buildings constructed between 1980 and 2000 in yellow, and buildings built before 1980 with red. This would be a good scenario for a class breaks renderer.

See Also:
Serialized Form

Field Summary
static String TYPE
           
 
Constructor Summary
ClassBreaksRenderer()
           
ClassBreaksRenderer(org.codehaus.jackson.JsonNode node)
          Instantiates ClassBreaksRenderer from a Json node object
 
Method Summary
 boolean addClassBreak(ClassBreak classbreak)
          Adds a class break.
 TreeMap<Double,ClassBreak> getClassBreakInfos()
          Returns a TreeMap object in which class break's maximum value maps to class break.
 String getField()
          Gets the attribute field used by renderer to match values.
 double getMinValue()
          Gets the minimum value.
 Symbol getSymbol(Graphic graphic)
          Returns the symbol of the class break the graphic provided belongs to.
 boolean removeClassBreak(ClassBreak classbreak)
          Removes a class break.
 void setClassBreakInfos(TreeMap<Double,ClassBreak> classBreakInfos)
          Sets class break information map.
 void setField(String field)
          Sets the attribute field used by renderer to match values.
 void setMinValue(double minValue)
          Sets minimum value
 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

ClassBreaksRenderer

public ClassBreaksRenderer()

ClassBreaksRenderer

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

Throws:
Exception
Method Detail

getSymbol

public Symbol getSymbol(Graphic graphic)
Returns the symbol of the class break the graphic provided belongs 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.

getField

public String getField()
Gets the attribute field used by renderer to match values.

Returns:
the field.

setField

public void setField(String field)
Sets the attribute field used by renderer to match values.

Parameters:
field - the field to set

getMinValue

public double getMinValue()
Gets the minimum value.

Returns:
the minimum value.

setMinValue

public void setMinValue(double minValue)
Sets minimum value

Parameters:
minValue - the minimum value to set

getClassBreakInfos

public TreeMap<Double,ClassBreak> getClassBreakInfos()
Returns a TreeMap object in which class break's maximum value maps to class break.

Returns:
the class breaks information map.

setClassBreakInfos

public void setClassBreakInfos(TreeMap<Double,ClassBreak> classBreakInfos)
Sets class break information map.

Parameters:
classBreakInfos - a TreeMap object in which class break's maximum value maps to class break.

addClassBreak

public boolean addClassBreak(ClassBreak classbreak)
Adds a class break.

Parameters:
classbreak - a class break.

removeClassBreak

public boolean removeClassBreak(ClassBreak classbreak)
Removes a class break.

Parameters:
classbreak - a class break.
Returns:
true if the class break is removed successfully.

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.