com.esri.arcgis.carto
Interface IGridLabel

All Superinterfaces:
Serializable
All Known Implementing Classes:
BackgroundTabStyle, ButtonTabStyle, ContinuousTabStyle, CornerGridLabel, DMSGridLabel, FormattedGridLabel, MixedFontGridLabel, RoundedTabStyle

public interface IGridLabel
extends Serializable

Provides access to members that control the way a map grid is labeled.

Superseded By

IGridLabel2

Remarks

A grid label object is associated with every map grid object and provides the functionality required to draw labels around the map grid.
The IGridLabel interface holds properties common to all types of grid labels. Not all grid labels can be used with all types of grids. The Applies property of IGridLabel returns True if the grid label can be used with the grid that you pass in as argument. The table below lists the types of labels that can be used with each grid type.
Using the DisplayName property, you can list the type of label that the IGridLabel interface is pointing to. The strings returned for the various label types are also listed in the table.


You can control the vertical or horizontal orientation of the labels along each of the four sides of the grid using the LabelAlignment property. You specify which axis you are setting the property for using an esriGridAxisEnum enumeration.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux


Method Summary
 void draw(double labelValue, IPoint location, int axis, IDisplay display)
          Draws a label on the specified grid axis.
 IColor getColor()
          The color of the grid label.
 String getDisplayName()
          The display name for the type of grid label.
 Object getEditObject()
          The interface to an object that can be edited with a property sheet.
 Font getFont()
          The font used by the grid label.
 double getLabelOffset()
          The offset of the grid label from the border in points.
 boolean isApplies(IMapGrid grid)
          Indicates if this grid label can be used with the specified map grid.
 boolean isLabelAlignment(int axis)
          Indicates if the grid label is horizontal (true) or vertical (false) on the specified axis.
 void preview(int hDC, tagRECT rectangle)
          Draws a preview of the grid label into the specified hdc.
 void queryTextExtent(double labelValue, IPoint location, int axis, IDisplay display, IEnvelope extent)
          Determines the extent of a label's text on the specified grid axis.
 void setColor(IColor color)
          The color of the grid label.
 void setEditObject(Object ppObject)
          The interface to an object that can be edited with a property sheet.
 void setFont(Font font)
          The font used by the grid label.
 void setLabelAlignment(int axis, boolean horizontal)
          Indicates if the grid label is horizontal (true) or vertical (false) on the specified axis.
 void setLabelOffset(double offsetPoints)
          The offset of the grid label from the border in points.
 

Method Detail

getDisplayName

String getDisplayName()
                      throws IOException,
                             AutomationException
The display name for the type of grid label.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

isApplies

boolean isApplies(IMapGrid grid)
                  throws IOException,
                         AutomationException
Indicates if this grid label can be used with the specified map grid.

Product Availability

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

Parameters:
grid - A reference to a com.esri.arcgis.carto.IMapGrid (in)
Returns:
The applies
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getEditObject

Object getEditObject()
                     throws IOException,
                            AutomationException
The interface to an object that can be edited with a property sheet. The object is either the grid label itself or a single editable property.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to another Object (IUnknown)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setEditObject

void setEditObject(Object ppObject)
                   throws IOException,
                          AutomationException
The interface to an object that can be edited with a property sheet. The object is either the grid label itself or a single editable property.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
ppObject - A reference to another Object (IUnknown) (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFont

Font getFont()
             throws IOException,
                    AutomationException
The font used by the grid label.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.support.ms.stdole.Font (A com.esri.arcgis.support.ms.stdole.Font COM typedef)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFont

void setFont(Font font)
             throws IOException,
                    AutomationException
The font used by the grid label.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
font - A reference to a com.esri.arcgis.support.ms.stdole.Font (A com.esri.arcgis.support.ms.stdole.Font COM typedef) (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getColor

IColor getColor()
                throws IOException,
                       AutomationException
The color of the grid label.

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.

setColor

void setColor(IColor color)
              throws IOException,
                     AutomationException
The color of the grid label.

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.

getLabelOffset

double getLabelOffset()
                      throws IOException,
                             AutomationException
The offset of the grid label from the border in points.

Description

LabelOffset is the distance in points (approx. 1/72 inch) that your labels will be drawn outside of the map border. Use a negative number to inset the labels.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

setLabelOffset

void setLabelOffset(double offsetPoints)
                    throws IOException,
                           AutomationException
The offset of the grid label from the border in points.

Description

LabelOffset is the distance in points (approx. 1/72 inch) that your labels will be drawn outside of the map border. Use a negative number to inset the labels.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

isLabelAlignment

boolean isLabelAlignment(int axis)
                         throws IOException,
                                AutomationException
Indicates if the grid label is horizontal (true) or vertical (false) on the specified axis.

Product Availability

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

Parameters:
axis - A com.esri.arcgis.carto.esriGridAxisEnum constant (in)
Returns:
The horizontal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setLabelAlignment

void setLabelAlignment(int axis,
                       boolean horizontal)
                       throws IOException,
                              AutomationException
Indicates if the grid label is horizontal (true) or vertical (false) on the specified axis.

Product Availability

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

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

queryTextExtent

void queryTextExtent(double labelValue,
                     IPoint location,
                     int axis,
                     IDisplay display,
                     IEnvelope extent)
                     throws IOException,
                            AutomationException
Determines the extent of a label's text on the specified grid axis.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
labelValue - The labelValue (in)
location - A reference to a com.esri.arcgis.geometry.IPoint (in)
axis - A com.esri.arcgis.carto.esriGridAxisEnum constant (in)
display - A reference to a com.esri.arcgis.display.IDisplay (in)
extent - A reference to a com.esri.arcgis.geometry.IEnvelope (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

draw

void draw(double labelValue,
          IPoint location,
          int axis,
          IDisplay display)
          throws IOException,
                 AutomationException
Draws a label on the specified grid axis.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
labelValue - The labelValue (in)
location - A reference to a com.esri.arcgis.geometry.IPoint (in)
axis - A com.esri.arcgis.carto.esriGridAxisEnum constant (in)
display - A reference to a com.esri.arcgis.display.IDisplay (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

preview

void preview(int hDC,
             tagRECT rectangle)
             throws IOException,
                    AutomationException
Draws a preview of the grid label into the specified hdc.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
hDC - The hDC (A COM typedef) (in)
rectangle - A Structure: com.esri.arcgis.display.tagRECT (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.