|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IEngineEditor
Provides access to members that control the behavior of the EngineEditor.
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.
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 |
---|
int getEditState() throws IOException, AutomationException
The EditState property communicates the current edit state of the EngineEditor. The esriEngineEditState constants provide the valid edit states.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IWorkspace getEditWorkspace() throws IOException, AutomationException
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.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void startEditing(IWorkspace workspace, IMap map) throws IOException, AutomationException
Starts an editing session using the specified IMap and IWorkspace parameters. Only one map and workspace can be edited at a time.
This method fires the IEngineEditEvents::OnStartEditing, IEngineEditEvents::OnSelectionChanged, IEngineEditEvents::OnTargetLayerChanged and IEngineEditEvents::OnSketchModified events.
workspace
- A reference to a com.esri.arcgis.geodatabase.IWorkspace (in)map
- A reference to a com.esri.arcgis.carto.IMap (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void stopEditing(boolean saveChanges) throws IOException, AutomationException
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.
This method fires the IEngineEditEvents::OnBeforeStopEditing, IEngineEditEvents::OnStopEditing and IEngineEditEvents::OnTargetLayerChanged events.
saveChanges
- The saveChanges (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean hasEdits() throws IOException, AutomationException
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.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void startOperation() throws IOException, AutomationException
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.
This method fires the IEngineEditEvents::OnStartOperation event.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void abortOperation() throws IOException, AutomationException
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.
This method fires theIEngineEditEvents::OnSelectionChanged and IEngineEditEvents::OnAbort events.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void stopOperation(String operationName) throws IOException, AutomationException
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.
This method fires the IEngineEditEvents::OnBeforeStopOperation and IEngineEditEvents::OnStopOperation events.
operationName
- The operationName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void enableUndoRedo(boolean enabled) throws IOException, AutomationException
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.
enabled
- The enabled (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IEnumFeature getEditSelection() throws IOException, AutomationException
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.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.int getSelectionCount() throws IOException, AutomationException
This property returns total number of selected features belonging to all editable layers in a map.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.int getTaskCount() throws IOException, AutomationException
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.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IEngineEditTask getTask(int index) throws IOException, AutomationException
index
- The index (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setCurrentTaskByRef(IEngineEditTask task) throws IOException, AutomationException
task
- A reference to a com.esri.arcgis.controls.IEngineEditTask (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IEngineEditTask getCurrentTask() throws IOException, AutomationException
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.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IMap getMap() throws IOException, AutomationException
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.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void invertAgent(IPoint location, int hdc) throws IOException, AutomationException
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.
location
- A reference to a com.esri.arcgis.geometry.IPoint (in)hdc
- The hdc (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void addTask(IEngineEditTask task) throws IOException, AutomationException
This method adds an engine edit task to the collection of edit tasks managed by the EngineEditor singleton object.
task
- A reference to a com.esri.arcgis.controls.IEngineEditTask (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IEngineEditTask getTaskByUniqueName(String uniqueName) throws IOException, AutomationException
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.
uniqueName
- The uniqueName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setEditSessionMode(int mode) throws IOException, AutomationException
mode
- A com.esri.arcgis.controls.esriEngineEditSessionMode constant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.int getEditSessionMode() throws IOException, AutomationException
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.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |