com.esri.arcgis.carto
Class RepresentationLegendClass

java.lang.Object
  extended by com.esri.arcgis.carto.RepresentationLegendClass
All Implemented Interfaces:
ILegendClass, IRepresentationLegendClass, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class RepresentationLegendClass
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IRepresentationLegendClass, ILegendClass

A legend class object identifying a representation rule.

Product Availability

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

See Also:
Serialized Form

Constructor Summary
RepresentationLegendClass(Object obj)
          Construct a RepresentationLegendClass using a reference to such an object returned from ArcGIS Engine or Server.
 
Method Summary
 boolean equals(Object o)
          Compare this object with another
 String getDescription()
          Legend class description.
 ILegendClassFormat getFormat()
          Optional.
 String getLabel()
          Legend class label.
 IRepresentationClass getRepresentationClass()
          The feature class representation identified by the legend class.
 int getRuleID()
          The rule ID identified by the legend class.
 ISymbol getSymbol()
          Legend class symbol.
 int hashCode()
          the hashcode for this object
 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.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

RepresentationLegendClass

public RepresentationLegendClass(Object obj)
                          throws IOException
Construct a RepresentationLegendClass using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to RepresentationLegendClass.
Casting to this class from the return value of a method will not work, as this class represents an abstract class in ArcObjects.
*
RepresentationLegendClass o = (RepresentationLegendClass)obj; // will not work

RepresentationLegendClass o = new RepresentationLegendClass(obj); // Use this constructor instead
* @param obj an object returned from ArcGIS Engine or Server

Throws:
IOException - if there are interop problems RepresentationLegendClass theRepresentationLegendClass = (RepresentationLegendClass) obj;
Method Detail

equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

getRepresentationClass

public IRepresentationClass getRepresentationClass()
                                            throws IOException,
                                                   AutomationException
The feature class representation identified by the legend class.

Product Availability

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

Specified by:
getRepresentationClass in interface IRepresentationLegendClass
Returns:
A reference to a com.esri.arcgis.geodatabase.IRepresentationClass
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getRuleID

public int getRuleID()
              throws IOException,
                     AutomationException
The rule ID identified by the legend class.

Product Availability

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

Specified by:
getRuleID in interface IRepresentationLegendClass
Returns:
The ruleID
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSymbol

public ISymbol getSymbol()
                  throws IOException,
                         AutomationException
Legend class symbol.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getSymbol in interface ILegendClass
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

public 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

Specified by:
setSymbolByRef in interface ILegendClass
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

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getLabel in interface ILegendClass
Returns:
The label
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setLabel

public 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

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

getDescription

public 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

Specified by:
getDescription in interface ILegendClass
Returns:
The label
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setDescription

public 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

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

getFormat

public 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

Specified by:
getFormat in interface ILegendClass
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

public 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

Specified by:
setFormat in interface ILegendClass
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.