com.esri.adf.web.ags.data
Class AGSScaleBarFunctionality

java.lang.Object
  extended by com.esri.adf.web.ags.data.AGSScaleBarFunctionality
All Implemented Interfaces:
GISFunctionality, ScaleBarFunctionality

public class AGSScaleBarFunctionality
extends Object
implements ScaleBarFunctionality


Field Summary
static int TYPE_ALTERNATINGSCALEBAR
           
static int TYPE_DOUBLEALTERNATINGSCALEBAR
           
static int TYPE_HOLLOWSCALEBAR
           
static int TYPE_SCALELINE
           
static int TYPE_SINGLEDIVISIONSCALEBAR
           
static int TYPE_STEPPEDSCALELINE
           
 
Fields inherited from interface com.esri.adf.web.data.ScaleBarFunctionality
FUNCTIONALITY_NAME
 
Constructor Summary
AGSScaleBarFunctionality()
           
 
Method Summary
protected  com.esri.arcgis.carto.ImageDisplay calculateImageDisplay(com.esri.arcgis.server.IServerContext ctx, com.esri.arcgis.carto.IScaleBar scaleBar)
          Calculates the width and height of scale bar;
 void destroyFunctionality()
           The cleanup chores (such as releasing held resources) for the functionality must be performed in this method.
 byte[] exportImage()
          Generates an image of the scale bar based on the given description, and returns the image as a byte array.
 String getBackgroundColor()
          Gets the background color of the AGSScaleBarFunctionality.
 String getBarColor()
          Gets the bar color of the AGSScaleBarFunctionality.
 double getBarHeight()
          Gets the bar height of the AGSScaleBarFunctionality.
 double getDivision()
          Gets the division of the AGSScaleBarFunctionality.
 short getDivisions()
          Gets the divisions of the AGSScaleBarFunctionality.
 short getDivisionsBeforeZero()
          Gets the divisions before zero of the AGSScaleBarFunctionality.
protected  com.esri.arcgis.display.IFillSymbol getFillSymbol(com.esri.arcgis.display.IColor color)
          Gets the fill symbol.
 String getFontColor()
          Gets the fontColor of the AGSScaleBarFunctionality.
 String getFontFamily()
          Gets the fontFamily of the AGSScaleBarFunctionality.
 int getFontSize()
          Gets the fontSize of the AGSScaleBarFunctionality.
 int getImageFormat()
          Gets the image format of the AGSScaleBarFunctionality.
 Integer getImageHeight()
          Gets the image height of the AGSScaleBarFunctionality.
 int getImageResolution()
          Gets the image resolution (DPI) of the AGSScaleBarFunctionality.
 Integer getImageWidth()
          Gets the image width of the AGSScaleBarFunctionality.
 int getLabelFrequency()
          Gets the labelFrequency of the AGSScaleBarFunctionality.
 double getLabelGap()
          Gets the labelGap of the AGSScaleBarFunctionality.
 int getLabelPosition()
          Gets the labelPosition of the AGSScaleBarFunctionality.
 int getLineSize()
          Gets the lineSize of the AGSScaleBarFunctionality.
protected  com.esri.arcgis.display.ILineSymbol getLineSymbol()
          Gets the line symbol.
protected  com.esri.arcgis.carto.IMapDescription getMapDescription()
          Gets the mapDescription of the AGSScaleBarFunctionality.
protected  com.esri.arcgis.carto.ImageDisplay getMapSize()
          Gets the mapDescription of the AGSScaleBarFunctionality.
protected  com.esri.arcgis.display.ICartographicLineSymbol getMarkLineSymbol()
          Gets the mark symbol.
