How to use
See How to use ArcGIS samples for help on running the sample. If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.
- Start the sample application. The ushigh.shp shapefile from the sample data is loaded into the Map control.
- Click the Start button to start an edit session. The Create, Modify, and Reshape buttons are enabled, and the Start button is replaced by the Finish button.
- Click the Create button to create a new feature. The Sketch tool is activated.
- Sketch a highway feature on the map. If the feature crosses a lake, you are notified that the edit is invalid.
- Double-click to finish the sketch.
- Click the Modify button to modify a feature. The Edit tool is activated. If you have a highway feature selected, the Insert and Delete Vertex commands are also enabled.
- Use the Edit tool to select a highway feature to edit. The feature's vertices are displayed.
- Zoom in on the feature, and use the Insert or Delete commands on any of the feature's vertices. You are notified if your modifications cause a highway feature to cross a lake.
- Click the Reshape button to reshape a highway feature. The Edit tool is activated. If you have a highway feature selected, the Sketch tool is also enabled.
- Use the Edit tool to select a highway feature to edit. The Sketch tool is now enabled if it wasn't in the previous step.
- Use the Sketch tool to digitize a line that crosses the selected highway feature in at least two places. You are notified if your modifications cause a highway feature to cross a lake.
- Click Finish to stop the editing and save your edits if desired.
Download the files for Java
editing/CustomEditingApplication.java | Entry point for the sample. It initializes the interop, sets up the UI, and ensures licensing is valid. |
editing/TOCToolbarPanel.java | Contains the UI code to place the TOC control and the Toolbar control side by side. |
editing/EditingPanel.java | Contains the UI code to create two Toolbar controls and four JButtons to initiate different editing operations. Events fired from the JButtons are handled by the EditingPanelActionListener class. |
editing/EditingPanelActionListener.java | Contains the code to initiate the different editing operations and to populate the toolbars with tools depending on the editing operation. It also contains the business logic to determine if the edit being made is invalid and subsequently undoes the last edit. |
editing/CustomVertexTools.java | Contains the code to implement a sub-typed command. A sub-typed command gives the appearance of multiple commands even though it is a single command. The command uses fine-grained ArcObjects to perform vertex editing. |
editing/ReshapePolylineEditTask.java | Contains the code to implement a custom edit task and responds to events in the editing framework. |
Development licensing | Deployment licensing |
---|---|
Engine Developer Kit | Engine Runtime |
ArcView |