com.esri.arcgis.editor
Interface IEditSketchExtension2

All Superinterfaces:
Serializable
All Known Implementing Classes:
AnnotationEditExtension

public interface IEditSketchExtension2
extends Serializable

Provides access to members that extend the edit sketch.

Remarks

Edit sketch extensions typically work as follows:

The current edit task calls each registered edit sketch extension’s Applies function; the first one to return True becomes the active extension and its Activate method is called. Each extension performs certain tests in its
Applies method to determine if it should be activated. This typically involves checking the current task, the current target layer, and, when modifying a feature, the currently selected features. Most extensions just override the Create New Feature task and the Modify Feature task.

Once an extension has become active, it sets the geometry type of the edit sketch. The extension then optionally sets up a new feedback mechanism; this typically involves the use of one of the feedback objects, such as NewLineCircleFeedback. For example, a custom edit sketch extension may create perfect circles by allowing users to enter a center point and another point defining the radius. When a user modifies the feature, they are presented with one point instead of an entire polygon; this limits them to only changing the radius, rather than adding new vertices and creating a shape that is an imperfect circle.

When To Use

Edit sketch extensions let programmers alter the edit sketch geometry,edit sketch display feedback mechanism, and pre-sketch feedback. Implement this interface along with IExtension to create a custom edit sketch extension.

Product Availability

Available with ArcGIS Desktop.

See Also:
ISnapEnvironment, IEditProperties, IExtension, IEditTask.activate(com.esri.arcgis.editor.IEditor, com.esri.arcgis.editor.IEditTask), IEditor, IEditLayers, IEditTask.deactivate(), IEditAttributeProperties, IEditEvents2, IEditTask.onFinishSketch(), IDatasetEdit, IDatasetEditInfo, IEditTask.onDeleteSketch(), IEditTask.getName(), IEditEvents, Editor, IEditSketch

Method Summary
 void activate(IEditor editor)
          Called when the sketch extension is about to be used.
 boolean applies(IEditor editor)
          Indicates whether this extension applies to the current edit environment.
 void beforeStoreFeature(IFeature feature, IGeometry geometry)
          Lets the extension know the feature is about to be stored.
 IDisplayFeedback createFeedback()
          Called when a new feedback is needed.
 IDisplayFeedback createPreSketchFeedback()
          Called when a new feedback is needed before the sketch starts.
 IGeometry createSketchGeometry(IFeature feature)
          The geometry that will be used in the sketch when modifying a feature.
 void deactivate()
          Called when the sketch extension is no longer needed.
 int getSketchGeometryType()
          The geometry type used for the edit sketch when creating new features.
 boolean isCanDeleteVertices()
          Indicates whether the sketch allows the deleting of vertices.
 boolean isCanInsertVertices()
          Indicates whether the sketch allows the inserting of additional vertices.
 boolean isCanMoveVertices()
          Indicates whether the sketch allows the moving of vertices.
 boolean isHasFeedback()
          Indicates whether the SketchExtension will use a custom feedback.
 boolean isHasPreSketchFeedback()
          Indicates whether the SketchExtension will use a custom feedback before the sketch starts.
 void onKeyDown(int keyState, int shift)
          Called when a key is pressed.
 void onKeyUp(int keyState, int shift)
          Called when a key is pressed.
 void startFeedback(IPoint point)
          Called when the feedback needs to be started.
 void startFeedbackFromShape(IGeometry shape)
          Called when the feedback needs to be started using an existing geometry.
 void startPreSketchFeedback(IPoint point)
          Called when the feedback needs to be started.
 IGeometry stopFeedback()
          Called when the feedback is no longer necessary.
 void stopPreSketchFeedback()
          Called when the feedback needs to be stopped.
 

Method Detail

applies

boolean applies(IEditor editor)
                throws IOException,
                       AutomationException
Indicates whether this extension applies to the current edit environment.

Remarks

The ::Applies() method is called by the controller when attempting to determine if the extension applies or not.

If more than one class is found implementing IEditSketchExtension the current tool or task will utilize the first extension which ::Applies() returns VARIANT_TRUE.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
editor - A reference to a com.esri.arcgis.editor.IEditor (in)
Returns:
The applies
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ISnapEnvironment, IEditProperties, IExtension, IEditTask.activate(com.esri.arcgis.editor.IEditor, com.esri.arcgis.editor.IEditTask), IEditor, IEditLayers, IEditTask.deactivate(), IEditAttributeProperties, IEditEvents2, IEditTask.onFinishSketch(), IDatasetEdit, IDatasetEditInfo, IEditTask.onDeleteSketch(), IEditTask.getName(), IEditEvents, Editor, IEditSketch

activate

void activate(IEditor editor)
              throws IOException,
                     AutomationException
Called when the sketch extension is about to be used.

Remarks

The ::Activate() method is called by the controller when the EditSktechExtension has been applied and is being initiated for use.

This method is called only if ::Applies() returns VARIANT_TRUE.

Use this method to obtain a reference to the controller (Editor).

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
editor - A reference to a com.esri.arcgis.editor.IEditor (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ISnapEnvironment, IEditProperties, IExtension, IEditTask.activate(com.esri.arcgis.editor.IEditor, com.esri.arcgis.editor.IEditTask), IEditor, IEditLayers, IEditTask.deactivate(), IEditAttributeProperties, IEditEvents2, IEditTask.onFinishSketch(), IDatasetEdit, IDatasetEditInfo, IEditTask.onDeleteSketch(), IEditTask.getName(), IEditEvents, Editor, IEditSketch

deactivate

void deactivate()
                throws IOException,
                       AutomationException
Called when the sketch extension is no longer needed.

Remarks

The ::Deactivate() method is the last method called by the controller on the extension. Use it to release any unneeded memory reference pointers which the extension may have been holding on to.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ISnapEnvironment, IEditProperties, IExtension, IEditTask.activate(com.esri.arcgis.editor.IEditor, com.esri.arcgis.editor.IEditTask), IEditor, IEditLayers, IEditTask.deactivate(), IEditAttributeProperties, IEditEvents2, IEditTask.onFinishSketch(), IDatasetEdit, IDatasetEditInfo, IEditTask.onDeleteSketch(), IEditTask.getName(), IEditEvents, Editor, IEditSketch

beforeStoreFeature

void beforeStoreFeature(IFeature feature,
                        IGeometry geometry)
                        throws IOException,
                               AutomationException
Lets the extension know the feature is about to be stored.

Remarks

The ::BeforeStoreFeature() method is the final call before the feature and its geometry are stored into the base table. Use this method to obtain the sketch geometry, modify it if necessary, and pass it back to the feature.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
feature - A reference to a com.esri.arcgis.geodatabase.IFeature (in)
geometry - A reference to a com.esri.arcgis.geometry.IGeometry (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ISnapEnvironment, IEditProperties, IExtension, IEditTask.activate(com.esri.arcgis.editor.IEditor, com.esri.arcgis.editor.IEditTask), IEditor, IEditLayers, IEditTask.deactivate(), IEditAttributeProperties, IEditEvents2, IEditTask.onFinishSketch(), IDatasetEdit, IDatasetEditInfo, IEditTask.onDeleteSketch(), IEditTask.getName(), IEditEvents, Editor, IEditSketch

isCanInsertVertices

boolean isCanInsertVertices()
                            throws IOException,
                                   AutomationException
Indicates whether the sketch allows the inserting of additional vertices.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
The canInsert
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ISnapEnvironment, IEditProperties, IExtension, IEditTask.activate(com.esri.arcgis.editor.IEditor, com.esri.arcgis.editor.IEditTask), IEditor, IEditLayers, IEditTask.deactivate(), IEditAttributeProperties, IEditEvents2, IEditTask.onFinishSketch(), IDatasetEdit, IDatasetEditInfo, IEditTask.onDeleteSketch(), IEditTask.getName(), IEditEvents, Editor, IEditSketch

isCanDeleteVertices

boolean isCanDeleteVertices()
                            throws IOException,
                                   AutomationException
Indicates whether the sketch allows the deleting of vertices.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
The canDelete
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ISnapEnvironment, IEditProperties, IExtension, IEditTask.activate(com.esri.arcgis.editor.IEditor, com.esri.arcgis.editor.IEditTask), IEditor, IEditLayers, IEditTask.deactivate(), IEditAttributeProperties, IEditEvents2, IEditTask.onFinishSketch(), IDatasetEdit, IDatasetEditInfo, IEditTask.onDeleteSketch(), IEditTask.getName(), IEditEvents, Editor, IEditSketch

isCanMoveVertices

boolean isCanMoveVertices()
                          throws IOException,
                                 AutomationException
Indicates whether the sketch allows the moving of vertices.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
The canMove
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ISnapEnvironment, IEditProperties, IExtension, IEditTask.activate(com.esri.arcgis.editor.IEditor, com.esri.arcgis.editor.IEditTask), IEditor, IEditLayers, IEditTask.deactivate(), IEditAttributeProperties, IEditEvents2, IEditTask.onFinishSketch(), IDatasetEdit, IDatasetEditInfo, IEditTask.onDeleteSketch(), IEditTask.getName(), IEditEvents, Editor, IEditSketch

getSketchGeometryType

int getSketchGeometryType()
                          throws IOException,
                                 AutomationException
The geometry type used for the edit sketch when creating new features.

Remarks

The ::SketchGeometryType() method is used to specify the geometry type of the editsketch. Keep in mind that this can be different than the geometry type of the feature.

You may want the geometry type of the editsketch to be polygon yet ultimately store it in a featureclass of geometry type polyline.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
A com.esri.arcgis.geometry.esriGeometryType constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ISnapEnvironment, IEditProperties, IExtension, IEditTask.activate(com.esri.arcgis.editor.IEditor, com.esri.arcgis.editor.IEditTask), IEditor, IEditLayers, IEditTask.deactivate(), IEditAttributeProperties, IEditEvents2, IEditTask.onFinishSketch(), IDatasetEdit, IDatasetEditInfo, IEditTask.onDeleteSketch(), IEditTask.getName(), IEditEvents, Editor, IEditSketch

createSketchGeometry

IGeometry createSketchGeometry(IFeature feature)
                               throws IOException,
                                      AutomationException
The geometry that will be used in the sketch when modifying a feature.

Remarks

Use this method when either 1) modifying an existing feature's geometry or 2) creating a new geometry for the EditSketch to use initially.

You can start with the geometry of the feature you have been given the reference to, possibly modify it, and pass it back out -or- create a completely new geometry for intial use by the EditSketch.

This is primarily used in conjunction with the modify task.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
feature - A reference to a com.esri.arcgis.geodatabase.IFeature (in)
Returns:
A reference to a com.esri.arcgis.geometry.IGeometry
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ISnapEnvironment, IEditProperties, IExtension, IEditTask.activate(com.esri.arcgis.editor.IEditor, com.esri.arcgis.editor.IEditTask), IEditor, IEditLayers, IEditTask.deactivate(), IEditAttributeProperties, IEditEvents2, IEditTask.onFinishSketch(), IDatasetEdit, IDatasetEditInfo, IEditTask.onDeleteSketch(), IEditTask.getName(), IEditEvents, Editor, IEditSketch

isHasFeedback

boolean isHasFeedback()
                      throws IOException,
                             AutomationException
Indicates whether the SketchExtension will use a custom feedback.

Remarks

Use this method to indicate whether the EditSketchExtension will provide the controller with a custom feedback object.

Returning a value of VARIANT_TRUE will indicate to the controller that it must call the ::CreateFeedback() method in order to create the custom feedback object to be used.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
The hasFeedback
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ISnapEnvironment, IEditProperties, IExtension, IEditTask.activate(com.esri.arcgis.editor.IEditor, com.esri.arcgis.editor.IEditTask), IEditor, IEditLayers, IEditTask.deactivate(), IEditAttributeProperties, IEditEvents2, IEditTask.onFinishSketch(), IDatasetEdit, IDatasetEditInfo, IEditTask.onDeleteSketch(), IEditTask.getName(), IEditEvents, Editor, IEditSketch

createFeedback

IDisplayFeedback createFeedback()
                                throws IOException,
                                       AutomationException
Called when a new feedback is needed.

Remarks

The ::CreateFeedback() method is called by the controller to initiate the creation of a custom feedback object associated to the EditSketchExtension .

Use this method to create your feedback object and pass it out so the Editor can use it.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
A reference to a com.esri.arcgis.display.IDisplayFeedback
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ISnapEnvironment, IEditProperties, IExtension, IEditTask.activate(com.esri.arcgis.editor.IEditor, com.esri.arcgis.editor.IEditTask), IEditor, IEditLayers, IEditTask.deactivate(), IEditAttributeProperties, IEditEvents2, IEditTask.onFinishSketch(), IDatasetEdit, IDatasetEditInfo, IEditTask.onDeleteSketch(), IEditTask.getName(), IEditEvents, Editor, IEditSketch

startFeedback

void startFeedback(IPoint point)
                   throws IOException,
                          AutomationException
Called when the feedback needs to be started.

Remarks

The ::StartFeedback() method is called by the controller after the custom feedback object has been created and is ready for use.

This method passes a copy of the Editor's ::CurrentLocation() as input. This point can be used as the starting point for the DisplayFeedback.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
point - A reference to a com.esri.arcgis.geometry.IPoint (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ISnapEnvironment, IEditProperties, IExtension, IEditTask.activate(com.esri.arcgis.editor.IEditor, com.esri.arcgis.editor.IEditTask), IEditor, IEditLayers, IEditTask.deactivate(), IEditAttributeProperties, IEditEvents2, IEditTask.onFinishSketch(), IDatasetEdit, IDatasetEditInfo, IEditTask.onDeleteSketch(), IEditTask.getName(), IEditEvents, Editor, IEditSketch

stopFeedback

IGeometry stopFeedback()
                       throws IOException,
                              AutomationException
Called when the feedback is no longer necessary.

Remarks

The ::StopFeedback() is called to when the feedback object is no longer needed for the operation.

Use this method to call ::Stop() on the feedback object and return the geometry of that object if necessary.

Example: If your custom feedback object is a type of INewBezierCurveFeedback calling ::Stop() will end feedback and return the geometry so it can be used as the geometry of the resulting feature.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
A reference to a com.esri.arcgis.geometry.IGeometry
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ISnapEnvironment, IEditProperties, IExtension, IEditTask.activate(com.esri.arcgis.editor.IEditor, com.esri.arcgis.editor.IEditTask), IEditor, IEditLayers, IEditTask.deactivate(), IEditAttributeProperties, IEditEvents2, IEditTask.onFinishSketch(), IDatasetEdit, IDatasetEditInfo, IEditTask.onDeleteSketch(), IEditTask.getName(), IEditEvents, Editor, IEditSketch

startFeedbackFromShape

void startFeedbackFromShape(IGeometry shape)
                            throws IOException,
                                   AutomationException
Called when the feedback needs to be started using an existing geometry.

Remarks

The ::StartFeedbackFromShape() method is called by the controller to determine if the custom feedback object will be supplied with an initial geometry.

Example: Pass in a circular geometry and resize it via the feedback to determine a buffer zone.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
shape - A reference to a com.esri.arcgis.geometry.IGeometry (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ISnapEnvironment, IEditProperties, IExtension, IEditTask.activate(com.esri.arcgis.editor.IEditor, com.esri.arcgis.editor.IEditTask), IEditor, IEditLayers, IEditTask.deactivate(), IEditAttributeProperties, IEditEvents2, IEditTask.onFinishSketch(), IDatasetEdit, IDatasetEditInfo, IEditTask.onDeleteSketch(), IEditTask.getName(), IEditEvents, Editor, IEditSketch

isHasPreSketchFeedback

boolean isHasPreSketchFeedback()
                               throws IOException,
                                      AutomationException
Indicates whether the SketchExtension will use a custom feedback before the sketch starts.

Remarks

Use this method to indicate whether the EditSketchExtension will provide the controller with a custom feedback object used prior to that of the Edit Sketch.

Returning a value of VARIANT_TRUE will indicate to the controller that it must call the ::CreatePreSketchFeedback() method in order to create the custom feedback object to be used.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
The hasFeedback
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ISnapEnvironment, IEditProperties, IExtension, IEditTask.activate(com.esri.arcgis.editor.IEditor, com.esri.arcgis.editor.IEditTask), IEditor, IEditLayers, IEditTask.deactivate(), IEditAttributeProperties, IEditEvents2, IEditTask.onFinishSketch(), IDatasetEdit, IDatasetEditInfo, IEditTask.onDeleteSketch(), IEditTask.getName(), IEditEvents, Editor, IEditSketch

createPreSketchFeedback

IDisplayFeedback createPreSketchFeedback()
                                         throws IOException,
                                                AutomationException
Called when a new feedback is needed before the sketch starts.

Remarks

The ::CreatePreSketchFeedback() method is called by the controller to initiate the creation of a custom feedback object associated to the EditSketchExtension.

This feedback object will be used prior that of the feedback object associated to the Edit Sketch.

Use this method to create your PreSketchFeedback object and pass it out so the Editor can use it.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
A reference to a com.esri.arcgis.display.IDisplayFeedback
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ISnapEnvironment, IEditProperties, IExtension, IEditTask.activate(com.esri.arcgis.editor.IEditor, com.esri.arcgis.editor.IEditTask), IEditor, IEditLayers, IEditTask.deactivate(), IEditAttributeProperties, IEditEvents2, IEditTask.onFinishSketch(), IDatasetEdit, IDatasetEditInfo, IEditTask.onDeleteSketch(), IEditTask.getName(), IEditEvents, Editor, IEditSketch

startPreSketchFeedback

void startPreSketchFeedback(IPoint point)
                            throws IOException,
                                   AutomationException
Called when the feedback needs to be started.

Remarks

The ::StartPreSketchFeedback() method is called by the controller after the presketch custom feedback object has been created and is ready for use.

This method passes a copy of the Editor's ::CurrentLocation() as input. This point can be used as the starting point for the DisplayFeedback.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
point - A reference to a com.esri.arcgis.geometry.IPoint (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ISnapEnvironment, IEditProperties, IExtension, IEditTask.activate(com.esri.arcgis.editor.IEditor, com.esri.arcgis.editor.IEditTask), IEditor, IEditLayers, IEditTask.deactivate(), IEditAttributeProperties, IEditEvents2, IEditTask.onFinishSketch(), IDatasetEdit, IDatasetEditInfo, IEditTask.onDeleteSketch(), IEditTask.getName(), IEditEvents, Editor, IEditSketch

stopPreSketchFeedback

void stopPreSketchFeedback()
                           throws IOException,
                                  AutomationException
Called when the feedback needs to be stopped.

Remarks

The ::StopPreSketchFeedback() is called to when the presketch feedback object is no longer needed for the operation.

Use this method to call ::Stop() on the presketch feedback object and return the geometry of that object if necessary.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ISnapEnvironment, IEditProperties, IExtension, IEditTask.activate(com.esri.arcgis.editor.IEditor, com.esri.arcgis.editor.IEditTask), IEditor, IEditLayers, IEditTask.deactivate(), IEditAttributeProperties, IEditEvents2, IEditTask.onFinishSketch(), IDatasetEdit, IDatasetEditInfo, IEditTask.onDeleteSketch(), IEditTask.getName(), IEditEvents, Editor, IEditSketch

onKeyDown

void onKeyDown(int keyState,
               int shift)
               throws IOException,
                      AutomationException
Called when a key is pressed.

Remarks

Use this event to associate a hotkey to your custom sketch tool.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
keyState - The keyState (in)
shift - The shift (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ISnapEnvironment, IEditProperties, IExtension, IEditTask.activate(com.esri.arcgis.editor.IEditor, com.esri.arcgis.editor.IEditTask), IEditor, IEditLayers, IEditTask.deactivate(), IEditAttributeProperties, IEditEvents2, IEditTask.onFinishSketch(), IDatasetEdit, IDatasetEditInfo, IEditTask.onDeleteSketch(), IEditTask.getName(), IEditEvents, Editor, IEditSketch

onKeyUp

void onKeyUp(int keyState,
             int shift)
             throws IOException,
                    AutomationException
Called when a key is pressed.

Remarks

Use this event to associate a hotkey to your custom sketch tool.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
keyState - The keyState (in)
shift - The shift (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ISnapEnvironment, IEditProperties, IExtension, IEditTask.activate(com.esri.arcgis.editor.IEditor, com.esri.arcgis.editor.IEditTask), IEditor, IEditLayers, IEditTask.deactivate(), IEditAttributeProperties, IEditEvents2, IEditTask.onFinishSketch(), IDatasetEdit, IDatasetEditInfo, IEditTask.onDeleteSketch(), IEditTask.getName(), IEditEvents, Editor, IEditSketch