deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.graphics
Class DefaultScaleBar

java.lang.Object
  extended by org.deegree.graphics.DefaultScaleBar
All Implemented Interfaces:
ScaleBar

public class DefaultScaleBar
extends Object
implements ScaleBar

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
Andreas Poth, last edited by: $Author: mschneider $

Field Summary
 
Fields inherited from interface org.deegree.graphics.ScaleBar
L_NONE, L_SCALE, L_SCALEDENOMINATOR
 
Constructor Summary
DefaultScaleBar()
          Constructor just using defaults
DefaultScaleBar(int topLabel, int bottomLabel, double scale, double scaleDenominator, String units, Color labelColor, Color barColor, Color allgColor, String barStyle, Font barFont, NumberFormat numberFormat)
          Constructor with all Parameters
 
Method Summary
 void paint(Graphics g)
          will paint the scale bar to the passed graphic context
 void setBackgroundColor(Color color)
          sets the background color of the scale bar
 void setBarColor(Color color)
          sets the bar color of the scale bar
 void setBottomLabel(int labelType)
          sets the type of the label below the scale bar
 void setColor(Color color)
          sets the front color of the scale bar
 void setFont(Font font)
          sets the font for label rendering
 void setLabelColor(Color color)
          sets the label color of the scale bar
 void setNumberFormat(NumberFormat numberFormat)
          sets the number format for a scale bar
 void setScale(double scale)
          sets the scale as defined in the OGC WMS 1.1.1 specification.
 void setScaleDenominator(double scaleDen)
          sets the scale denominator for the scale bar.
 void setStyle(String style)
          sets the style of the scale bar. default style is |--------| the list of known styles depends on the implementation
 void setTopLabel(int labelType)
          sets the type of the label above the scale bar
 void setUnits(String units)
          sets the units the scale and the scale denominater will be expressed at.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultScaleBar

public DefaultScaleBar(int topLabel,
                       int bottomLabel,
                       double scale,
                       double scaleDenominator,
                       String units,
                       Color labelColor,
                       Color barColor,
                       Color allgColor,
                       String barStyle,
                       Font barFont,
                       NumberFormat numberFormat)
Constructor with all Parameters

Parameters:
topLabel - type of the label on top of the scale bar. Chose L_NONE or no label, L_SCALE for scale on top and L_SCALEDENOMIATOR for scaledenominator on top.
bottomLabel - the same as above but below the scalebar.
scale - the scale to be displayed. For a value of e.g. 1000 there will be 1:1000 displayed
scaleDenominator - the scaledenominator to be displayed
units - the units the scaledenominator is in. Possible values are inch, Meter, Mile, Kilometer...
labelColor - the Color the label has to be in (and of course the text below and above)
barColor -
allgColor - not used so far
barStyle - the style the bar appears in. Currently just "default" is supported.
barFont - the font the text above and below the scale bar appears in.
numberFormat -

DefaultScaleBar

public DefaultScaleBar()
Constructor just using defaults

Method Detail

paint

public void paint(Graphics g)
will paint the scale bar to the passed graphic context

Specified by:
paint in interface ScaleBar
Parameters:
g - graphic context

setTopLabel

public void setTopLabel(int labelType)
sets the type of the label above the scale bar

Specified by:
setTopLabel in interface ScaleBar
Parameters:
labelType - lable type

setBottomLabel

public void setBottomLabel(int labelType)
sets the type of the label below the scale bar

Specified by:
setBottomLabel in interface ScaleBar
Parameters:
labelType - lable type

setScale

public void setScale(double scale)
sets the scale as defined in the OGC WMS 1.1.1 specification. Scale is defined as the diagonal size of a pixel in the center of a map measured in meter. The setting of the scale will affect the value of the scale denominator

Specified by:
setScale in interface ScaleBar
Parameters:
scale - map scale

setScaleDenominator

public void setScaleDenominator(double scaleDen)
sets the scale denominator for the scale bar. The scale denominator is the scale expression as we know it for printed maps (e.g. 1:10000 1:5000). The passed value is expressed in meters. The setting of the scale denominator will affect the value of the scale

Specified by:
setScaleDenominator in interface ScaleBar
Parameters:
scaleDen - scale denominator value

setUnits

public void setUnits(String units)
sets the units the scale and the scale denominater will be expressed at. Settings other than meter will cause that the passed values for scale and scale denominater will be recalculated for painting. it depends on the implementation what units are supported.

Specified by:
setUnits in interface ScaleBar
Parameters:
units - name units (meter, miles, feet etc.)

setColor

public void setColor(Color color)
sets the front color of the scale bar

Parameters:
color -

setLabelColor

public void setLabelColor(Color color)
sets the label color of the scale bar

Specified by:
setLabelColor in interface ScaleBar
Parameters:
color -

setBarColor

public void setBarColor(Color color)
sets the bar color of the scale bar

Specified by:
setBarColor in interface ScaleBar
Parameters:
color -

setStyle

public void setStyle(String style)
sets the style of the scale bar. default style is |--------| the list of known styles depends on the implementation

Specified by:
setStyle in interface ScaleBar
Parameters:
style - style name

setFont

public void setFont(Font font)
sets the font for label rendering

Specified by:
setFont in interface ScaleBar
Parameters:
font - awt font object

setBackgroundColor

public void setBackgroundColor(Color color)
Description copied from interface: ScaleBar
sets the background color of the scale bar

Specified by:
setBackgroundColor in interface ScaleBar

setNumberFormat

public void setNumberFormat(NumberFormat numberFormat)
sets the number format for a scale bar

Specified by:
setNumberFormat in interface ScaleBar
Parameters:
numberFormat -

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org