com.esri.arcgis.controls
Interface IEngineEditor

All Superinterfaces:
Serializable
All Known Subinterfaces:
IEngineEditor2
All Known Implementing Classes:
EngineEditor

public interface IEngineEditor
extends Serializable

Provides access to members that control the behavior of the EngineEditor.

Description

This interface is new at ArcGIS 9.3.

This is the main interface used to control the actions of the EngineEditor. For example, use the members in this interface to start and stop an edit session, create and manage edit operations, and set the IEngineEditor::CurrentTask.

Product Availability

Available with ArcGIS Engine.


Method Summary
 void abortOperation()
          Aborts an edit operation.
 void addTask(IEngineEditTask task)
          Adds a task to the EngineEditor.
 void enableUndoRedo(boolean enabled)
          Indicates if undo/redo capabilities are enabled.
 IEngineEditTask getCurrentTask()
          The current edit task.
 IEnumFeature getEditSelection()
          The selected features that are editable.
 int getEditSessionMode()
          The current edit session mode.
 int getEditState()
          The EngineEditor's current edit state.
 IWorkspace getEditWorkspace()
          The workspace being edited.
 IMap getMap()
          The map being edited.
 int getSelectionCount()
          The number of selected features that are editable.
 IEngineEditTask getTask(int index)
          The edit task at the specified index.
 IEngineEditTask getTaskByUniqueName(String uniqueName)
          Retrieves a task by UniqueName from the EngineEditor.
 int getTaskCount()
          The number of edit tasks.
 boolean hasEdits()
          Indicates if edits have been made.
 void invertAgent(IPoint location, int hdc)
          Draws the EngineEditor's snapping agent.
 void setCurrentTaskByRef(IEngineEditTask task)
          The current edit task.
 void setEditSessionMode(int mode)
          The current edit session mode.
 void startEditing(IWorkspace workspace, IMap map)
          Starts an edit session.
 void startOperation()
          Starts an edit operation.
 void stopEditing(boolean saveChanges)
          Stops an edit session.
 void stopOperation(String operationName)
          Stops an edit operation.
 

Method Detail

getEditState

int getEditState()
                 throws IOException,
                        AutomationException
The EngineEditor's current edit state.

Description

The EditState property communicates the current edit state of the EngineEditor. The esriEngineEditState constants provide the valid edit states.

Product Availability

Available with ArcGIS Engine.

Returns:
A com.esri.arcgis.controls.esriEngineEditState constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getEditWorkspace

IWorkspace getEditWorkspace()
                            throws IOException,
                                   AutomationException
The workspace being edited.

Description

The EditWorkspace property returns a reference to the workspace being edited. Only one workspace can be edited at a time. The EditWorkspace property is set by the IEngineEditor::StartEditing method and the ControlsEditingStartCommand.

Product Availability

Available with ArcGIS Engine.

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

startEditing

void startEditing(IWorkspace workspace,
                  IMap map)
                  throws IOException,
                         AutomationException
Starts an edit session.

Description

Starts an editing session using the specified IMap and IWorkspace parameters. Only one map and workspace can be edited at a time.

Remarks

This method fires the IEngineEditEvents::OnStartEditing, IEngineEditEvents::OnSelectionChanged, IEngineEditEvents::OnTargetLayerChanged and IEngineEditEvents::OnSketchModified events.

Product Availability

Available with ArcGIS Engine.

