com.esri.arcgis.carto
Interface ILegendClass

All Superinterfaces:
Serializable
All Known Implementing Classes:
ILegendClassProxy, LegendClass, RepresentationLegendClass, TemporalLegendClass

public interface ILegendClass
extends Serializable

Provides access to members that control the legend/TOC entry for a renderer class.

Remarks

There are typically many LegendClass objects in a LegendGroup. Each legend class contains a symbol and descriptive text strings form of a Label and Description. The Label appears in the table of contents, and the label and description can appear in the legend.

If a legend group is editable, then the symbol and label for the label classes contained by the legend group can be edited in the table of contents. Changes to symbols symbol will change the renderer's symbology and the map will refresh to reflect this change. Changes to labels will change the content of any legends that contain the layer.

The typically route for modifying renderer appeance through code is to go to the renderer objects themselves. For example, to change the simple renderer symbol, label and description fields, use the methods and properties of ISimpleRenderer in preference to the legend class object.

Product Availability

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


Method Summary
 String getDescription()
          Legend class description.
 ILegendClassFormat getFormat()
          Optional.
 String getLabel()
          Legend class label.
 ISymbol getSymbol()
          Legend class symbol.
 void setDescription(String label)
          Legend class description.
 void setFormat(ILegendClassFormat format)
          Optional.
 void setLabel(String label)
          Legend class label.
 void setSymbolByRef(ISymbol symbol)
          Legend class symbol.
 

Method Detail

getSymbol

ISymbol getSymbol()
                  throws IOException,
                         AutomationException
Legend class 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.ISymbol
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSymbolByRef

void setSymbolByRef(ISymbol symbol)
                    throws IOException,
                           AutomationException
Legend class 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.ISymbol (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLabel

String getLabel()
                throws IOException,
                       AutomationException
Legend class label.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

setLabel

void setLabel(String label)
              throws IOException,
                     AutomationException
Legend class label.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getDescription

String getDescription()
                      throws IOException,
                             AutomationException
Legend class description.

Remarks

The Description does not apear in the table of contents but can appear in the legend depending on the LegendItem that is applied.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

setDescription

void setDescription(String label)
                    throws IOException,
                           AutomationException
Legend class description.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getFormat

ILegendClassFormat getFormat()
                             throws IOException,
                                    AutomationException
Optional. If non-null, then layer specifies class formatting information.

Remarks

A layer or renderer can provide legend class formatting information via this property, which makes it possible to store legend formatting information with layers in metadata-like fashion. However this is not normally done. Rather, legend formatting information usually comes from the legend. ILegendItem.LegendClassFormat is used and some patch settings can come from ILegend.LegendFormat .

So, when a legend is created, the code follows this logic:

  1. Check if ILegendClass.Format exists for the layer. If not, use ILegendItem.LegendClassFormat.
  2. For the patch settings, if a setting in ILegendItem.LegendClassFormat is null, then use the default value in ILegend.LegendFormat.

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.ILegendClassFormat
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFormat

void setFormat(ILegendClassFormat format)
               throws IOException,
                      AutomationException
Optional. If non-null, then layer specifies class formatting information.

Description

The layer can provide legend class formatting information via ILegendClass.Format. This makes it possible to store legend formatting information with layers in metadata-like fashion. However, layers normally do not provide a LegendClassFormat object. Rather, legend formatting information usually comes from the legend. ILegendItem.LegendClassFormat is used and some patch settings can come from ILegend.LegendFormat .

So, when a legend is created, the code follows this logic:

  1. Check if ILegendClass.Format exists for the layer. If not, use ILegendItem.LegendClassFormat.
  2. For the patch settings, if a setting in ILegendItem.LegendClassFormat is null, then use the default value in ILegend.LegendFormat.

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.carto.ILegendClassFormat (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.