How to use
See How to use ArcGIS samples for help on running the sample.
- Double-click the SimpleAddin.esraddin file in developer kit home\java\samples\arcobjects\addin\simpleaddin\lib. A dialog box appears asking if you want to install the add-in. Click Yes to install.
- Start ArcMap.
- Click the Customize menu and click Customize Mode. The Customize dialog box appears.
- Click the Toolbars tab. Scroll down and select the Sample Java Toolbar check box.
- Verify that you can see a toolbar containing the Java Add Layer button, ESRI Fixed Zoom Out command, Java Draw Polygon tool, Java Sample menu containing the Java Add Layer button, and a custom tool palette containing the Draw Polygon tool and Zoom In tool.
- Click the Commands tab.
- Select each category in Step 5, then drag the respective commands onto an existing toolbar.
- Click the Java Add Layer command. This command opens a file chooser and allows you to browse to data.
- Browse to a Shapefile in developer kit home\java\samples\data\usa\states.shp to add the layer to the map.
- Click the Draw Polygon tool and draw a polygon on the map. When finished, this tool creates a solid blue polygon graphic on the map.
- Click the Java ShowDocWin command. This command pens a dockable window.
- Click the Show/Update Layer LayerList button. The states layer shows in the list. You can dock this window anywhere in ArcMap as permitted.
- Open a new document by browsing to developer kit home\java\samples\data\mxds\World.mxd (it is not necessary to save the existing map document). Notice the application extension is getting called and the dockable window is visible.
- Click the Show/Update LayerList button. All the layers for world.mxd show in the list.
- When you click the Customize Menu, then click Extensions, you can see the Java Sample Extension as one of the available extensions.
If you installed the samples feature, you will find the files associated with this sample in <Your Developer Kit install location>\DeveloperKit10.4\Java\Samples\ArcObjects.
|addins\button\AddLayerButton.java||Opens a JFileChooser where you can select a layer, then add it to the map. This will be called when you click the AddLayer custom command.|
|addins\tool\DrawPolygonGraphicsTool.java||A custom tool. Click the tool and draw a polygon graphic on the map.|
|addins\dockablewindow\DockableMap.java||The dockable window. If you have a map open, and when you click the Show Dockable Window button, you can see it shows all the available layers on the map. This window can be docked anywhere inside ArcMap.|
|addins\extension\MapExtension.java||The application extension. When you open a new map document, this application extension is called and in turn, opens a dockable window.|
|addins\util\ShapeFileFilter.java||A utility file that filters and shows only shape files in the file chooser.|
|Development licensing||Deployment licensing|
|ArcGIS for Desktop Advanced||ArcGIS for Desktop Basic|