com.esri.arcgis.controls
Interface IEngineEditSketch

All Superinterfaces:
Serializable
All Known Implementing Classes:
EngineEditor

public interface IEngineEditSketch
extends Serializable

Provides access to members that manage the edit sketch.

Description

This interface is new at ArcGIS 9.3.

The purpose of the IEngineEditSketch interface is to manage the geometry that will be used by EngineEditor.

The EngineEditor automatically creates a new empty geometry (Geometry) with the same geometry type (GeometryType) as the target layer (IEngineEditLayers::TargetLayer). Use the AddPoint method to create the edit sketch geometry and finishSketch to signal to the current task (IEngineEditor::CurrentTask) that the geometry is ready for use. The current task takes the geometry and performs some action. For example, the Create New Feature task takes the geometry and stores it in the layer as a new feature.

Product Availability

Available with ArcGIS Engine.


Method Summary
 void addPoint(IPoint point, boolean allowUndo)
          Adds a point to the edit sketch.
 void finishSketch()
          Completes the current edit sketch.
 void finishSketchPart()
          Completes a part for the current edit sketch.
 double getCurrentZ()
          Current Z value for the edit sketch.
 IPoint getEditLocation()
          A point that can be used by any custom editing commands.
 IGeometry getGeometry()
          Geometry stored in the edit sketch.
 int getGeometryType()
          Type of the geometry stored in the edit sketch.
 IPoint getLastPoint()
          The last point in the edit sketch.
 int getPart()
          The index of the current part of the sketch.
 int getSegment()
          The index of the current segment of the sketch.
 int getVertex()
          The index of the current vertex of the sketch.
 boolean isZAware()
          Indicates whether the edit sketch geometry can contain Zs.
 void modifySketch()
          Notifies listeners that the sketch has been changed.
 void refreshSketch()
          Invalidates the portion of the display that is occupied by the sketch.
 void setCurrentZ(double z)
          Current Z value for the edit sketch.
 void setEditLocation(int x, int y)
          Sets the part, segment and vertex of the edit sketch at the x,y location.
 void setGeometryByRef(IGeometry geometry)
          Geometry stored in the edit sketch.
 void setGeometryType(int geomType)
          Type of the geometry stored in the edit sketch.
 void setZAware(boolean aware)
          Indicates whether the edit sketch geometry can contain Zs.
 void vertexAdded(IPoint point)
          Notifies listeners that a vertex has been added to the sketch.
 void vertexDeleted(IPoint point)
          Notifies listeners that a vertex has been deleted from the sketch.
 void vertexMoved(IPoint point)
          Notifies listeners that a vertex has been moved in the sketch.
 

Method Detail

getGeometryType

int getGeometryType()
                    throws IOException,
                           AutomationException
Type of the geometry stored in the edit sketch.

Description

Use this property in conjunction with the IEngineEditSketch::Geometry property to manage the geometry inside the edit sketch. Setting GeometryType automatically initializes the IEngineEditSketch::Geometry property and vice versa. For example, if you set the GeometryType to esriGeometryPolygon, a new empty Polygon object will be created.

Valid esriGeometryType constants used by IEngineEditSketch are: esriGeometryPoint, esriGeometryMultipoint, esriGeometryPolyline, esriGeometryPolygon and esriGeometryNull.

Product Availability

Available with ArcGIS Engine.

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

setGeometryType

void setGeometryType(int geomType)
                     throws IOException,
                            AutomationException
Type of the geometry stored in the edit sketch.

Product Availability

Available with ArcGIS Engine.

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

getGeometry

IGeometry getGeometry()
                      throws IOException,
                             AutomationException
Geometry stored in the edit sketch.

Description

This property sets the geometry that the EngineEditor works with and ultimately passes it to the current task. By default, the EngineEditor creates a new empty geometry any time an edit session is started, the target layer is changed, the GeometryType is reset, or a task is completed. There is generally no need, therefore, to set the Geometry property when you are building new geometries.

Do set the Geometry property, however, when you want to bring an existing feature into the edit sketch.

Valid esriGeometryType constants used by IEngineEditSketch are: esriGeometryPoint, esriGeometryMultipoint, esriGeometryPolyline, esriGeometryPolygon and esriGeometryNull.

Product Availability

Available with ArcGIS Engine.

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.

setGeometryByRef

void setGeometryByRef(IGeometry geometry)
                      throws IOException,
                             AutomationException
Geometry stored in the edit sketch.

Product Availability

Available with ArcGIS Engine.

Parameters:
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.

getEditLocation

