com.esri.arcgis.controls
Interface IEngineSketchOperation

All Superinterfaces:
IOperation, Serializable
All Known Implementing Classes:
EngineSketchOperation

public interface IEngineSketchOperation
extends IOperation, Serializable

Provides access to members that control undo/redo capabilities for edit sketch modifications.

Description

This interface is new at ArcGIS 9.3.

Use sketch operations to provide undo and redo capabilities when making modifications to the engine edit sketch. For example, if you wanted to insert a new point in the middle of the edit sketch, create a sketch operation so the edit can be undone. IEngineSketchOperation derives from IOperation giving these additional methods: CanRedo, CanUndo, Do, Redo, Undo. When undoing a sketch operation use either the IEngineSketchOperation::Undo method or the IOperationStack::Undo method available from the IToolbarControl::OperationStack property. Do not mix these 2 approaches.

Engine sketch operations are very similar to engine edit operations. First, call the Start method to flag the beginning of the sketch operation. Use the MenuString property to give the operation a name. Perform the edits. Call Finish to complete the sketch operation.

The Finish method allows tools to give more information about what they modified; typically, the edited sketch point is passed back to clients listening to engine editor events (IEngineEditEvents). For example, if a point is deleted from an edit sketch and IEngineSketchOperation::Finish is used to complete the operation, the deleted point is passed to the clients responding to IEngineEditEvents::OnVertexDeleted.

Product Availability

Available with ArcGIS Engine.


Method Summary
 void finish(IEnvelope invalEnv, int opType, Object data)
          Finishes the sketch operation and puts it into the operation stack.
 void setMenuString(String menuString)
          Sets the text that appears in the undo menu choice.
 void start(IEngineEditor editor)
          Starts the sketch operation and caches the existing sketch.
 
Methods inherited from interface com.esri.arcgis.systemUI.IOperation
esri_do, getMenuString, isCanRedo, isCanUndo, redo, undo
 

Method Detail

setMenuString

void setMenuString(String menuString)
                   throws IOException,
                          AutomationException
Sets the text that appears in the undo menu choice.

Product Availability

Available with ArcGIS Engine.

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

start

void start(IEngineEditor editor)
           throws IOException,
                  AutomationException
Starts the sketch operation and caches the existing sketch. Call this before modifying the sketch.

Description

Modifications made to an edit sketch should be contained between calls to Start and Finish. Start caches the edit sketch's geometry in case the sketch operation is undone; when this occurs, the modified geometry is replaced by the cached geometry.

Product Availability

Available with ArcGIS Engine.

Parameters:
editor - A reference to a com.esri.arcgis.controls.IEngineEditor (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

finish

void finish(IEnvelope invalEnv,
            int opType,
            Object data)
            throws IOException,
                   AutomationException
Finishes the sketch operation and puts it into the operation stack. Call this after the sketch has been modified.

Description

The Finish method completes the sketch operation and adds the sketch operation to the top of the operations stack. The method allows tools to give more information about what they modified using the following parameters; InvalEnv, OpType and Data.

InvalEnv determines the envelope that will be invalidated (refreshed) when the sketch operation is completed. OpType determines which method on IEngineEditSketch will be fired to notify all listeners that the edit sketch has changed and give them appropriate information as to how the edit sketch was modified. Data is a variant value that can pass an IPoint as an argument to the appropriate method on IEngineEditSketch, such as OnVertexAdded.

Product Availability

Available with ArcGIS Engine.

Parameters:
invalEnv - A reference to a com.esri.arcgis.geometry.IEnvelope (in)
opType - A com.esri.arcgis.controls.esriEngineSketchOperationType constant (in)
data - A Variant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.