gistoolkit.display.shader
Class SimpleShader

java.lang.Object
  extended bygistoolkit.display.shader.SimpleShader
All Implemented Interfaces:
Shader
Direct Known Subclasses:
BinShader, RandomShader, RangeShader

public class SimpleShader
extends java.lang.Object
implements Shader

A simple shader to handle the simplest case. Usefull for extending.


Constructor Summary
SimpleShader()
          Creates new SimpleShader
 
Method Summary
 float getAlpha()
          Retrieve the alpha of the shape 0 is clear, 1 is opaque.
 java.lang.String getColumnName()
          Get the name of the column to shade by
protected  float[] getDashArrayFromString(java.lang.String inString)
          Construct the dash array from the string that saves it to configuration.
protected  java.awt.AlphaComposite getDefaultAlphaComposite()
          Return the default alpha composite
 java.awt.Color getDefaultFillColor()
          Retrieve the default fill color
 java.awt.Font getDefaultFont()
          Get the font to be used when writing labels
 java.awt.Color getDefaultHighlightColor()
          Retrieve the default Highligh color
 java.awt.Color getDefaultLabelColor()
          Retrieve the default fill color
 java.awt.Color getDefaultLineColor()
          Retrieve the default fill color
 java.lang.String getDescription()
          A description to be displayed to the user that indicates what this scale bar does.
 ShaderEditDialog getEditDialog()
          Each shader should have a dialog to display to edit 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.Graphics getFillHighlightGraphics(java.awt.Graphics inGraphics, java.lang.Object[] inAttributes, java.lang.String[] inNames)
          Set up the graphics context for the drawing of lines.
 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 lines.
 java.awt.Graphics getLabelHighlightGraphics(java.awt.Graphics inGraphics, java.lang.Object[] inAttributes, java.lang.String[] inNames)
          Set up the graphics context for the drawing of lines.
 java.awt.image.BufferedImage getLegend()
          Return the Legend for this shader
 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.
 java.awt.Graphics getLineHighlightGraphics(java.awt.Graphics inGraphics, java.lang.Object[] inAttributes, java.lang.String[] inNames)
          Set up the graphics context for the highlighting of lines.
 java.lang.String getName()
          Get the name of the shader
 Node getNode()
          Get the configuration information for this shader
protected  Node getNodeFromStroke(java.awt.Stroke inStroke)
           
protected  java.lang.String getStringFromDashArray(float[] inDashArray)
          Construct the string for saving the dash array from the array sent in.
 java.awt.Stroke getStroke()
          Return the stroke for this shader.
protected  java.awt.Stroke getStrokeFromNode(Node inNode)
           
 void load(java.util.Properties inProperties)
          Read the properties for the initialization of the rendere from the properties sent in.
 void setAlpha(float inAlpha)
          Set the alpha of the shape 0 means clear, 1 means opaque.
 void setColumnName(java.lang.String inColumnName)
          Set the name of the column to shade by
 void setDefaultFillColor(java.awt.Color inColor)
          Set the default fill color
 void setDefaultFont(java.awt.Font inFont)
          Set the font to be used when writing labels
 void setDefaultHighlightColor(java.awt.Color inColor)
          Set the default Highligh color
 void setDefaultLabelColor(java.awt.Color inColor)
          Set the default fill color
 void setDefaultLineColor(java.awt.Color inColor)
          Set the default fill color
 void setName(java.lang.String inName)
          Set the name of the shader
 void setNode(Node inNode)
          Set the configuration information for this shader
 void setStroke(java.awt.Stroke inStroke)
          Sets the stroke for this shader, will not allow null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleShader

public SimpleShader()
Creates new SimpleShader

Method Detail

getDescription

public java.lang.String getDescription()
A description to be displayed to the user that indicates what this scale bar does. A good thing to indicates is that it takes a projection in meters and displays a scale in metric. Or that it takes a projection in feed and displays a scale in in,ft,yd,and miles.


getDefaultFillColor

public java.awt.Color getDefaultFillColor()
Retrieve the default fill color


setDefaultFillColor

public void setDefaultFillColor(java.awt.Color inColor)
Set the default fill color


getDefaultLineColor

public java.awt.Color getDefaultLineColor()
Retrieve the default fill color


setDefaultLineColor

public void setDefaultLineColor(java.awt.Color inColor)
Set the default fill color


getDefaultLabelColor

public java.awt.Color getDefaultLabelColor()
Retrieve the default fill color


setDefaultLabelColor

public void setDefaultLabelColor(java.awt.Color inColor)
Set the default fill color


getDefaultHighlightColor

public java.awt.Color getDefaultHighlightColor()
Retrieve the default Highligh color


setDefaultHighlightColor

public void setDefaultHighlightColor(java.awt.Color inColor)
Set the default Highligh color


getName

public java.lang.String getName()
Get the name of the shader


setName

public void setName(java.lang.String inName)
Set the name of the shader


getColumnName

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


setColumnName

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


getDefaultFont

public java.awt.Font getDefaultFont()
Get the font to be used when writing labels


setDefaultFont

public void setDefaultFont(java.awt.Font inFont)
Set the font to be used when writing labels


getDefaultAlphaComposite

protected java.awt.AlphaComposite getDefaultAlphaComposite()
Return the default alpha composite


getAlpha

public float getAlpha()
Retrieve the alpha of the shape 0 is clear, 1 is opaque.


setAlpha

public void setAlpha(float inAlpha)
Set the alpha of the shape 0 means clear, 1 means opaque.


getStroke

public java.awt.Stroke getStroke()
Return the stroke for this shader.


setStroke

public void setStroke(java.awt.Stroke inStroke)
Sets the stroke for this shader, will not allow null.


getEditDialog

public ShaderEditDialog getEditDialog()
Each shader should have a dialog to display to edit the shader. This method will return that dialog.


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

getLineHighlightGraphics

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

Specified by:
getLineHighlightGraphics in interface Shader

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 filling of shapes. Always return the graphics context sent in after modifying it for filling of polygons.

Specified by:
getFillGraphics in interface Shader

getFillHighlightGraphics

public java.awt.Graphics getFillHighlightGraphics(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 highlighting of polygons.

Specified by:
getFillHighlightGraphics in interface Shader

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 lines. Always return the graphics context sent in after modifying it for labeling of features.

Specified by:
getLabelGraphics in interface Shader

getLabelHighlightGraphics

public java.awt.Graphics getLabelHighlightGraphics(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 highlighting of features.

Specified by:
getLabelHighlightGraphics in interface Shader

load

public void load(java.util.Properties inProperties)
          throws java.lang.Exception
Read the properties for the initialization of the rendere from the properties sent in.

Specified by:
load in interface Shader
Throws:
java.lang.Exception

getLegend

public java.awt.image.BufferedImage getLegend()
Return the Legend for this shader

Specified by:
getLegend in interface Shader

getNodeFromStroke

protected Node getNodeFromStroke(java.awt.Stroke inStroke)

getStringFromDashArray

protected java.lang.String getStringFromDashArray(float[] inDashArray)
Construct the string for saving the dash array from the array sent in.


getDashArrayFromString

protected float[] getDashArrayFromString(java.lang.String inString)
Construct the dash array from the string that saves it to configuration. The string is a pipe | delimited list of float values that are used to determine which segments of a line are drawn and which ones are not.


getStrokeFromNode

protected java.awt.Stroke getStrokeFromNode(Node inNode)

getNode

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

Specified by:
getNode in interface Shader

setNode

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

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