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.

Since:
1.0
See Also:
Serialized Form

Field Summary
static String TYPE
          The Constant TYPE.
 
Constructor Summary
ClassBreaksRenderer()
          The Constructor.
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.
 Symbol getDefaultSymbol()
          Gets the default symbol of the ClassBreaksRenderer.
 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 setDefaultSymbol(Symbol defaultSymbol)
          Sets the default symbol of the ClassBreaksRenderer.
 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.
 List<FeatureTemplate> toTemplates(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

ClassBreaksRenderer

public ClassBreaksRenderer()
The Constructor.

Since:
1.0

ClassBreaksRenderer

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

Parameters:
node - the node
Throws:
Exception - the exception
Since:
1.0
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
Since:
1.0

getField

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

Returns:
the field.
Since:
1.0

setField

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

Parameters:
field - the field to set
Since:
1.0

getMinValue

public double getMinValue()
Gets the minimum value.

Returns:
the minimum value.
Since:
1.0

setMinValue

public void setMinValue(double minValue)
Sets minimum value.

Parameters:
minValue - the minimum value to set
Since:
1.0

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.
Since:
1.0

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.
Since:
1.0

addClassBreak

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

Parameters:
classbreak - a class break.
Returns:
true, if adds the class break
Since:
1.0

removeClassBreak

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

Parameters:
classbreak - a class break.
Returns:
true if the class break is removed successfully.
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

toTemplates

public List<FeatureTemplate> toTemplates(Geometry.Type type)
Creates templates out of the renderer.

Parameters:
type - the geometry type. The templates are defined on feature layers, the geometry type is defined on feature layers.
Returns:
the list< feature template>
Since:
1.0

getDefaultSymbol

public Symbol getDefaultSymbol()
Gets the default symbol of the ClassBreaksRenderer. It will be used on the values which in the ranges.

Returns:
Returns the defaultSymbol.

setDefaultSymbol

public void setDefaultSymbol(Symbol defaultSymbol)
Sets the default symbol of the ClassBreaksRenderer. It is null by default.

Parameters:
defaultSymbol - The defaultSymbol to set.


Copyright © 2010. All Rights Reserved.