protected  com.esri.arcgis.system.NumericFormat getNumberFormat()
          Gets the number Format
 String getNumberSeparator()
          Gets the numberSeparator of the AGSScaleBarFunctionality.
 int getResizeHint()
          Gets the resizeHint of the AGSScaleBarFunctionality.
 AGSLocalMapResource getResource()
           Returns the GISResource associated with this functionality.
 String getRightToLeftText()
          Gets the rightToLeftText of the AGSScaleBarFunctionality.
 int getRoundOption()
          Gets the roundOption of the AGSScaleBarFunctionality.
 int getRoundValue()
          Gets the roundValue of the AGSScaleBarFunctionality.
 String getShowPlusSign()
          Gets the showPlusSign of the AGSScaleBarFunctionality.
 short getSubdivisions()
          Gets the subdivisions of the AGSScaleBarFunctionality.
 double getTextAngle()
          Gets the textAngle of the AGSScaleBarFunctionality.
protected  com.esri.arcgis.display.ITextSymbol getTextSymbol()
          Gets the text symbol.
 int getType()
          Gets the type of the AGSScaleBarFunctionality.
 String getUnitLabel()
          Gets the unitLabel of the AGSScaleBarFunctionality.
 double getUnitLabelGap()
          Gets the unitLabelGap of the AGSScaleBarFunctionality.
 int getUnitLabelPosition()
          Gets the unitLabelPosition of the AGSScaleBarFunctionality.
 int getUnits()
          Gets the units of the AGSScaleBarFunctionality.
 String getZeroPad()
          Gets the zeroPad of the AGSScaleBarFunctionality.
 void initFunctionality(GISResource resource)
           The initialization chores for the functionality must be performed in this method.
 boolean isDisabled()
           
 void setBackgroundColor(String backgroundColor)
          Sets the background color of the AGSScaleBarFunctionality.
 void setBarColor(String barColor)
          Sets the bar color of the AGSScaleBarFunctionality.
 void setBarHeight(double barHeight)
          Sets the bar height of the AGSScaleBarFunctionality.
 void setDisabled(boolean disabled)
           
 void setDivision(double division)
          Sets the division of the AGSScaleBarFunctionality.
 void setDivisions(short divisions)
          Sets the divisions of the AGSScaleBarFunctionality.
 void setDivisionsBeforeZero(short divisionsBeforeZero)
          Sets the divisionsBeforeZero of the AGSScaleBarFunctionality.
 void setFontColor(String fontColor)
          Sets the fontColor of the AGSScaleBarFunctionality.
 void setFontFamily(String fontFamily)
          Sets the fontFamily of the AGSScaleBarFunctionality.
 void setFontSize(int fontSize)
          Sets the fontSize of the AGSScaleBarFunctionality.
 void setImageFormat(int imageFormat)
          Sets the image format of the AGSScaleBarFunctionality.
 void setImageHeight(Integer imageHeight)
          Sets the image height of the AGSScaleBarFunctionality.
 void setImageResolution(int imageResolution)
          Sets the image resolution (DPI) of the AGSScaleBarFunctionality.
 void setImageWidth(Integer imageWidth)
          Sets the image width of the AGSScaleBarFunctionality.
 void setLabelFrequency(int labelFrequency)
          Sets the labelFrequency of the AGSScaleBarFunctionality.
 void setLabelGap(double labelGap)
          Sets the labelGap of the AGSScaleBarFunctionality.
 void setLabelPosition(int labelPosition)
          Sets the labelPosition of the AGSScaleBarFunctionality.
 void setLineSize(int lineSize)
          Sets the lineSize of the AGSScaleBarFunctionality.
 void setNumberSeparator(String numberSeparator)
          Sets the numberSeparator of the AGSScaleBarFunctionality.
 void setResizeHint(int resizeHint)
          Sets the resizeHint of the AGSScaleBarFunctionality.
 void setRightToLeftText(String leftToRightText)
          Sets the rightToLeftText of the AGSScaleBarFunctionality.
 void setRoundOption(int round)
          Sets the roundOption of the AGSScaleBarFunctionality.
 void setRoundValue(int precision)
          Sets the roundValue of the AGSScaleBarFunctionality.
 void setShowPlusSign(String showPlusSign)
          Sets the showPlusSign of the AGSScaleBarFunctionality.
 void setSubdivisions(short subdivisions)
          Sets the subdivisions of the AGSScaleBarFunctionality.
 void setTextAngle(double textAngle)
          Sets the textAngle of the AGSScaleBarFunctionality.
 void setType(int type)
          Sets the type of the AGSScaleBarFunctionality.
 void setUnitLabel(String unitLabel)
          Sets the unitLabel of the AGSScaleBarFunctionality.
 void setUnitLabelGap(double unitLabelGap)
          Sets the unitLabelGap of the AGSScaleBarFunctionality.
 void setUnitLabelPosition(int unitLabelPosition)
          Sets the unitLabelPosition of the AGSScaleBarFunctionality.
 void setUnits(int units)
          Sets the units of the AGSScaleBarFunctionality.
 void setZeroPad(String zeroPad)
          Sets the zeroPad of the AGSScaleBarFunctionality.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_DOUBLEALTERNATINGSCALEBAR

