gistoolkit.display.shader
Class RangeShader

java.lang.Object
  extended bygistoolkit.display.shader.SimpleShader
      extended bygistoolkit.display.shader.RangeShader
All Implemented Interfaces:
EditableShader, Shader

public class RangeShader
extends SimpleShader
implements EditableShader

Returns a color bassed on a value. If you want a shape shaded based on the numerical value of one of it's attributes in the following scheme. < 20 is one color, < 40 is another color, < 60 is another color, everything else is the default color. then this shader should work.


Constructor Summary
RangeShader()
          Creates new RangeShader
 
Method Summary
 void addColor(double inMinValue, double inMaxValue, java.awt.Color inFillColor, java.awt.Color inLineColor, java.awt.Color inLabelColor)
          add another color to the list null colors will not be drawn
 java.lang.String getColumnName()
          Get the name of the column to shade by
 ShaderPanel getEditPanel()
          return the panel needed to edit this shader
 java.awt.Color[] getFillColors()
          return the list of fill colors
 java.awt.Graphics getFillGraphics(java.awt.Graphics inGraphics, java.lang.Object[] inAttributes, java.lang.String[] inNames)
          Set up the graphics context for the drawing of lines.
 java.awt.Color[] getLabelColors()
          return the list of Label colors
 java.awt.Graphics getLabelGraphics(java.awt.Graphics inGraphics, java.lang.Object[] inAttributes, java.lang.String[] inNames)
          Set up the graphics context for the drawing of labels.
 java.awt.image.BufferedImage getLegend()
          Generate a lagend from this shader.
 java.awt.Color[] getLineColors()
          return the list of line colors
 java.awt.Graphics getLineGraphics(java.awt.Graphics inGraphics, java.lang.Object[] inAttributes, java.lang.String[] inNames)
          Set up the graphics context for the drawing of lines.
 double[] getMaxValues()
          return the list of maximumvalues, and the list of doubles
 double[] getMinValues()
          return the list of minimum values, and the list of doubles
 Node getNode()
          Get the configuration information for this shader
 void removeAllEntries()
          Removes all entries from the shader
 void setColumnName(java.lang.String inColumnName)
          Set the name of the column to shade by
 void setNode(Node inNode)
          Set the configuration information for this shader
 
Methods inherited from class gistoolkit.display.shader.SimpleShader
getAlpha, getDashArrayFromString, getDefaultAlphaComposite, getDefaultFillColor, getDefaultFont, getDefaultHighlightColor, getDefaultLabelColor, getDefaultLineColor, getDescription, getEditDialog, getFillHighlightGraphics, getLabelHighlightGraphics, getLineHighlightGraphics, getName, getNodeFromStroke, getStringFromDashArray, getStroke, getStrokeFromNode, load, setAlpha, setDefaultFillColor, setDefaultFont, setDefaultHighlightColor, setDefaultLabelColor, setDefaultLineColor, setName, setStroke
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RangeShader

public RangeShader()
Creates new RangeShader

Method Detail

removeAllEntries

public void removeAllEntries()
Removes all entries from the shader


addColor

public void addColor(double inMinValue,
                     double inMaxValue,
                     java.awt.Color inFillColor,
                     java.awt.Color inLineColor,
                     java.awt.Color inLabelColor)
add another color to the list null colors will not be drawn


getMinValues

public double[] getMinValues()
return the list of minimum values, and the list of doubles


getMaxValues

public double[] getMaxValues()
return the list of maximumvalues, and the list of doubles


getFillColors

public java.awt.Color[] getFillColors()
return the list of fill colors


getLineColors

public java.awt.Color[] getLineColors()
return the list of line colors


getLabelColors

public java.awt.Color[] getLabelColors()
return the list of Label colors


getColumnName

public java.lang.String getColumnName()
Get the name of the column to shade by

Overrides:
getColumnName in class SimpleShader

setColumnName

public void setColumnName(java.lang.String inColumnName)
Set the name of the column to shade by

Overrides:
setColumnName in class SimpleShader

getEditPanel

public ShaderPanel getEditPanel()
return the panel needed to edit this shader

Specified by:
getEditPanel in interface EditableShader

getLineGraphics

public java.awt.Graphics getLineGraphics(java.awt.Graphics inGraphics,
                                         java.lang.Object[] inAttributes,
                                         java.lang.String[] inNames)
Set up the graphics context for the drawing of lines. Always return the graphics context sent in after modifying it for drawing of lines.

Specified by:
getLineGraphics in interface Shader
Overrides:
getLineGraphics in class SimpleShader

getFillGraphics

public java.awt.Graphics getFillGraphics(java.awt.Graphics inGraphics,
                                         java.lang.Object[] inAttributes,
                                         java.lang.String[] inNames)
Set up the graphics context for the drawing of lines. Always return the graphics context sent in after modifying it for filling of polygons.

Specified by:
getFillGraphics in interface Shader
Overrides:
getFillGraphics in class SimpleShader

getLabelGraphics

public java.awt.Graphics getLabelGraphics(java.awt.Graphics inGraphics,
                                          java.lang.Object[] inAttributes,
                                          java.lang.String[] inNames)
Set up the graphics context for the drawing of labels. Always return the graphics context sent in after modifying it for labeling of features.

Specified by:
getLabelGraphics in interface Shader
Overrides:
getLabelGraphics in class SimpleShader

getLegend

public java.awt.image.BufferedImage getLegend()
Generate a lagend from this shader. The RangeShader creates an entry for every entry in the list.

Specified by:
getLegend in interface Shader
Overrides:
getLegend in class SimpleShader

getNode

public Node getNode()
Get the configuration information for this shader

Specified by:
getNode in interface Shader
Overrides:
getNode in class SimpleShader

setNode

public void setNode(Node inNode)
             throws java.lang.Exception
Set the configuration information for this shader

Specified by:
setNode in interface Shader
Overrides:
setNode in class SimpleShader
Throws:
java.lang.Exception