Point dispersal


Purpose
The sample will demonstrate how to do the following:
  • Create a custom feature renderer with an associated property page that can be included in the list of available renderers in ArcMap.
  • Draw a point feature layer where no feature symbols overlap.
  • Limit renderers to a specific set of feature classes (in this case, point feature classes only).
  • Create a working entry for the rendered layer that appears in the table of contents (TOC) and displays in a legend.
This sample application can be consumed in ArcMap or in an ArcGIS Engine application.

How to use

See How to use ArcGIS samples for help on running the sample.

Consume the renderer in ArcMap (Windows only):
  1. Navigate to this sample's lib folder (pointdispersal\lib) and copy PointDispersalPropertyPage.jar into the <ArcGIS Desktop Install Dir>/java/lib/ext folder to deploy the property page. The sample's functionality will become available to you when you start ArcMap.
  2. Start ArcMap and add the wind.shp point layer from the <DevKitHome Install Dir>/java/samples/data/usa folder.
  3. Right-click the wind layer in ArcMap and select Properties.
  4. In the Layer Properties dialog, select the Symbology tab. The Dispersal Renderer category is listed in the Table of Contents (TOC) for this layer.
  5. Select the Dispersal Renderer from the TOC. To the right a dialog box opens for you to provide details that are used to define your custom renderer.
  6. Type in a dispersal ration of 0.79.
  7. Select a symbol from the Select Symbol dialog box and click OK. The symbol selected is applied to the wind points and the TOC in ArcMap. Points are dispersed accordingly.
  8. Once the renderer is applied to the layer, you can save the map document by clicking the Save icon (don't forget to provide a meaningful name for your .mxd file when saving). The map document is saved now with the custom renderer applied to the wind layer.
  9. Close ArcMap.
  10. Open ArcMap using the map document you just saved. Notice that the wind layer's custom symbology has been persisted and restored in ArcMap.

Consume the application in an ArcGIS Engine application (Cross-Platform):
  1. Navigate to the sample's lib folder (pointdispersal\lib) and copy PointDispersalExt.jar into the <ArcGIS Engine Install Dir>/java/lib/ext folder to deploy the custom renderer extension. The extension functionality will become available to you when you start the ArcGIS Engine application.
  2. Navigate to this sample's bin folder (pointdispersal\bin) and execute the PointDispersal.jar to start the application. The JFrame is loaded with a ToolbarBean, TOCBean, MapBean with the wind layer already present, and two buttons: Open new shapefile … and Apply Custom Renderer.
  3. Click 'Apply Custom Renderer'. The custom renderer is applied to the wind layer.
  4. Notice that this sample is only applicable for point vector data.
  5. After the renderer is applied, click Save to save a map document (give a logical name for your .mxd).
  6. Navigate to this sample's bin folder (pointdispersal\bin) and execute the PointDispersal.jar to start the application again.
  7. Open the map document you just saved. Notice that the renderer is already applied to the wind layer as it was persisted as part of the map document.

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.

cartography/PointDispersalRendererMain.java Main class that consumes the custom renderer in an ArcGIS Engine application.
cartography/PointDispersalRenderer.java Custom renderer that implements IFeatureRenderer, ILegendInfo, Externalizable, IDocumentVersionSupportGEN and contains the draw method.
cartography/propertypage/PointDispersalPropertyPage.java Property page that associates the user interface (UI) to the renderer so that values can be set from the UI to the custom renderer. The property page extends the base property page, BaseCustomRendererPropertyPage.
cartography/propertypage/PointDispersalPropertyPageUI.java A pure swing based GUI that is embedded in ArcMap and is used to pass values to the custom renderer.

See Also:

How to implement custom feature renderers
How to implement custom property pages for custom feature renderers
How to implement TOC legends for custom feature renderers
How to implement persistence for a custom feature renderer
Consuming custom feature renderers




Development licensing Deployment licensing
Engine Developer Kit Engine
ArcGIS for Desktop Basic