Parameters:
workspace - A reference to a com.esri.arcgis.geodatabase.IWorkspace (in)
map - A reference to a com.esri.arcgis.carto.IMap (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

stopEditing

void stopEditing(boolean saveChanges)
                 throws IOException,
                        AutomationException
Stops an edit session.

Description

Stops an editing session. Changes can be saved by setting the saveChanges parameter to be True or discarded by setting the parameter to be False.

StopEditing also clears all snap agents and unselects all selected features.

Remarks

This method fires the IEngineEditEvents::OnBeforeStopEditing, IEngineEditEvents::OnStopEditing and IEngineEditEvents::OnTargetLayerChanged events.

Product Availability

Available with ArcGIS Engine.

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

hasEdits

boolean hasEdits()
                 throws IOException,
                        AutomationException
Indicates if edits have been made.

Description

This property reports whether or not any edits have been made in the current edit session. For example, if this property returns False then editing can be stopped without saving the changes by calling IEngineEditor::StopEditing with the False parameter.

Remarks





Product Availability

Available with ArcGIS Engine.

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

startOperation

void startOperation()
                    throws IOException,
                           AutomationException
Starts an edit operation.

Description

StartOperation marks the beginning of an edit operation. To provide undo/redo capability programmatically all edits must be performed within an edit operation.


Calling IEngineEditor::StopOperation completes an edit operation which is then added to the top of the operation stack. The operation stack is how ArcGIS Engine implements Undo and Redo. When using StartOperation, proper error handling, including the use of IEgineEditor::AbortOperation, is neccessary.


Edit operations cannot be nested; calling StartOperation within another operation will raise an error.

Remarks

This method fires the IEngineEditEvents::OnStartOperation event.

Product Availability

Available with ArcGIS Engine.

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

abortOperation

void abortOperation()
                    throws IOException,
                           AutomationException
Aborts an edit operation.

Description

AbortOperation should be used to terminate the edit operation without saving any changes. Those changes that were made after IEngineEditor::StartOperation was called are undone, and nothing is added to the operation stack.

You may wish to test that your edit operation is valid before saving any changes. If the test fails you should call AbortOperation instead of IEngineEditor::StopOperation.

Remarks

This method fires theIEngineEditEvents::OnSelectionChanged and IEngineEditEvents::OnAbort events.

Product Availability

Available with ArcGIS Engine.

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

stopOperation

void stopOperation(String operationName)
                   throws IOException,
                          AutomationException
Stops an edit operation.

Description

StopOperation marks the end of an edit operation. Calling StopOperation creates an edit operation that is added to the top of the operation stack. The operation stack is how ArcGIS Engine implements Undo and Redo.

When using IEngineEditor::StartOperation proper handling of errors, including the use of IEngineEditor::AbortOperation, is neccessary.

The string argument allows the operation to be identified on the operaton stack.

Remarks

This method fires the IEngineEditEvents::OnBeforeStopOperation and IEngineEditEvents::OnStopOperation events.

Product Availability

Available with ArcGIS Engine.

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

enableUndoRedo

void enableUndoRedo(boolean enabled)
                    throws IOException,
                           AutomationException
Indicates if undo/redo capabilities are enabled.

Description

Use EnableUndoRedo to control whether edits to features can be rolled back. When set to True, an edit made programmatically must be performed within an edit operation so that it can be rolled back. When set to False, no individual edit operation can be undone.

Calling IEngineEditor::StopEditing with a False parameter will discard all of the edits made in the edit session.

By default EnableUndoRedo is True. The method can only be called when there is an active edit session and only applies to edit operations; it does not apply to sketch operations.

Product Availability

Available with ArcGIS Engine.

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

getEditSelection

IEnumFeature getEditSelection()
                              throws IOException,
                                     AutomationException
The selected features that are editable.

Description

This property returns all of the currently selected features that belong to editable layers. Use this property when creating an editing tool or command that works with the current selection.

Product Availability

Available with ArcGIS Engine.

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

getSelectionCount

int getSelectionCount()
                      throws IOException,
                             AutomationException
The number of selected features that are editable.

Description

This property returns total number of selected features belonging to all editable layers in a map.

Product Availability

Available with ArcGIS Engine.

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

getTaskCount

int getTaskCount()
                 throws IOException,
                        AutomationException
The number of edit tasks.

Description

This property returns the number of engine edit tasks that the EngineEditor currently has loaded.

For example, use TaskCount to loop through all available tasks.

Product Availability

Available with ArcGIS Engine.

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

getTask

IEngineEditTask getTask(int index)
                        throws IOException,
                               AutomationException
The edit task at the specified index.

Product Availability

Available with ArcGIS Engine.

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

setCurrentTaskByRef

void setCurrentTaskByRef(IEngineEditTask task)
                         throws IOException,
                                AutomationException
The current edit task.

Product Availability

Available with ArcGIS Engine.

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

getCurrentTask

IEngineEditTask getCurrentTask()
                               throws IOException,
                                      AutomationException
The current edit task.

Description

Use this property to check or change the EngineEditor's current task.

When an edit sketch is completed the IEngineEditTask::OnFinishSketch method of the current engine edit task uses the geometry stored in IEngineEditSketch::Geometry to perform some action (e.g. store any created features)

The IEngineEditEvents::OnCurrentTaskChanged event is fired when this property is set or when a different task is selected using the ControlsEditingTaskToolControl.

Product Availability

Available with ArcGIS Engine.

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

getMap

IMap getMap()
            throws IOException,
                   AutomationException
The map being edited.

Description

Use this property to get a reference to the map being edited.

An application may contain more than one MapControl encapsulating a Map CoClass. Only the editable layers in one Map may be edited at a time. When IEngineEditor::StartEditing is called, an edit session begins on a specific workspace in a specific map.

Product Availability

Available with ArcGIS Engine.

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

invertAgent

void invertAgent(IPoint location,
                 int hdc)
                 throws IOException,
                        AutomationException
Draws the EngineEditor's snapping agent.

Description

Call InvertAgent to draw the EngineEditor's snap agent at the location specified by the required point parameter. A device handle is also required. The agent is typically used to display the mouse location or a location based on a constraint when adding points to an edit sketch. Call InvertAgent a second time with the same point parameter to draw over and erase the previous agent.

Product Availability

Available with ArcGIS Engine.

Parameters:
location - A reference to a com.esri.arcgis.geometry.IPoint (in)
hdc - The hdc (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addTask

void addTask(IEngineEditTask task)
             throws IOException,
                    AutomationException
Adds a task to the EngineEditor.

Description

This method adds an engine edit task to the collection of edit tasks managed by the EngineEditor singleton object.

Product Availability

Available with ArcGIS Engine.

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

getTaskByUniqueName

IEngineEditTask getTaskByUniqueName(String uniqueName)
                                    throws IOException,
                                           AutomationException
Retrieves a task by UniqueName from the EngineEditor.

Description

Retrieves the engine edit task that is uniquely identified by it's IEngineEditTask::UniqueName string.

For example, the out-of-the-box "Create New Feature" and "Modify Feature" engine edit tasks have IEngineEditTask::UniqueName properties of "ControlToolsEditing_CreateNewFeatureTask" and "ControlToolsEditing_ModifyFeatureTask" respectively.

Product Availability

Available with ArcGIS Engine.

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

setEditSessionMode

void setEditSessionMode(int mode)
                        throws IOException,
                               AutomationException
The current edit session mode.

Product Availability

Available with ArcGIS Engine.

Parameters:
mode - A com.esri.arcgis.controls.esriEngineEditSessionMode constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getEditSessionMode

int getEditSessionMode()
                       throws IOException,
                              AutomationException
The current edit session mode.

Description

Use this property to check or set the edit session mode of the EngineEditor. The edit session can be either versioned or non-versioned. This property only applies when editing an SDE Workspace.

The esriEngineEditSessionMode constants provide the valid edit session modes.

Product Availability

Available with ArcGIS Engine.

Returns:
A com.esri.arcgis.controls.esriEngineEditSessionMode constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.