public static final int TYPE_DOUBLEALTERNATINGSCALEBAR
See Also:
Constant Field Values

TYPE_ALTERNATINGSCALEBAR

public static final int TYPE_ALTERNATINGSCALEBAR
See Also:
Constant Field Values

TYPE_HOLLOWSCALEBAR

public static final int TYPE_HOLLOWSCALEBAR
See Also:
Constant Field Values

TYPE_SINGLEDIVISIONSCALEBAR

public static final int TYPE_SINGLEDIVISIONSCALEBAR
See Also:
Constant Field Values

TYPE_STEPPEDSCALELINE

public static final int TYPE_STEPPEDSCALELINE
See Also:
Constant Field Values

TYPE_SCALELINE

public static final int TYPE_SCALELINE
See Also:
Constant Field Values
Constructor Detail

AGSScaleBarFunctionality

public AGSScaleBarFunctionality()
Method Detail

initFunctionality

public void initFunctionality(GISResource resource)
Description copied from interface: GISFunctionality

The initialization chores for the functionality must be performed in this method. This method is called by the resource when the functionality needs to be initialized. This happens either when the resource itself is being initialized or if users add this functionality to the resource using the GISResource.addFunctionality(String, GISFunctionality) method after the resource has already been initialized.

Classes which implement this method should maintain the resource as a class instance variable and return the same in the GISFunctionality.getResource() method. The functionality is ready for use only after this method has been called.

Specified by:
initFunctionality in interface GISFunctionality
Parameters:
resource - the GISResource that this functionality supports
See Also:
GISResource.init(WebContext)

destroyFunctionality

public void destroyFunctionality()
Description copied from interface: GISFunctionality

The cleanup chores (such as releasing held resources) for the functionality must be performed in this method. This method is called by the GISResource when the resource itself is being destroyed.

The functionality is no longer usable after this method has been called.

Specified by:
destroyFunctionality in interface GISFunctionality
See Also:
GISResource.destroy()

getResource

public AGSLocalMapResource getResource()
Description copied from interface: GISFunctionality

Returns the GISResource associated with this functionality.

The resource passed to GISFunctionality.initFunctionality(GISResource) is maintained as a class variable and is accessible through this method.

Specified by:
getResource in interface GISFunctionality
Returns:
the GISResource associated with this functionality

getType

public int getType()
Gets the type of the AGSScaleBarFunctionality.

Returns:
Returns the type.

setType

public void setType(int type)
Sets the type of the AGSScaleBarFunctionality.

Parameters:
type - The type to set.

getMapDescription

protected com.esri.arcgis.carto.IMapDescription getMapDescription()
                                                           throws com.esri.arcgis.interop.AutomationException,
                                                                  IOException
Gets the mapDescription of the AGSScaleBarFunctionality.

Returns:
Returns the mapDescription.
Throws:
com.esri.arcgis.interop.AutomationException
IOException

getMapSize

protected com.esri.arcgis.carto.ImageDisplay getMapSize()
                                                 throws com.esri.arcgis.interop.AutomationException,
                                                        IOException
Gets the mapDescription of the AGSScaleBarFunctionality.

Returns:
Returns the mapDescription.
Throws:
com.esri.arcgis.interop.AutomationException
IOException

isDisabled

public boolean isDisabled()

setDisabled

public void setDisabled(boolean disabled)

getImageResolution

