gistoolkit.display.scalebar
Class SimpleScaleBar

java.lang.Object
  extended bygistoolkit.display.scalebar.SimpleScaleBar
All Implemented Interfaces:
ScaleBar
Direct Known Subclasses:
MeterToEnglishScaleBar, MeterToMetricScaleBar

public abstract class SimpleScaleBar
extends java.lang.Object
implements ScaleBar

Class to display a scale bar on the map.


Field Summary
static int LOWER_LEFT
          The lower left quadrant of the screen.
static int LOWER_RIGHT
          the lower right quadrant of the screen.
static int UPPER_LEFT
          The upper left quadrant of the screen.
static int UPPER_RIGHT
          The upper right quadrant of the screen.
 
Constructor Summary
SimpleScaleBar()
          Creates a new instance of ScaleBar
 
Method Summary
abstract  void drawScale(java.awt.Graphics inGraphics, Converter inConverter, int inWidth, int inHeight)
          Method to draw a scale bar on the graphics context.
 float getAlpha()
          Retrieve the alpha of the shape 0 is clear, 1 is opaque.
 java.awt.Rectangle getAvailableSize(int inScreenWidth, int inScreenHeight)
          Get the available width of the Scale bar
protected  java.awt.AlphaComposite getDefaultAlphaComposite()
          Return the default alpha composite
 java.awt.Font getDefaultFont()
          Get the font to be used when writing labels
 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.
 int getHorizontalOffset()
          Set the offset from the uleft or rightr edge of the screen in pixels.
 java.awt.Graphics getLabelGraphics(java.awt.Graphics inGraphics)
          Set up the graphics context for the drawing of lines.
 java.awt.Graphics getLineGraphics(java.awt.Graphics inGraphics)
          Set up the graphics context for the drawing of lines.
 Node getNode()
          Get the configuration information for this ScaleBar
 int getQuadrant()
          gets the quadrent UPPER_LEFT, UPPER_RIGHT, LOWER_LEFT, LOWER_RIGHT of the screen where the scale bar should be placed.
 float getScreenPercent()
          get what percent of the screen width this bar should use.
 java.awt.Point getStart(int inImageWidth, int inImageHeight, int inWidth, int inHeight)
          Return the start point given the width and height.
 java.awt.Stroke getStroke()
          Return the stroke for this shader.
 int getVerticalOffset()
          Set the offset from the upper or lower edge of the screen in pixels.
 void setAlpha(float inAlpha)
          Set the alpha of the shape 0 means clear, 1 means opaque.
 void setDefaultFont(java.awt.Font inFont)
          Set the font to be used when writing labels
 void setDefaultLabelColor(java.awt.Color inColor)
          Set the default fill color
 void setDefaultLineColor(java.awt.Color inColor)
          Set the default fill color
 void setHorizontalOffset(int inOffset)
          Set the offset from the left or right edge of the screen in pixels.
 void setNode(Node inNode)
          Set the configuration information for this ScaleBar
 void setQuadrant(int inQuadrant)
          Sets the quadrent UPPER_LEFT, UPPER_RIGHT, LOWER_LEFT, LOWER_RIGHT of the screen where the scale bar should be placed.
 void setScreenPercent(float inPercent)
          set what percent of the screen width this bar should use.
 void setStroke(java.awt.Stroke inStroke)
          Sets the stroke for this shader, will not allow null.
 void setVerticalOffset(int inOffset)
          Set the offset from the upper or lower edge of the screen in pixels.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UPPER_LEFT

public static final int UPPER_LEFT
The upper left quadrant of the screen.

See Also:
Constant Field Values

UPPER_RIGHT

public static final int UPPER_RIGHT
The upper right quadrant of the screen.

See Also:
Constant Field Values

LOWER_LEFT

public static final int LOWER_LEFT
The lower left quadrant of the screen.

See Also:
Constant Field Values

LOWER_RIGHT

public static final int LOWER_RIGHT
the lower right quadrant of the screen.

See Also:
Constant Field Values
Constructor Detail

SimpleScaleBar

public SimpleScaleBar()
Creates a new instance of ScaleBar

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.

This one returns kilometers, meters, centimters, milimeters, and micrometers

Specified by:
getDescription in interface ScaleBar

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


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.


setScreenPercent

public void setScreenPercent(float inPercent)
set what percent of the screen width this bar should use. Should be 1 to 100.


getScreenPercent

public float getScreenPercent()
get what percent of the screen width this bar should use.


setHorizontalOffset

public void setHorizontalOffset(int inOffset)
Set the offset from the left or right edge of the screen in pixels.


getHorizontalOffset

public int getHorizontalOffset()
Set the offset from the uleft or rightr edge of the screen in pixels.


setVerticalOffset

public void setVerticalOffset(int inOffset)
Set the offset from the upper or lower edge of the screen in pixels.


getVerticalOffset

public int getVerticalOffset()
Set the offset from the upper or lower edge of the screen in pixels.


setQuadrant

public void setQuadrant(int inQuadrant)
Sets the quadrent UPPER_LEFT, UPPER_RIGHT, LOWER_LEFT, LOWER_RIGHT of the screen where the scale bar should be placed.


getQuadrant

public int getQuadrant()
gets the quadrent UPPER_LEFT, UPPER_RIGHT, LOWER_LEFT, LOWER_RIGHT of the screen where the scale bar should be placed.


getAvailableSize

public java.awt.Rectangle getAvailableSize(int inScreenWidth,
                                           int inScreenHeight)
Get the available width of the Scale bar


getStart

public java.awt.Point getStart(int inImageWidth,
                               int inImageHeight,
                               int inWidth,
                               int inHeight)
Return the start point given the width and height.


getLineGraphics

public java.awt.Graphics getLineGraphics(java.awt.Graphics inGraphics)
Set up the graphics context for the drawing of lines. Always return the graphics context sent in after modifying it for drawing of lines.


getLabelGraphics

public java.awt.Graphics getLabelGraphics(java.awt.Graphics inGraphics)
Set up the graphics context for the drawing of lines. Always return the graphics context sent in after modifying it for labeling of features.


drawScale

public abstract void drawScale(java.awt.Graphics inGraphics,
                               Converter inConverter,
                               int inWidth,
                               int inHeight)
Method to draw a scale bar on the graphics context.

Specified by:
drawScale in interface ScaleBar

getNode

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

Specified by:
getNode in interface ScaleBar

setNode

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

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