com.esri.arcgis.carto
Interface IScaleBar

All Superinterfaces:
IMapSurround, Serializable
All Known Implementing Classes:
AlternatingScaleBar, DoubleAlternatingScaleBar, HollowScaleBar, ScaleLine, SingleDivisionScaleBar, SteppedScaleLine

public interface IScaleBar
extends IMapSurround, Serializable

Provides access to members that control the scalebar map surrounds.

Remarks

The IScaleBar interface manages most of the properties of a scale bar.

Other interfaces relevant to the scale bar's format are IScaleMarks, IScaleLine, ISingleFillScaleBar and IDoubleFillScaleBar. See the Carto Library Overview to find out how these interfaces work together to create various types of scale bars.

BarHeight defines the height of the scale bar and is always expressed in points and BarColor is an IColor defining its color.

ResizeHint is an esriScaleBarResizeHint constant defining what happens when the scale bar is resized. The choices are a fixed scale bar, increasing the space between the division marks or the number of divisions.

Divisions and Subdvisions

The Divisions property controls the total number of divisions on the scale bar including divisions before zero which of course, are defined by the DivisionsBeforeZero property. Unsurprisingly, Subdivisions controls the number of subdivisions. Use IScaleMarks::MarkFrequency to set which divisions and subdivisions will be shown.

Division is expressed in the units the scale bar will show and defines the spacing of the divisions.

Units and Unit Labels

Units is of type esriUnits and defines the units the scale bar will show.

UnitLabel is a string that will be displayed to show this unit. For instance "Km".

The UnitLabelPosition is an esriVertPosEnum constant that defines the position of the label relatively to the line. UnitLabelGap defines the space in points between the label and the scale bar and UnitLabelSymbol is a text symbol used to display the label.

UseMapSettings will restore Units and UnitLabel in accordance with map units.

Division Labels

The LabelFrequency is an esriScaleBarFrequency constant that defines on which divisions and subdivisions labels will be shown.

NumberFormat is an INumberFormat that allows you for instance to modify the number of decimals used to display the labels.

The LabelPosition is an esriVertPosEnum constant that defines the position of the labels relatively to the line. LabelGap defines the space in points between the labels and the scale bar and LabelSymbol is a text symbol used to display the labels.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


Method Summary
 IColor getBarColor()
          Color used to draw the bar.
 double getBarHeight()
          Height of the bar in points (1/72 inch).
 double getDivision()
          Number of units in one major division.
 short getDivisions()
          Total number of divisions (including those before zero).
 short getDivisionsBeforeZero()
          Number of divisions to the left of zero.
 int getLabelFrequency()
          The label style indicating which marks are labeled.
 double getLabelGap()
          Vertical gap between the bar and the labels in points (1/72 inch).
 int getLabelPosition()
          Vertical positioning of the mark labels.
 ITextSymbol getLabelSymbol()
          Symbol used to draw the labels.
 INumberFormat getNumberFormat()
          Number format.
 int getResizeHint()
          Indicates what happens when scale bar is resized.
 short getSubdivisions()
          Number of subdivisions per major division.
 String getUnitLabel()
          The unit label.
 double getUnitLabelGap()
          Gap between the scale bar and the unit label in points (1/72 inch).
 int getUnitLabelPosition()
          Vertical positioning of the unit label.
 ITextSymbol getUnitLabelSymbol()
          Unit label symbol.
 int getUnits()
          The units reported.
 void setBarColor(IColor color)
          Color used to draw the bar.
 void setBarHeight(double points)
          Height of the bar in points (1/72 inch).
 void setDivision(double units)
          Number of units in one major division.
 void setDivisions(short count)
          Total number of divisions (including those before zero).
 void setDivisionsBeforeZero(short count)
          Number of divisions to the left of zero.
 void setLabelFrequency(int labelFrequency)
          The label style indicating which marks are labeled.
 void setLabelGap(double points)
          Vertical gap between the bar and the labels in points (1/72 inch).
 void setLabelPosition(int position)
          Vertical positioning of the mark labels.
 void setLabelSymbol(ITextSymbol symbol)
          Symbol used to draw the labels.
 void setNumberFormat(INumberFormat format)
          Number format.
 void setResizeHint(int hint)
          Indicates what happens when scale bar is resized.
 void setSubdivisions(short units)
          Number of subdivisions per major division.
 void setUnitLabel(String unitLabel)
          The unit label.
 void setUnitLabelGap(double points)
          Gap between the scale bar and the unit label in points (1/72 inch).
 void setUnitLabelPosition(int position)
          Vertical positioning of the unit label.
 void setUnitLabelSymbol(ITextSymbol symbol)
          Unit label symbol.
 void setUnits(int units)
          The units reported.
 void useMapSettings()
          Sets division and units based on map.
 
Methods inherited from interface com.esri.arcgis.carto.IMapSurround
delayEvents, draw, fitToBounds, getIcon, getMap, getName, queryBounds, refresh, setMapByRef, setName
 

Method Detail

getDivision

double getDivision()
                   throws IOException,
                          AutomationException
Number of units in one major division.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The units
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setDivision

void setDivision(double units)
                 throws IOException,
                        AutomationException