public int getImageResolution()
Gets the image resolution (DPI) of the AGSScaleBarFunctionality.

Returns:
Returns the imageResolution.

setImageResolution

public void setImageResolution(int imageResolution)
Sets the image resolution (DPI) of the AGSScaleBarFunctionality.

Parameters:
imageResolution - The image resolution to set.

getImageHeight

public Integer getImageHeight()
Gets the image height of the AGSScaleBarFunctionality. Optional, use the default size when it is null.

Returns:
Returns the image height.

setImageHeight

public void setImageHeight(Integer imageHeight)
Sets the image height of the AGSScaleBarFunctionality. Optional, use the default size when it is null.

Parameters:
imageHeight - The image height to set.

getImageWidth

public Integer getImageWidth()
Gets the image width of the AGSScaleBarFunctionality. Optional, use the default size when it is null.

Returns:
Returns the image width.

setImageWidth

public void setImageWidth(Integer imageWidth)
Sets the image width of the AGSScaleBarFunctionality. Optional, use the default size when it is null.

Parameters:
imageWidth - The image width to set.

getBackgroundColor

public String getBackgroundColor()
Gets the background color of the AGSScaleBarFunctionality.

Returns:
Returns the background color.

setBackgroundColor

public void setBackgroundColor(String backgroundColor)
Sets the background color of the AGSScaleBarFunctionality.

Parameters:
backgroundColor - The background color to set.

getImageFormat

public int getImageFormat()
Gets the image format of the AGSScaleBarFunctionality. Check esriImageFormat for available values.

Returns:
Returns the image format.

setImageFormat

public void setImageFormat(int imageFormat)
Sets the image format of the AGSScaleBarFunctionality. Check esriImageFormat for available values.

Parameters:
imageFormat - The image format to set, check esriImageFormat for available values.

getBarColor

public String getBarColor()
Gets the bar color of the AGSScaleBarFunctionality.

Returns:
Returns the bar color.

setBarColor

public void setBarColor(String barColor)
Sets the bar color of the AGSScaleBarFunctionality.

Parameters:
barColor - The bar color to set.

getBarHeight

public double getBarHeight()
Gets the bar height of the AGSScaleBarFunctionality.

Returns:
Returns the bar height.

setBarHeight

public void setBarHeight(double barHeight)
Sets the bar height of the AGSScaleBarFunctionality.

Parameters:
barHeight - The bar height to set.

getDivision

public double getDivision()
Gets the division of the AGSScaleBarFunctionality.

Returns:
Returns the division.

setDivision

public void setDivision(double division)
Sets the division of the AGSScaleBarFunctionality.

Parameters:
division - The division to set.

getDivisions

public short getDivisions()
Gets the divisions of the AGSScaleBarFunctionality.

Returns:
Returns the divisions.

setDivisions

public void setDivisions(short divisions)
Sets the divisions of the AGSScaleBarFunctionality.

Parameters:
divisions - The divisions to set.

getDivisionsBeforeZero

public short getDivisionsBeforeZero()
Gets the divisions before zero of the AGSScaleBarFunctionality.

Returns:
Returns the divisions before zero.

setDivisionsBeforeZero

public void setDivisionsBeforeZero(short divisionsBeforeZero)
Sets the divisionsBeforeZero of the AGSScaleBarFunctionality.

Parameters:
divisionsBeforeZero - The divisionsBeforeZero to set.

getLabelFrequency

public int getLabelFrequency()
Gets the labelFrequency of the AGSScaleBarFunctionality.

Returns:
Returns the labelFrequency.

setLabelFrequency

public void setLabelFrequency(int labelFrequency)
Sets the labelFrequency of the AGSScaleBarFunctionality.

Parameters:
labelFrequency - The labelFrequency to set.

getLabelGap

public double getLabelGap()
Gets the labelGap of the AGSScaleBarFunctionality.

Returns:
Returns the labelGap.

setLabelGap

public void setLabelGap(double labelGap)
Sets the labelGap of the AGSScaleBarFunctionality.

Parameters:
labelGap - The labelGap to set.

getLabelPosition