IPoint getEditLocation()
                       throws IOException,
                              AutomationException
A point that can be used by any custom editing commands. This property is set by the SetEditLocation method.

Description

This property stores the Point location specified by the IEngineEditSketch::SetEditLocation method. Once a point has been stored in this property it remains there until the EngineEditSketch::SetEditLocation method is called again.
Use this property when creating custom commands that require a specific point location to perform some operation. For example, the OnMouseUp event could call IEngineEditSketch::SetEditLocation to store the point at which the user had clicked on the MapControl into the EditLocation property. This property could then be used by an 'Insert Vertex' command to add a new vertex to a sketch.

Product Availability

Available with ArcGIS Engine.

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

getPart

int getPart()
            throws IOException,
                   AutomationException
The index of the current part of the sketch.

Description

This property stores the index of the part of a sketch as specified by the IEngineEditSketch::SetEditLocation method. Once the index has been stored in this property, it remains there until the next time you call the IEngineEditSketch::SetEditLocation method.
Use this property when creating custom commands in a context menu that require the specific sketch part.
The IEngineEditSketch::SetEditLocation could be called during the IMapControlEvents2::OnMouseUp event to store the index of the part of a sketch which the user had clicked on.

Product Availability

Available with ArcGIS Engine.

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

getSegment

int getSegment()
               throws IOException,
                      AutomationException
The index of the current segment of the sketch.

Description

This property stores the index of the segment of a sketch as specified by the IEngineEditSketch::SetEditLocation method. Once the index has been stored in this property, it remains there until the next time you call the IEngineEditSketch::SetEditLocation method.
Use this property when creating custom commands in a context menu that require the specific sketch segment.
The IEngineEditSketch::SetEditLocation could be called during the IMapControlEvents2::OnMouseUp event to store the index of the segment which the user had clicked on. A value of -1 indicates that no segment has been identified by the IEngineEditSketch::SetEditLocation.

Product Availability

Available with ArcGIS Engine.

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

getVertex

int getVertex()
              throws IOException,
                     AutomationException
The index of the current vertex of the sketch.

Description

This property stores the index of the vertex of a sketch as specified by the IEngineEditSketch::SetEditLocation method. Once the index has been stored in this property, it remains there until the next time you call the IEngineEditSketch::SetEditLocation method.
Use this property when creating custom commands in a context menu that require a specific sketch vertex.
The IEngineEditSketch::SetEditLocation could be called during the IMapControlEvents2::OnMouseUp event to store the index of the vertex which the user had clicked on.

Product Availability

Available with ArcGIS Engine.

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

addPoint

void addPoint(IPoint point,
              boolean allowUndo)
              throws IOException,
                     AutomationException
Adds a point to the edit sketch. If allowUndo is true, a new operation will be created.

Description

Use the AddPoint method to add a point to the geometry held in the edit sketch. The point parameter specifies the next point in the sketch. In all cases, new segments are added linking the edit sketch to the provided point, except where the geometry type is set to Point or the point represents the very first point in the edit sketch.

Remarks

This method fires the IEngineEditEvents::OnVertexAdded, IEngineEditEvents::OnSketchModified and IEngineEditEvents::OnAfterDrawSketch events.

Product Availability

Available with ArcGIS Engine.

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

refreshSketch

void refreshSketch()
                   throws IOException,
                          AutomationException
Invalidates the portion of the display that is occupied by the sketch.

Description

Call RefreshSketch to invalidate the portion of the display that is occupied by the sketch. Sometimes, however, it may be necessary to invalidate a larger portion of the display in order to get rid of unwanted artifacts. This situation can arise when you shorten the length of a segment since old data may still be erroneously displayed outside of the new sketch geometry.

Remarks

This method fires the IEngineEditEvents::OnAfterDrawSketch event.

Product Availability

Available with ArcGIS Engine.

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

finishSketch

void finishSketch()
                  throws IOException,
                         AutomationException
Completes the current edit sketch.

Description

The FinishSketch method finishes the edit sketch and notifies the EngineEditor's current task of this event which executes the IEngineEditTask::OnFinishSketch method. For example, the "Create New Feature" edit task will create a new feature using the IEngineEditSketch::Geometry. A number of events may be fired by the IEngineEditTask::OnFinishSketch method depending on the task being executed.

Product Availability

Available with ArcGIS Engine.

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

finishSketchPart

void finishSketchPart()
                      throws IOException,
                             AutomationException
Completes a part for the current edit sketch.

Description

The FinishSketchPart method finishes the edit sketch part during the creation of multi-part geometries.

