gistoolkit.display.shader
Class BinShader

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

public class BinShader
extends SimpleShader
implements EditableShader

Shades features in bins of colors. There are a series of bin colors and names such as Low(Yellow) Medium(Green) High(Red). A row is assigned to these different bins based on the values of two columns. The first column determines which entry the row should be assigned to. Given the data Name Value Snuggle 3 nap 6 snore 20 snooze 10 We want to shade the snuggle and nap into entries of yellow, green or red like this Values MinYellow Max Yellow Min Green Max Green Min Red, Max Red snuggle, nap 2 3 3 4 4 10 snore, snooze 5 7 7 12 12 40 With an entry with values of snuggle, map, and the biven ranges along with bins of yellow green and red, this shader could accomplish the shading required.


Constructor Summary
BinShader()
          Creates new BinShader
 
Method Summary
 void addBin(java.lang.String inBinName, java.awt.Color inBinColor)
          Add a bin to the list of available bins.
 void addEntry(java.lang.String[] inValues, double[] inMinValues, double[] inMaxValues)
          Adds an entry to the list.
 java.awt.Color[] getBinColors()
          Returns all the BinColors
 java.lang.String getBinColumnName()
          Get the name of the column to shade by
 java.lang.String[] getBinNames()
          Returns all the Bin Names
 ShaderPanel getEditPanel()
          return the panel needed to edit this shader
 BinEntry[] getEntries()
          Returns all the entries in the shader.
 java.awt.Graphics getFillGraphics(java.awt.Graphics inGraphics, java.lang.Object[] inAttributes, java.lang.String[] inNames)
          Set up the graphics context for the filling of shapes.
 java.awt.image.BufferedImage getLegend()
          Generate a lagend from this shader.
 Node getNode()
          Get the configuration information for this shader
 java.lang.String getValueColumnName()
          Get the name of the column to shade by
 void removeAllBins()
          Remove all bins.
 void removeAllEntries()
          remove all entries from the shader.
 boolean removeBin(java.lang.String inBinName)
          Looks through the list of bins and tries to find the one with this name.
 void setBinColumnName(java.lang.String inBinColumnName)
          Set the name of the column to shade by
 void setNode(Node inNode)
          Set the configuration information for this shader
 void setValueColumnName(java.lang.String inValueColumnName)
          Set the name of the column to shade by
 
Methods inherited from class gistoolkit.display.shader.SimpleShader
getAlpha, getColumnName, getDashArrayFromString, getDefaultAlphaComposite, getDefaultFillColor, getDefaultFont, getDefaultHighlightColor, getDefaultLabelColor, getDefaultLineColor, getDescription, getEditDialog, getFillHighlightGraphics, getLabelGraphics, getLabelHighlightGraphics, getLineGraphics, getLineHighlightGraphics, getName, getNodeFromStroke, getStringFromDashArray, getStroke, getStrokeFromNode, load, setAlpha, setColumnName, 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

BinShader

public BinShader()
Creates new BinShader

Method Detail

getValueColumnName

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


setValueColumnName

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


getBinColumnName

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


setBinColumnName

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


getBinNames

public java.lang.String[] getBinNames()
Returns all the Bin Names


getBinColors

public java.awt.Color[] getBinColors()
Returns all the BinColors


getEntries

public BinEntry[] getEntries()
Returns all the entries in the shader.


removeAllEntries

public void removeAllEntries()
remove all entries from the shader.


removeAllBins

public void removeAllBins()
Remove all bins.


addBin

public void addBin(java.lang.String inBinName,
                   java.awt.Color inBinColor)
Add a bin to the list of available bins.


removeBin

public boolean removeBin(java.lang.String inBinName)
Looks through the list of bins and tries to find the one with this name. If this one is found, then it will be deleted and a value of true will be returned.


addEntry

public void addEntry(java.lang.String[] inValues,
                     double[] inMinValues,
                     double[] inMaxValues)
Adds an entry to the list. Entries have matching criteria, and high and low values.


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

getFillGraphics

public java.awt.Graphics getFillGraphics(java.awt.Graphics inGraphics,
                                         java.lang.Object[] inAttributes,
                                         java.lang.String[] inNames)
Description copied from class: SimpleShader
Set up the graphics context for the filling of shapes. 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

getEditPanel

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

Specified by:
getEditPanel in interface EditableShader