com.esri.core.internal.value
Class AlgorithmicColorRamp

java.lang.Object
  extended by com.esri.core.internal.value.ColorRamp
      extended by com.esri.core.internal.value.AlgorithmicColorRamp

public class AlgorithmicColorRamp
extends ColorRamp

This class defines an algorithmically generated color ramp to be used by a server when generating a class breaks or unique value renderer. The color ramp is defined by from and to colors and an algorithm that should be used to generate the intermediate colors.


Constructor Summary
AlgorithmicColorRamp(int from, int to, RampDefinition.Algorithm algorithm)
          Instantiates a new algorithmic color ramp using the given from and to colors and the given algorithm.
AlgorithmicColorRamp(org.codehaus.jackson.JsonNode node)
          Instantiates a new algorithmic color ramp from the given JsonNode.
AlgorithmicColorRamp(RampDefinition rampDefinition)
          Instantiates a new algorithmic color ramp from a given RampDefinition.
 
Method Summary
 RampDefinition.Algorithm getAlgorithm()
          Gets the algorithm used to generate intermediate colors between the from color and the to color.
 int getFromColor()
          Gets the from color.
 int getToColor()
          Gets the to color.
 void setAlgorithm(RampDefinition.Algorithm algorithm)
          Sets the algorithm used to generate intermediate colors between the from color and the to color.
 void setFromColor(int fromColor)
          Sets the from color.
 void setToColor(int toColor)
          Sets the to color.
protected  void toJson(org.codehaus.jackson.JsonGenerator node)
          This method is used by ColorRamp.toJson() to turn this instance into a JSON string.
 
Methods inherited from class com.esri.core.internal.value.ColorRamp
toJson
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlgorithmicColorRamp

public AlgorithmicColorRamp(int from,
                            int to,
                            RampDefinition.Algorithm algorithm)
Instantiates a new algorithmic color ramp using the given from and to colors and the given algorithm.

Parameters:
from - the from color
to - the to color
algorithm - the algorithm used to generate intermediate colors
See Also:
RampDefinition.Algorithm

AlgorithmicColorRamp

public AlgorithmicColorRamp(RampDefinition rampDefinition)
Instantiates a new algorithmic color ramp from a given RampDefinition.

Parameters:
rampDefinition - the ramp definition that will define this color ramp

AlgorithmicColorRamp

public AlgorithmicColorRamp(org.codehaus.jackson.JsonNode node)
Instantiates a new algorithmic color ramp from the given JsonNode.

Parameters:
node - the node defining an algorithmic color ramp
Method Detail

getFromColor

public int getFromColor()
Gets the from color.

Returns:
the from color

setFromColor

public void setFromColor(int fromColor)
Sets the from color.

Parameters:
fromColor - the new from color

getToColor

public int getToColor()
Gets the to color.

Returns:
the to color

setToColor

public void setToColor(int toColor)
Sets the to color.

Parameters:
toColor - the new to color

getAlgorithm

public RampDefinition.Algorithm getAlgorithm()
Gets the algorithm used to generate intermediate colors between the from color and the to color.

Returns:
the algorithm

setAlgorithm

public void setAlgorithm(RampDefinition.Algorithm algorithm)
Sets the algorithm used to generate intermediate colors between the from color and the to color.

Parameters:
algorithm - the new algorithm
See Also:
RampDefinition.Algorithm

toJson

protected void toJson(org.codehaus.jackson.JsonGenerator node)
               throws IOException,
                      org.codehaus.jackson.JsonGenerationException,
                      Exception
Description copied from class: ColorRamp
This method is used by ColorRamp.toJson() to turn this instance into a JSON string.

This method should be overridden in subclasses to add their class data to the given JSON node. Note that this base class method should be called by the override.

Overrides:
toJson in class ColorRamp
Parameters:
node - the node
Throws:
IOException - Signals that an I/O exception has occurred.
org.codehaus.jackson.JsonGenerationException - the json generation exception
Exception - the exception


Copyright © 2012. All Rights Reserved.