com.esri.arcgis.carto
Class ConvertLabelsToAnnotation

java.lang.Object
  extended by com.esri.arcgis.carto.ConvertLabelsToAnnotation
All Implemented Interfaces:
IConvertLabelsToAnnotation, com.esri.arcgis.interop.RemoteObjRef, ISupportErrorInfo, Serializable

public class ConvertLabelsToAnnotation
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IConvertLabelsToAnnotation, ISupportErrorInfo

An Esri convert labels to annotation helper class.

Remarks

ConvertLabelsToAnnotation is a coarse grained object that simplifies the process of converting labels to annotation. Conversion to Geodatabase or Map Annotation is supported via the object. See IConvertLabelsToAnnotation for more information on how to setup a conversion.

Product Availability

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

See Also:
Serialized Form

Constructor Summary
ConvertLabelsToAnnotation()
          Constructs a ConvertLabelsToAnnotation using ArcGIS Engine.
ConvertLabelsToAnnotation(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
ConvertLabelsToAnnotation theConvertLabelsToAnnotation = (ConvertLabelsToAnnotation) obj;
 
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.
 boolean equals(Object o)
          Compare this object with another
 IEnumLayer getAnnoLayers()
          New database annotation layers created by the conversion process.
static String getClsid()
          getClsid.
 String getErrorInfo()
          Error information generated by the conversion process.
 int hashCode()
          the hashcode for this object
 void initialize(IMap pMap, int storageType, int whichFeatures, boolean generateUnplacedAnnotation, ITrackCancel pTrackCancel, IAnnotationErrorEvents pAnnotationErrorEvents)
          Call this method first to initialize the converter.
 void interfaceSupportsErrorInfo(GUID riid)
          interfaceSupportsErrorInfo
 
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

ConvertLabelsToAnnotation

public ConvertLabelsToAnnotation()
                          throws IOException,
                                 UnknownHostException
Constructs a ConvertLabelsToAnnotation using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

ConvertLabelsToAnnotation

public ConvertLabelsToAnnotation(Object obj)
                          throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
ConvertLabelsToAnnotation theConvertLabelsToAnnotation = (ConvertLabelsToAnnotation) obj;

Construct a ConvertLabelsToAnnotation using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to ConvertLabelsToAnnotation.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


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

initialize

public 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.

Specified by:
initialize in interface IConvertLabelsToAnnotation
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

public 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.

Specified by:
addFeatureLayer in interface IConvertLabelsToAnnotation
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

public 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.

Specified by:
convertLabels in interface IConvertLabelsToAnnotation
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getAnnoLayers

public 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.

Specified by:
getAnnoLayers in interface IConvertLabelsToAnnotation
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

public 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.

Specified by:
getErrorInfo in interface IConvertLabelsToAnnotation
Returns:
The info
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

interfaceSupportsErrorInfo

public void interfaceSupportsErrorInfo(GUID riid)
                                throws IOException,
                                       AutomationException
interfaceSupportsErrorInfo

Description

Indicates whether the interface supports IErrorInfo.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
interfaceSupportsErrorInfo in interface ISupportErrorInfo
Parameters:
riid - A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.