public int getLabelPosition()
Gets the labelPosition of the AGSScaleBarFunctionality.

Returns:
Returns the labelPosition.

setLabelPosition

public void setLabelPosition(int labelPosition)
Sets the labelPosition of the AGSScaleBarFunctionality.

Parameters:
labelPosition - The labelPosition to set.

getResizeHint

public int getResizeHint()
Gets the resizeHint of the AGSScaleBarFunctionality.

Returns:
Returns the resizeHint.

setResizeHint

public void setResizeHint(int resizeHint)
Sets the resizeHint of the AGSScaleBarFunctionality.

Parameters:
resizeHint - The resizeHint to set.

getSubdivisions

public short getSubdivisions()
Gets the subdivisions of the AGSScaleBarFunctionality.

Returns:
Returns the subdivisions.

setSubdivisions

public void setSubdivisions(short subdivisions)
Sets the subdivisions of the AGSScaleBarFunctionality.

Parameters:
subdivisions - The subdivisions to set.

getUnitLabel

public String getUnitLabel()
Gets the unitLabel of the AGSScaleBarFunctionality.

Returns:
Returns the unitLabel.

setUnitLabel

public void setUnitLabel(String unitLabel)
Sets the unitLabel of the AGSScaleBarFunctionality.

Parameters:
unitLabel - The unitLabel to set.

getUnitLabelGap

public double getUnitLabelGap()
Gets the unitLabelGap of the AGSScaleBarFunctionality.

Returns:
Returns the unitLabelGap.

setUnitLabelGap

public void setUnitLabelGap(double unitLabelGap)
Sets the unitLabelGap of the AGSScaleBarFunctionality.

Parameters:
unitLabelGap - The unitLabelGap to set.

getUnitLabelPosition

public int getUnitLabelPosition()
Gets the unitLabelPosition of the AGSScaleBarFunctionality.

Returns:
Returns the unitLabelPosition.

setUnitLabelPosition

public void setUnitLabelPosition(int unitLabelPosition)
Sets the unitLabelPosition of the AGSScaleBarFunctionality.

Parameters:
unitLabelPosition - The unitLabelPosition to set.

getUnits

public int getUnits()
Gets the units of the AGSScaleBarFunctionality.

Returns:
Returns the units.

setUnits

public void setUnits(int units)
Sets the units of the AGSScaleBarFunctionality.

Parameters:
units - The units to set.

getNumberSeparator

public String getNumberSeparator()
Gets the numberSeparator of the AGSScaleBarFunctionality.

Returns:
Returns the numberSeparator.

setNumberSeparator

public void setNumberSeparator(String numberSeparator)
Sets the numberSeparator of the AGSScaleBarFunctionality.

Parameters:
numberSeparator - The numberSeparator to set.

getShowPlusSign

public String getShowPlusSign()
Gets the showPlusSign of the AGSScaleBarFunctionality.

Returns:
Returns the showPlusSign.

setShowPlusSign

public void setShowPlusSign(String showPlusSign)
Sets the showPlusSign of the AGSScaleBarFunctionality.

Parameters:
showPlusSign - The showPlusSign to set.

getZeroPad

public String getZeroPad()
Gets the zeroPad of the AGSScaleBarFunctionality.

Returns:
Returns the zeroPad.

setZeroPad

public void setZeroPad(String zeroPad)
Sets the zeroPad of the AGSScaleBarFunctionality.

Parameters:
zeroPad - The zeroPad to set.

getRightToLeftText

public String getRightToLeftText()
Gets the rightToLeftText of the AGSScaleBarFunctionality.

Returns:
Returns the rightToLeftText.

setRightToLeftText

public void setRightToLeftText(String leftToRightText)
Sets the rightToLeftText of the AGSScaleBarFunctionality.

Parameters:
leftToRightText - The rightToLeftText to set.

getTextAngle

public double getTextAngle()
Gets the textAngle of the AGSScaleBarFunctionality.

Returns:
Returns the textAngle.

setTextAngle

public void setTextAngle(double textAngle)
Sets the textAngle of the AGSScaleBarFunctionality.

Parameters:
textAngle - The textAngle to set.

