com.esri.arcgis.carto
Interface IConvertLabelsToAnnotation

All Superinterfaces:
Serializable
All Known Implementing Classes:
ConvertLabelsToAnnotation

public interface IConvertLabelsToAnnotation
extends Serializable

Provides access to the properties that control the conversion of labels to annotation.

Remarks

IConvertLabelsToAnnotation provides access to the methods and properties of the ConvertLabelsToAnnotation object. ConvertLabelsToAnnotation is a coarse grained object that performs the steps needed to convert labels to annotation. To perform a conversion, follow these steps:

  1. Initialize the conversion object. See the Initialize method for more information on what each parameter specifies.
  2. Next, add each layer from the map you wish to convert labels to annotation for. See the AddFeatureLayer method for more information on what each parameter specifies.
  3. Next, perform the conversion by calling the ConvertLabels method.
  4. Following the conversion, retrieve populated geodatabase annotation layers from the object via the AnnoLayers property. Map annotation layers are added to the map automatically and will not be included in the enumeration.
  5. Finally, any error information can be retrieved via the ErrorInfo property.

Product Availability

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


Method Summary
 void addFeatureLayer(IFeatureLayer pFeatureLayer, String annoLayerName, IFeatureWorkspace pFeatureWorkspace, IFeatureDataset pFeatureDataset, boolean featureLinked, boolean appendMode, boolean requireSymbolID, boolean autoCreate, boolean autoUpdate, String configKeyword)
          Call this method for each feature layer be converted to annotation.
 void convertLabels()
          Convert labels to annotation.
 IEnumLayer getAnnoLayers()
          New database annotation layers created by the conversion process.
 String getErrorInfo()
          Error information generated by the conversion process.
 void initialize(IMap pMap, int storageType, int whichFeatures, boolean generateUnplacedAnnotation, ITrackCancel pTrackCancel, IAnnotationErrorEvents pAnnotationErrorEvents)
          Call this method first to initialize the converter.
 

Method Detail

initialize

void initialize(IMap pMap,
                int storageType,
                int whichFeatures,
                boolean generateUnplacedAnnotation,
                ITrackCancel pTrackCancel,
                IAnnotationErrorEvents pAnnotationErrorEvents)
                throws IOException,
                       AutomationException
Call this method first to initialize the converter.

Remarks

This method initializes the conversion object with the global parameters for conversion. It is the first method that should be called when using the ConvertLabelsToAnnotation object. The initialization has the following inputs:

Product Availability

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

Parameters:
pMap - A reference to a com.esri.arcgis.carto.IMap (in)
storageType - A com.esri.arcgis.carto.esriAnnotationStorageType constant (in)
whichFeatures - A com.esri.arcgis.carto.esriLabelWhichFeatures constant (in)
generateUnplacedAnnotation - The generateUnplacedAnnotation (in)
pTrackCancel - A reference to a com.esri.arcgis.system.ITrackCancel (in)
pAnnotationErrorEvents - A reference to a com.esri.arcgis.carto.IAnnotationErrorEvents (in, optional, pass 0 if not required)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addFeatureLayer

void addFeatureLayer(IFeatureLayer pFeatureLayer,
                     String annoLayerName,
                     IFeatureWorkspace pFeatureWorkspace,
                     IFeatureDataset pFeatureDataset,
                     boolean featureLinked,
                     boolean appendMode,
                     boolean requireSymbolID,
                     boolean autoCreate,
                     boolean autoUpdate,
                     String configKeyword)
                     throws IOException,
                            AutomationException
Call this method for each feature layer be converted to annotation.

Remarks

This method adds a layer to the list of layers for which labels will be converted into annotation. Initialize should be called on the ConvertLabelsToAnnotation object before calling this method. This method may be called multiple times for one conversion when more that one layer will be converted.

Depending on the storage type chosen in initialize, some of the input parameters are optional. For map annotation, input the following items:

~ A reference to the feature layer the labels will be converted from
~ The name of the annotation group that will added to the map
~ For geodatabase annotation, input the following items:
~ A reference to the feature layer the labels will be converted from
~ The name of the annotation feature class that will either be created or appended to (see the append mode section below for more information)
~ The workspace the annotation feature class will reside in
~ The feature dataset the annotation feature class will reside in
~ The option to create feature linked annotation or not (True or False)
~ The option to append to an existing class or not (True or False). See the note about append below for more information.
~ The option on whether or not the created annotation feature class should require that elements reference a symbol in the symbol collection. (This option is not used if append mode = True).
~ The option on whether or not the annotation feature class should auto create new annotation features when a related feature is created (This option is not used if append mode = True and only applies for feature-linked annotation).
~ The option on whether or not the annotation feature class should auto update exiting annotation features when a related feature shape is changed (This option is not used if append mode = True and only applies for feature-linked annotation).
~ The configuration keyword to create the feature class with (This option is not used if append mode = True).

Append Mode:

If appendMode is True, the converter will look for the provided annotation class name in the specified workspace/feature dataset and convert labels to annotation features in that feature class. Append mode also performs additional logic to match existing annotation classes in the feature class with label classes being converted. If the classes match, they will be used rather than added to the annotation feature class extensions properties collection. If updates to the class extension are needed, an exclusive schema lock is required and an attempt will be made to obtain one.

If appendMode is false, a new annotation feature class will be created in specified workspace and feature dataset with the specified name and parameters as listed above.

Product Availability

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

Parameters:
pFeatureLayer - A reference to a com.esri.arcgis.carto.IFeatureLayer (in)
annoLayerName - The annoLayerName (in)
pFeatureWorkspace - A reference to a com.esri.arcgis.geodatabase.IFeatureWorkspace (in, optional, pass 0 if not required)
pFeatureDataset - A reference to a com.esri.arcgis.geodatabase.IFeatureDataset (in, optional, pass 0 if not required)
featureLinked - The featureLinked (in, optional, pass false if not required)
appendMode - The appendMode (in, optional, pass false if not required)
requireSymbolID - The requireSymbolID (in, optional, pass false if not required)
autoCreate - The autoCreate (in, optional, pass false if not required)
autoUpdate - The autoUpdate (in, optional, pass false if not required)
configKeyword - The configKeyword (in, optional, pass if not required)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

convertLabels

void convertLabels()
                   throws IOException,
                          AutomationException
Convert labels to annotation.

Remarks

The ConvertLabels method is used to perform the conversion process after the object has been initialized via the Initialize method and the layers have been added via AddFeatureLayer. ConvertLabels automatically adds map annotation to the map. Geodatabase annotation layers are not automatically added to the map and are instead provided in an enumeration via the AnnoLayers property.

Product Availability

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

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

getAnnoLayers

IEnumLayer getAnnoLayers()
                         throws IOException,
                                AutomationException
New database annotation layers created by the conversion process.

Remarks

Following the ConvertLabels method, geodatabase annotation layers are returned via this property.

Product Availability

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

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

getErrorInfo

String getErrorInfo()
                    throws IOException,
                           AutomationException
Error information generated by the conversion process.

Remarks

This property returns a string of error information resulting from the conversion.

Product Availability

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

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