gistoolkit.display.shader
Class MonoShader

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

public class MonoShader
extends java.lang.Object
implements Shader, EditableShader

A shader that will always return the same color regardless of what values are sent in.


Constructor Summary
MonoShader()
          Create a new Mono shader with the default values for everything.
MonoShader(java.awt.Color inColor)
          MonoShader constructor comment.
MonoShader(java.awt.Color inLineColor, java.awt.Color inFillColor)
          Create a new Mono Shader with the given Line and Fill colors, the label color is the same as the line color, and the highlight color is the default.
MonoShader(java.awt.Color inLineColor, java.awt.Color inFillColor, java.awt.Color inHighlightColor)
          Create a new Mono Shader with the given line, fill and highlight colors, the label color is the same as the line color.
MonoShader(java.awt.Color inLineColor, java.awt.Color inFillColor, java.awt.Color inHighlightColor, java.awt.Color inLabelColor)
          Create a new Mono Shader with the given line, fill highlight and Label colors.
 
Method Summary
 float getAlpha()
          Retrieve the alpha of the shape 0 is clear, 1 is opaque.
 ShaderPanel getEditPanel()
          Returns a new edit panel for editing this type of shader.
 java.awt.Color getFillColor()
          Color to use when filling a shape
 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.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.image.BufferedImage getFillPattern()
          Get the pattern to use when filling a polygon.
 java.lang.String getFillPatternFileName()
          Get the file name of the fill pattern.
 java.awt.Color getHighlightColor()
          Color to use when highlighting a selected shape
 java.awt.Color getLabelColor()
          Returns the color this MonoShader will use for displaying a label.
 java.awt.Font getLabelFont()
          Return the font to use when displaying the label.
 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()
          Generate the legend for this shader.
 java.awt.Color getLineColor()
          Color to use when drawing lines
 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()
          Retrieve the name of the shader
 Node getNode()
          Get the configuration information for this shader
 java.awt.Stroke getStroke()
          Return the stroke for this shader.
 void load(java.util.Properties inProperties)
          Read the properties for the initialization of the shader from the properties sent in.
 void setAlpha(float inAlpha)
          Set the alpha of the shape 0 means clear, 1 means opaque.
 void setFillColor(java.awt.Color inFillColor)
          Sets the color to use when filling a shape
 void setFillPattern(java.awt.image.BufferedImage inFillPattern)
          Sets the color to use when filling a shape
 void setFillPatternFileName(java.lang.String inFileName)
          Set the file name of the fill pattern.
 void setHighlightColor(java.awt.Color inHighlightColor)
          Color to use when highlighting a selected shape
 void setLabelColor(java.awt.Color inLabelColor)
          Sets the color this MonoShader will use for displaying a label.
 void setLabelFont(java.awt.Font inFont)
          Set the font to use when displaying the label.
 void setLineColor(java.awt.Color newLineColor)
          Set the line color to be used when drawing lines
 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

MonoShader

public MonoShader()
Create a new Mono shader with the default values for everything.


MonoShader

public MonoShader(java.awt.Color inColor)
MonoShader constructor comment.


MonoShader

public MonoShader(java.awt.Color inLineColor,
                  java.awt.Color inFillColor)
Create a new Mono Shader with the given Line and Fill colors, the label color is the same as the line color, and the highlight color is the default.


MonoShader

public MonoShader(java.awt.Color inLineColor,
                  java.awt.Color inFillColor,
                  java.awt.Color inHighlightColor)
Create a new Mono Shader with the given line, fill and highlight colors, the label color is the same as the line color.


MonoShader

public MonoShader(java.awt.Color inLineColor,
                  java.awt.Color inFillColor,
                  java.awt.Color inHighlightColor,
                  java.awt.Color inLabelColor)
Create a new Mono Shader with the given line, fill highlight and Label colors.

Method Detail

getLineColor

public java.awt.Color getLineColor()
Color to use when drawing lines


setLineColor

public void setLineColor(java.awt.Color newLineColor)
Set the line color to be used when drawing lines


getFillColor

public java.awt.Color getFillColor()
Color to use when filling a shape


setFillColor

public void setFillColor(java.awt.Color inFillColor)
Sets the color to use when filling a shape


getFillPattern

public java.awt.image.BufferedImage getFillPattern()
Get the pattern to use when filling a polygon.


setFillPattern

public void setFillPattern(java.awt.image.BufferedImage inFillPattern)
Sets the color to use when filling a shape


getFillPatternFileName

public java.lang.String getFillPatternFileName()
Get the file name of the fill pattern. This returns the location of the file.


setFillPatternFileName

public void setFillPatternFileName(java.lang.String inFileName)
                            throws java.lang.Exception
Set the file name of the fill pattern. This will load the file and use it. An exception will be thrown if the file is the wrong format, or not available.

Throws:
java.lang.Exception

getHighlightColor

public java.awt.Color getHighlightColor()
Color to use when highlighting a selected shape


setHighlightColor

public void setHighlightColor(java.awt.Color inHighlightColor)
Color to use when highlighting a selected shape


getLabelColor

public java.awt.Color getLabelColor()
Returns the color this MonoShader will use for displaying a label.


setLabelColor

public void setLabelColor(java.awt.Color inLabelColor)
Sets the color this MonoShader will use for displaying a label.


getLabelFont

public java.awt.Font getLabelFont()
Return the font to use when displaying the label.


setLabelFont

public void setLabelFont(java.awt.Font inFont)
Set the font to use when displaying the label.


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.


getName

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


setName

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


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.


getEditPanel

public ShaderPanel getEditPanel()
Returns a new edit panel for editing this type of shader.

Specified by:
getEditPanel in interface EditableShader

load

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

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

getLegend

public java.awt.image.BufferedImage getLegend()
Generate the legend for this shader. The MonoShader only creates one entry in the legend.

Specified by:
getLegend in interface Shader

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 drawing of lines. 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

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