com.bbn.openmap.omGraphics.grid
Class ColoredShadingColors

java.lang.Object
  extended by com.bbn.openmap.omGraphics.grid.ColoredShadingColors
All Implemented Interfaces:
ElevationColors

public class ColoredShadingColors
extends java.lang.Object
implements ElevationColors

A holder for handling colors for elevations. This ElevationColors object also takes into account slope when providing pixel int values.


Nested Class Summary
static class ColoredShadingColors.ColorHelper
          A helper class that associates an int color value with an elevation.
 
Field Summary
protected  ColoredShadingColors.ColorHelper[] colors
           
 int[] DEFAULT_COLOR_CUTOFFS
           
 int[] DEFAULT_COLORS
           
protected  int slopeColorAdjustment
          Slope color adjustment, gets subtracted from the color for slopes of zerp or less.
 java.awt.Color waterColor
           
 
Constructor Summary
ColoredShadingColors()
           
ColoredShadingColors(ColoredShadingColors.ColorHelper[] colors)
          Constructor to provide unique elevation cutoffs and colors.
 
Method Summary
 ColoredShadingColors.ColorHelper[] createDefaultColors()
           
 int getARGB(int elevation, Length units, double slope)
          Get the int argb value for a given elevation, with the provided units.
 java.awt.Color getColor(int elevation, Length units, double slope)
          Get the Color for the given elevation, with the provided units.
 ColoredShadingColors.ColorHelper[] getColors()
          Get an array of colors with elevation values.
 int[] getColortable()
          Get a colortable as an array of ints.
 int getSlopeColorAdjustment()
           
 java.awt.Color getWaterColor()
          Get the color to use for water/invalid data, zero elevation.
 void setColors(ColoredShadingColors.ColorHelper[] clrs)
          Set the list of ColorHelpers.
 void setSlopeColorAdjustment(int adj)
          Set the color factor to subtract from the colors for level or negative slopes.
 void setWaterColor(java.awt.Color water)
          Set the color to use for water/invalid data, zero elevation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

colors

protected ColoredShadingColors.ColorHelper[] colors

waterColor

public java.awt.Color waterColor

DEFAULT_COLOR_CUTOFFS

public final int[] DEFAULT_COLOR_CUTOFFS

DEFAULT_COLORS

public final int[] DEFAULT_COLORS

slopeColorAdjustment

protected int slopeColorAdjustment
Slope color adjustment, gets subtracted from the color for slopes of zerp or less. Default is 0x0a0a0a.

Constructor Detail

ColoredShadingColors

public ColoredShadingColors()

ColoredShadingColors

public ColoredShadingColors(ColoredShadingColors.ColorHelper[] colors)
Constructor to provide unique elevation cutoffs and colors.

Method Detail

setSlopeColorAdjustment

public void setSlopeColorAdjustment(int adj)
Set the color factor to subtract from the colors for level or negative slopes. Should be the same for each byte, or the colors will change drastically.


getSlopeColorAdjustment

public int getSlopeColorAdjustment()

getColors

public ColoredShadingColors.ColorHelper[] getColors()
Get an array of colors with elevation values.


setColors

public void setColors(ColoredShadingColors.ColorHelper[] clrs)
Set the list of ColorHelpers. The elevations of the ColorHelpers should be in order, from lowest to highest.


getColortable

public int[] getColortable()
Description copied from interface: ElevationColors
Get a colortable as an array of ints.

Specified by:
getColortable in interface ElevationColors

setWaterColor

public void setWaterColor(java.awt.Color water)
Set the color to use for water/invalid data, zero elevation.


getWaterColor

public java.awt.Color getWaterColor()
Get the color to use for water/invalid data, zero elevation.


getColor

public java.awt.Color getColor(int elevation,
                               Length units,
                               double slope)
Get the Color for the given elevation, with the provided units. The slope of the land, from the northwest to the southeast, is provided.

Specified by:
getColor in interface ElevationColors

getARGB

public int getARGB(int elevation,
                   Length units,
                   double slope)
Get the int argb value for a given elevation, with the provided units. The slope of the land, from the northwest to the southeast, is provided in case that should matter. It's not used in this version of the algorithm.

Specified by:
getARGB in interface ElevationColors

createDefaultColors

public ColoredShadingColors.ColorHelper[] createDefaultColors()


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details