com.esri.arcgis.carto
Interface ILegendInfo

All Superinterfaces:
Serializable
All Known Implementing Classes:
BiUniqueValueRenderer, CadFeatureLayer, ChartRenderer, ClassBreaksRenderer, CoTrackSymbologyRenderer, DotDensityRenderer, DummyGraduatedMarkerLayer, DummyLayer, EnhancedInfoRenderer, FeatureLayer, GdbRasterCatalogLayer, GlobeServerLayer, ILegendInfoProxy, ImageServerLayer, MapServerBasicSublayer, MapServerFindSublayer, MapServerIdentifySublayer, MapServerQuerySublayer, NAStopRenderer, NetworkLayer, ProportionalSymbolRenderer, RasterCatalogLayer, RasterClassifyColorRampRenderer, RasterColormapRenderer, RasterDiscreteColorRenderer, RasterLayer, RasterRGBRenderer, RasterStretchColorRampRenderer, RasterUniqueValueRenderer, RepresentationRenderer, ScaleDependentRenderer, SchematicLayer, SimpleNetworkRenderer, SimpleRenderer, TemporalFeatureLayer, TerrainDirtyAreaRenderer, TerrainLayer, TinAspectRenderer, TinBreaklineRenderer, TinEdgeRenderer, TinElevationRenderer, TinFaceRenderer, TinFaceValueRenderer, TinLayer, TinNodeElevationRenderer, TinNodeRenderer, TinNodeValueRenderer, TinSlopeRenderer, TopologyLayer, UniqueValueRenderer, UniqueValueTextRenderer, WCSLayer

public interface ILegendInfo
extends Serializable

Provides access to members that control legend information provided by a renderer.

Description

Implemented by layers and renderers to manage legend information. Layers typically delegate the implementation of this interface to the renderer. Legend information appears in the ArcMap table of contents as well as in ArcMap legends.

Remarks

This interface provides access to a layer or renderer's legend information and symbols. Use this interface to access the information about a layer or renderer that appears in the table of contents and also in legends.

All ESRI renderers have at least one LegendGroup which in turn has at least one LegendClass. Though renderers typically store all of the symbols they use to draw features in their LegendClass objects, it is best to access these symbols via the specific renderer interface for the renderer object you are using. For example, when rendering features, for a ClassBreaksRenderer use IClassBreaksRenderer::Symbol, or for a ProportionalSymbolRenderer use IProportionalSymbolRenderer::MinSymbol and IProportionalSymbolRenderer::BackgroundSymbol.

Some renderers, for example SimpleRenderer, ClassBreaksRenderer, and UniqueValueRenderer, update the legend groups and legend classes automatically when you set the renderer symbols. However, other renderers require you to call a method on a renderer specific interface to update the legend after making a symbol change. For the ProportionalSymbolRenderer, ChartRenderer, DotDensityRenderer, and BiUniqueValueRenderer you must do this. For example, call IProportionalSymbolRenderer:CreateLegendSymbols to update the legend for a layer symbolized with a ProportionalSymbolRenderer.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux


Method Summary
 ILegendGroup getLegendGroup(int index)
          Legend group at the specified index.
 int getLegendGroupCount()
          Number of legend groups contained by the object.
 ILegendItem getLegendItem()
          Optional.
 boolean isSymbolsAreGraduated()
          Indicates if symbols are graduated.
 void setSymbolsAreGraduated(boolean symbolsAreGraduated)
          Indicates if symbols are graduated.
 

Method Detail

getLegendGroupCount

int getLegendGroupCount()
                        throws IOException,
                               AutomationException
Number of legend groups contained by the object.

Remarks

The number of legend groups is determined by the implementation of the renderer, consequently this property is read only. For example, SimpleRenderer has one group, while a BiUniqueValueRenderer has any number of groups.

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.

getLegendGroup

ILegendGroup getLegendGroup(int index)
                            throws IOException,
                                   AutomationException
Legend group at the specified index.

Product Availability

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

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

getLegendItem

ILegendItem getLegendItem()
                          throws IOException,
                                 AutomationException
Optional. Defines legend formatting for layer rendered with this object.

Remarks

Layer or renderer legend information is further formatted for display in ArcMap legends. A renderer can override this formatting by returning a LegendItem for this property. ESRI renderers typically do not return anything for this property. With this configuration, legend formatting becomes a user or developer choice on the legend object.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

isSymbolsAreGraduated

boolean isSymbolsAreGraduated()
                              throws IOException,
                                     AutomationException
Indicates if symbols are graduated.

Description

Indicates whether the symbols used for a layer or renderer's legend vary by size.

Remarks

For example the proportional symbol renderer returns True for this property.

You can use this property to distinguish between a layer symbolized with graduated color or graduated symbol type layer symbology. Both of these symbolizations use a ClassBreaksRenderer, but only a graduated symbol symbolization will return True for this property.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

setSymbolsAreGraduated

void setSymbolsAreGraduated(boolean symbolsAreGraduated)
                            throws IOException,
                                   AutomationException
Indicates if symbols are graduated.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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