calculateImageDisplay

protected com.esri.arcgis.carto.ImageDisplay calculateImageDisplay(com.esri.arcgis.server.IServerContext ctx,
                                                                   com.esri.arcgis.carto.IScaleBar scaleBar)
                                                            throws IOException,
                                                                   com.esri.arcgis.interop.AutomationException
Calculates the width and height of scale bar;

Parameters:
ctx -
scaleBar -
Throws:
IOException
com.esri.arcgis.interop.AutomationException

exportImage

public byte[] exportImage()
Description copied from interface: ScaleBarFunctionality
Generates an image of the scale bar based on the given description, and returns the image as a byte array.

Specified by:
exportImage in interface ScaleBarFunctionality
Returns:
the image byte array

getNumberFormat

protected com.esri.arcgis.system.NumericFormat getNumberFormat()
                                                        throws IOException,
                                                               com.esri.arcgis.interop.AutomationException
Gets the number Format

Throws:
IOException
com.esri.arcgis.interop.AutomationException

getTextSymbol

protected com.esri.arcgis.display.ITextSymbol getTextSymbol()
                                                     throws com.esri.arcgis.interop.AutomationException,
                                                            IOException
Gets the text symbol.

Throws:
com.esri.arcgis.interop.AutomationException
IOException

getMarkLineSymbol

protected com.esri.arcgis.display.ICartographicLineSymbol getMarkLineSymbol()
                                                                     throws com.esri.arcgis.interop.AutomationException,
                                                                            IOException
Gets the mark symbol.

Throws:
com.esri.arcgis.interop.AutomationException
IOException

getLineSymbol

protected com.esri.arcgis.display.ILineSymbol getLineSymbol()
                                                     throws com.esri.arcgis.interop.AutomationException,
                                                            IOException
Gets the line symbol.

Throws:
com.esri.arcgis.interop.AutomationException
IOException

getFillSymbol

protected com.esri.arcgis.display.IFillSymbol getFillSymbol(com.esri.arcgis.display.IColor color)
                                                     throws com.esri.arcgis.interop.AutomationException,
                                                            IOException
Gets the fill symbol.

Parameters:
color -
Throws:
com.esri.arcgis.interop.AutomationException
IOException

getFontColor

public String getFontColor()
Gets the fontColor of the AGSScaleBarFunctionality.

Returns:
Returns the fontColor.

setFontColor

public void setFontColor(String fontColor)
Sets the fontColor of the AGSScaleBarFunctionality.

Parameters:
fontColor - The fontColor to set.

getFontFamily

public String getFontFamily()
Gets the fontFamily of the AGSScaleBarFunctionality.

Returns:
Returns the fontFamily.

setFontFamily

public void setFontFamily(String fontFamily)
Sets the fontFamily of the AGSScaleBarFunctionality.

Parameters:
fontFamily - The fontFamily to set.

getFontSize

public int getFontSize()
Gets the fontSize of the AGSScaleBarFunctionality.

Returns:
Returns the fontSize.

setFontSize

public void setFontSize(int fontSize)
Sets the fontSize of the AGSScaleBarFunctionality.

Parameters:
fontSize - The fontSize to set.

getLineSize

public int getLineSize()
Gets the lineSize of the AGSScaleBarFunctionality.

Returns:
Returns the lineSize.

setLineSize

public void setLineSize(int lineSize)
Sets the lineSize of the AGSScaleBarFunctionality.

Parameters:
lineSize - The lineSize to set.

getRoundValue

public int getRoundValue()
Gets the roundValue of the AGSScaleBarFunctionality.

Returns:
Returns the roundValue.

setRoundValue

public void setRoundValue(int precision)
Sets the roundValue of the AGSScaleBarFunctionality.

Parameters:
precision - The roundValue to set.

getRoundOption

public int getRoundOption()
Gets the roundOption of the AGSScaleBarFunctionality.

Returns:
Returns the roundOption.

setRoundOption

public void setRoundOption(int round)
Sets the roundOption of the AGSScaleBarFunctionality.

Parameters:
round - The roundOption to set.