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. This renderer symbolizes based on discrete ranges of values.

See Also:
Serialized Form

Field Summary
static String TYPE
           
 
Constructor Summary
ClassBreaksRenderer()
          Default constructor.
ClassBreaksRenderer(org.codehaus.jackson.JsonNode node)
          Creates a renderer from a JSON node.
ClassBreaksRenderer(Symbol defaultSymbol, String attribute)
          Creates a renderer with a default symbol and the name of the attribute value being used.
 
Method Summary
 void addBreak(ClassBreakInfo classBreak)
          Adds a class break to the renderer.
 void addBreak(double minValue, double maxValue, Symbol symbol)
          Adds a class break to the renderer.
 String getAttributeName()
          Gets the name of the attribute being used by this renderer.
 ArrayList<ClassBreakInfo> getClassBreaks()
          Gets the breaks in this renderer.
 String getDefaultLabel()
          Gets the default label.
 Symbol getDefaultSymbol()
          Gets the default symbol for the renderer.
 double getMinimumValue()
          Gets the minimu value.
 String getNormalizationField()
           
 double getNormalizationTotal()
           
 NormalizationType getNormalizationType()
           
 Symbol getSymbol(Graphic graphic)
          Subclasses must override this method.
 boolean hasOverlaps()
          Checks to see if any breaks overlap.
 void removeAll()
          Removes all the breaks from the renderer.
 void removeBreak(ClassBreakInfo classBreak)
          Remove a break from the renderer.
 void setAttributeName(String attribute)
          Sets the attribute name being used.
 void setDefaultLabel(String label)
          Sets the default label.
 void setDefaultSymbol(Symbol symbol)
          Sets the default symbol for the renderer.
 void setMinimumValue(double value)
          Sets the minimum value.
 void setNormalizeField(String _normalizeField)
           
 void setNormalizeTotal(double _normalizeTotal)
           
 void setNormalizeType(NormalizationType _normalizeType)
           
 String toJson()
          Converts into a JSON string.
 
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
See Also:
Constant Field Values
Constructor Detail

ClassBreaksRenderer

public ClassBreaksRenderer()
Default constructor.


ClassBreaksRenderer

public ClassBreaksRenderer(Symbol defaultSymbol,
                           String attribute)
Creates a renderer with a default symbol and the name of the attribute value being used.

Parameters:
defaultSymbol - The default symbol.
attribute - The name of the attribute used.

ClassBreaksRenderer

public ClassBreaksRenderer(org.codehaus.jackson.JsonNode node)
                    throws Exception
Creates a renderer from a JSON node.

Parameters:
node - The JSON node.
Throws:
Exception
Method Detail

addBreak

public void addBreak(ClassBreakInfo classBreak)
Adds a class break to the renderer.

Parameters:
classBreak - The break to add.

addBreak

public void addBreak(double minValue,
                     double maxValue,
                     Symbol symbol)
Adds a class break to the renderer.

Parameters:
minValue - The minimum value of the break.
maxValue - The maximum value of the break.
symbol - The symbol to use for this break.

removeBreak

public void removeBreak(ClassBreakInfo classBreak)
Remove a break from the renderer.

Parameters:
classBreak - The break to remove.

getSymbol

public Symbol getSymbol(Graphic graphic)
Description copied from interface: Renderer
Subclasses must override this method. You wouldn't typically work with this method unless you need to create your own renderer.

Specified by:
getSymbol in interface Renderer<Graphic>
Parameters:
graphic - The Graphic to symbolize.
Returns:
the symbol based on the properties of the graphic.

getAttributeName

public String getAttributeName()
Gets the name of the attribute being used by this renderer.

Returns:
The attribute name.

setAttributeName

public void setAttributeName(String attribute)
Sets the attribute name being used.

Parameters:
attribute - The attribute name.

getMinimumValue

public double getMinimumValue()
Gets the minimu value.

Returns:
the minimu value

setMinimumValue

public void setMinimumValue(double value)
Sets the minimum value.

Parameters:
value - the new minimum value

setDefaultLabel

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

Parameters:
label - the new default label

getDefaultLabel

public String getDefaultLabel()
Gets the default label.

Returns:
the default label

setDefaultSymbol

public void setDefaultSymbol(Symbol symbol)
Sets the default symbol for the renderer. This symbol is used when no break matches a graphic's attribute.

Parameters:
symbol - The symbol to set.

getDefaultSymbol

public Symbol getDefaultSymbol()
Gets the default symbol for the renderer. This symbol is used when no break matches a graphic's attribute.

Returns:
The symbol.

getClassBreaks

public ArrayList<ClassBreakInfo> getClassBreaks()
Gets the breaks in this renderer.

Returns:
A list of the breaks in this renderer.

setNormalizeType

public void setNormalizeType(NormalizationType _normalizeType)

getNormalizationType

public NormalizationType getNormalizationType()

setNormalizeField

public void setNormalizeField(String _normalizeField)

getNormalizationField

public String getNormalizationField()

setNormalizeTotal

public void setNormalizeTotal(double _normalizeTotal)

getNormalizationTotal

public double getNormalizationTotal()

hasOverlaps

public boolean hasOverlaps()
Checks to see if any breaks overlap.

Returns:
True if there are overlapping breaks

removeAll

public void removeAll()
Removes all the breaks from the renderer. Does not change the attribute name or default symbol.


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.