|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IEditSketch
Provides access to members that access and manipulate the edit sketch.
The IEditSketch interface is on the Editor CoClass.
Edit tasks set the geometry type of the edit sketch, and the sketch tools add points to that geometry. For example, the Create New Feature task sets the edit sketch geometry type to be the same as the geometry type of the target layer. In contrast, the Select Features Using a Line task always sets the edit sketch geometry type to esriGeometryPolyline, with no regard to the current layer geometry type.
Edit tasks often set the edit sketch geometry to esriGeometryNull, causing the sketch tools to become inactive. For example, the Reshape task will set the edit sketch geometry to esriGeometryNull if there are no polygon or polyline features selected. This prevents users from creating an edit sketch that would otherwise do nothing. Edit tasks respond to editor events such as OnSelectionChanged and OnCurrentLayerChanged to accomplish this.
The purpose of the IEditSketch interface is to manage a geometry that will be used extensively by the editor. Ultimately, the editor's current task takes the geometry to perform some action; for example, the CreateNewFeature task takes the geometry and stores it in the database as a new feature.
The editor automatically creates a new empty geometry. The type of geometry created is the same as the editor's current layer (IEditor::CurrentLayer ). Use the AddPoint method to build (add data to) the edit sketch geometry and FinishSketch to signal the current task that the geometry is ready for use. To bring an existing feature into the edit sketch, set the Geometry property to the desired feature and call RefreshSketch .
ISnapEnvironment
,
IEditProperties
,
IFeatureClass.getShapeType()
,
IEditTask.activate(com.esri.arcgis.editor.IEditor, com.esri.arcgis.editor.IEditTask)
,
IEditor
,
IGeometry
,
IEditLayers
,
IEditTask.deactivate()
,
IEditAttributeProperties
,
IEditEvents2
,
IEditTask.onFinishSketch()
,
IDatasetEdit
,
IDatasetEditInfo
,
IEditTask.onDeleteSketch()
,
IEditTask.getName()
,
IEditEvents
,
Editor
,
esriGeometryType
,
IEditSketch
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. |
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. |
void |
modifySketch()
Call to notify listeners that the sketch has been changed. |
void |
refreshSketch()
Invalidates the portion of the display that is occupied by the sketch. |
void |
setGeometryByRef(IGeometry geometry)
Geometry stored in the edit sketch. |
void |
setGeometryType(int geomType)
Type of the geometry stored in the edit sketch. |
Method Detail |
---|
int getPart() throws IOException, AutomationException
You must right-click on the desired part of the edit sketch to set this property correctly. The wrong part index will be returned if you do not right-click on the desired part beforehand. For example, if an edit sketch has two parts, Part will always return a 0 (all sketches have at least one part) until you right click on the second part.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IEditSketch.getSegment()
,
IEditSketch.getVertex()
int getSegment() throws IOException, AutomationException
You must right-click on the desired segment in the edit sketch to set this property correctly. The wrong segment index will be returned if you do not right-click on the desired segment beforehand. A value of -1 indicates no segment has been selected. For example, if your last right-click was on an edit sketch vertex, the Segment property will return a value of -1.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IEditSketch.getVertex()
,
IEditSketch.getPart()
int getVertex() throws IOException, AutomationException
You must right-click on the desired vertex in the edit sketch to set this property correctly. The wrong vertex index will be returned if you do not right-click on the desired vertex beforehand. A value of -1 means no vertex has been selected. For example, if your last right-click was on a segment in the edit sketch, the Vertex property will be set to -1.
Use Part, Segment and Vertex when creating custom commands for the sketch context menu. For example, to delete a vertex in the edit sketch, right-click on the vertex to retrieve its index and call IPointCollection::RemovePoints .
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IEditSketch.getSegment()
,
IEditSketch.getPart()
int getGeometryType() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setGeometryType(int geomType) throws IOException, AutomationException
geomType
- A com.esri.arcgis.geometry.esriGeometryType constant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IGeometry getGeometry() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setGeometryByRef(IGeometry geometry) throws IOException, AutomationException
geometry
- A reference to a com.esri.arcgis.geometry.IGeometry (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void addPoint(IPoint point, boolean allowUndo) throws IOException, AutomationException
point
- A reference to a com.esri.arcgis.geometry.IPoint (in)allowUndo
- The allowUndo (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void refreshSketch() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void finishSketch() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void finishSketchPart() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IPoint getLastPoint() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void modifySketch() throws IOException, AutomationException
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 |