Number of units in one major division.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
units - The units (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDivisions

short getDivisions()
                   throws IOException,
                          AutomationException
Total number of divisions (including those before zero).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setDivisions

void setDivisions(short count)
                  throws IOException,
                         AutomationException
Total number of divisions (including those before zero).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
count - The count (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDivisionsBeforeZero

short getDivisionsBeforeZero()
                             throws IOException,
                                    AutomationException
Number of divisions to the left of zero.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setDivisionsBeforeZero

void setDivisionsBeforeZero(short count)
                            throws IOException,
                                   AutomationException
Number of divisions to the left of zero.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
count - The count (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSubdivisions

short getSubdivisions()
                      throws IOException,
                             AutomationException
Number of subdivisions per major division.

Description

Subdivisions is the number of subdivisions displayed in the leftmost interval.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The units
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSubdivisions

void setSubdivisions(short units)
                     throws IOException,
                            AutomationException
Number of subdivisions per major division.

Description

Subdivisions is the number of subdivisions displayed in the leftmost interval.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
units - The units (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getUnits

int getUnits()
             throws IOException,
                    AutomationException
The units reported.

Description

Units is the type of distance units (miles, kilometers, etc.) a scalebar displays the interval distances. This unit does not have to be the same as the the units of the data frame that a scalebar is associated with.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A com.esri.arcgis.system.esriUnits constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setUnits

void setUnits(int units)
              throws IOException,
                     AutomationException
The units reported.

Description

Units is the type of distance units (miles, kilometers, etc.) a scalebar displays the interval distances. This unit does not have to be the same as the the units of the data frame that a scalebar is associated with.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
units - A com.esri.arcgis.system.esriUnits constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getUnitLabel

String getUnitLabel()
                    throws IOException,
                           AutomationException
The unit label.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The unitLabel
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setUnitLabel

void setUnitLabel(String unitLabel)
                  throws IOException,
                         AutomationException
The unit label.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
unitLabel - The unitLabel (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getUnitLabelPosition

int getUnitLabelPosition()
                         throws IOException,
                                AutomationException
Vertical positioning of the unit label.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A com.esri.arcgis.carto.esriScaleBarPos constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setUnitLabelPosition

void setUnitLabelPosition(int position)
                          throws IOException,
                                 AutomationException
Vertical positioning of the unit label.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
position - A com.esri.arcgis.carto.esriScaleBarPos constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getUnitLabelGap

double getUnitLabelGap()
                       throws IOException,
                              AutomationException
Gap between the scale bar and the unit label in points (1/72 inch).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The points
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setUnitLabelGap

void setUnitLabelGap(double points)
                     throws IOException,
                            AutomationException
Gap between the scale bar and the unit label in points (1/72 inch).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
points - The points (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getUnitLabelSymbol

ITextSymbol getUnitLabelSymbol()
                               throws IOException,
                                      AutomationException
Unit label symbol.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.display.ITextSymbol
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setUnitLabelSymbol

void setUnitLabelSymbol(ITextSymbol symbol)
                        throws IOException,
                               AutomationException
Unit label symbol.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
symbol - A reference to a com.esri.arcgis.display.ITextSymbol (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLabelFrequency

int getLabelFrequency()
                      throws IOException,
                             AutomationException
The label style indicating which marks are labeled.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A com.esri.arcgis.carto.esriScaleBarFrequency constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setLabelFrequency

void setLabelFrequency(int labelFrequency)
                       throws IOException,
                              AutomationException
The label style indicating which marks are labeled.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
labelFrequency - A com.esri.arcgis.carto.esriScaleBarFrequency constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getNumberFormat

INumberFormat getNumberFormat()
                              throws IOException,
                                     AutomationException
Number format.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.system.INumberFormat
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setNumberFormat

void setNumberFormat(INumberFormat format)
                     throws IOException,
                            AutomationException
Number format.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
format - A reference to a com.esri.arcgis.system.INumberFormat (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLabelPosition

int getLabelPosition()
                     throws IOException,
                            AutomationException
Vertical positioning of the mark labels.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A com.esri.arcgis.carto.esriVertPosEnum constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setLabelPosition

void setLabelPosition(int position)
                      throws IOException,
                             AutomationException
Vertical positioning of the mark labels.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
position - A com.esri.arcgis.carto.esriVertPosEnum constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLabelGap

double getLabelGap()
                   throws IOException,
                          AutomationException
Vertical gap between the bar and the labels in points (1/72 inch).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The points
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setLabelGap

void setLabelGap(double points)
                 throws IOException,
                        AutomationException
Vertical gap between the bar and the labels in points (1/72 inch).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
points - The points (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLabelSymbol

ITextSymbol getLabelSymbol()
                           throws IOException,
                                  AutomationException
Symbol used to draw the labels.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.display.ITextSymbol
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setLabelSymbol

void setLabelSymbol(ITextSymbol symbol)
                    throws IOException,
                           AutomationException
Symbol used to draw the labels.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
symbol - A reference to a com.esri.arcgis.display.ITextSymbol (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getBarColor

IColor getBarColor()
                   throws IOException,
                          AutomationException
Color used to draw the bar.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.display.IColor
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setBarColor

void setBarColor(IColor color)
                 throws IOException,
                        AutomationException
Color used to draw the bar.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
color - A reference to a com.esri.arcgis.display.IColor (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getBarHeight

double getBarHeight()
                    throws IOException,
                           AutomationException
Height of the bar in points (1/72 inch).

Description

BarHeight is the vertical height of the bars in a scalebar. In the case of double bar scalebars, it is the height of a single bar.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The points
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setBarHeight

void setBarHeight(double points)
                  throws IOException,
                         AutomationException
Height of the bar in points (1/72 inch).

Description

BarHeight is the vertical height of the bars in a scalebar. In the case of double bar scalebars, it is the height of a single bar.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
points - The points (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getResizeHint

int getResizeHint()
                  throws IOException,
                         AutomationException
Indicates what happens when scale bar is resized.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A com.esri.arcgis.carto.esriScaleBarResizeHint constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setResizeHint

void setResizeHint(int hint)
                   throws IOException,
                          AutomationException
Indicates what happens when scale bar is resized.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
hint - A com.esri.arcgis.carto.esriScaleBarResizeHint constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

useMapSettings

void useMapSettings()
                    throws IOException,
                           AutomationException
Sets division and units based on map.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.