Remarks

This method fires the IEngineEditEvents::OnAfterDrawSketch event.

Product Availability

Available with ArcGIS Engine.

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

getLastPoint

IPoint getLastPoint()
                    throws IOException,
                           AutomationException
The last point in the edit sketch.

Description

Use this property to retrieve the last point in the edit sketch.

Product Availability

Available with ArcGIS Engine.

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

modifySketch

void modifySketch()
                  throws IOException,
                         AutomationException
Notifies listeners that the sketch has been changed.

Description

Call ModifySketch if you are programmatically modifying an edit sketch. The ModifySketch method will programmatically fire the IEngineEditEvents::OnModifiedSketch event, thus ensuring that all listening clients are notified.

Product Availability

Available with ArcGIS Engine.

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

vertexAdded

void vertexAdded(IPoint point)
                 throws IOException,
                        AutomationException
Notifies listeners that a vertex has been added to the sketch.

Description

Call VertexAdded if you are programmatically adding a vertex to an edit sketch. The VertexAdded method will programmatically fire the IEngineEditEvents::OnVertexAdded event, thus ensuring that all listening clients are notified.

Product Availability

Available with ArcGIS Engine.

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.

vertexDeleted

void vertexDeleted(IPoint point)
                   throws IOException,
                          AutomationException
Notifies listeners that a vertex has been deleted from the sketch.

Description

Call VertexDeleted if you are programmatically deleting a vertex from an edit sketch. The VertexDeleted method will programmatically fire the IEngineEditEvents::OnVertexDeleted event, thus ensuring that all listening clients are notified.

Product Availability

Available with ArcGIS Engine.

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.

vertexMoved

void vertexMoved(IPoint point)
                 throws IOException,
                        AutomationException
Notifies listeners that a vertex has been moved in the sketch.

Description

Call VertexMoved if you are programmatically moving a vertex in an edit sketch. The VertexMoved method will programmatically fire the IEngineEditEvents::OnVertexMoved event, thus ensuring that all listening clients are notified.

Product Availability

Available with ArcGIS Engine.

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.

setEditLocation

void setEditLocation(int x,
                     int y)
                     throws IOException,
                            AutomationException
Sets the part, segment and vertex of the edit sketch at the x,y location.

Description

Call the SetEditLocation method to store the EditLocation, Vertex, Segment and/or Part of an edit sketch.

It is essential that this method is called prior to executing any of the following commands; ControlsEditingVertexInsertCommand, ControlsEditingVertexDeleteCommand, ControlsEditingVertexMoveCommand and ControlsEditingVertexMoveToCommand or popping up the ControlsEditingVertexContextMenu.

Product Availability

Available with ArcGIS Engine.

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

isZAware

boolean isZAware()
                 throws IOException,
                        AutomationException
Indicates whether the edit sketch geometry can contain Zs.

Description

If the IEngineEditSketch::Geometry contains elevation (z) values, this property will return a boolean value of True.

To view the z values for the edit sketch display the edit sketch properties dialog using the ControlsEditingSketchPropertiesCommand and select the sketch. If the sketch is ZAware, an additional column will appear next to the y column showing the z values.

Product Availability

Available with ArcGIS Engine.

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

setZAware

void setZAware(boolean aware)
               throws IOException,
                      AutomationException
Indicates whether the edit sketch geometry can contain Zs.

Product Availability

Available with ArcGIS Engine.

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

getCurrentZ

double getCurrentZ()
                   throws IOException,
                          AutomationException
Current Z value for the edit sketch.

Description

The CurrentZ property returns or sets the Z value that is applied to all new vertices added to the sketch. This is not applied to moved or changed vertices.
Use the CurrentZ property when estimating height in fixed bands. For example, if you are capturing data at 0, 2 or 4 metres above ground or sea level.

Remarks

To view the z values for the edit sketch display the edit sketch properties dialog using the ControlsEditingSketchPropertiesCommand and select the sketch. If the sketch is ZAware, an additional column will appear next to the y column showing the z values.

Product Availability

Available with ArcGIS Engine.

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

setCurrentZ

void setCurrentZ(double z)
                 throws IOException,
                        AutomationException
Current Z value for the edit sketch.

Description

The CurrentZ property returns or sets the Z value that is applied to all new vertices added to the sketch. This is not applied to moved or changed vertices.
Use the CurrentZ property when estimating height in fixed bands. For example, if you are capturing data at 0, 2 or 4 metres above ground or sea level.

Product Availability

Available with ArcGIS Engine.

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