Simple dispersal renderer


Purpose
The SimpleDispersalRenderer is a simple custom feature renderer that disperses points when rendering a layer. This renderer is applied specifically to point layers where the points overlap or lie in close proximity to each other.
The following sample will demonstrate how to develop a custom feature renderer that can be persisted in a map document (.mxd). Also, it will demonstrate how to a property page is defined for a custom feature renderer.  The property page is used by ArcMap to set properties and apply the custom renderer to layers contained in map documents.
In addition, notice that this sample does not require a deployment license option.  Since this sample is designed to only work with ArcMap, neither the renderer or the property page user interface (UI) do not require you to check for an appropriate license.

How to use

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

  1. Navigate to this sample's lib folder (simpledispersalrenderer/lib) and copy SimpleDispersalRendererPropertyPage.jar and SimpleDispersalRendererExt.jar into the <ArcGIS Desktop Install Dir>/java/lib/ext folder to deploy property page and the custom extension. The sample's functionality will become available to you when you start ArcMap.
  2. Start ArcMap and add the GOLF.shp point layer from the <DevKitHome Install Dir>/java/samples/data/AirportsAndGolf folder. Notice that some of the rendered point features are cluttered on the map.
  3. Right-click the golf layer in ArcMap and select Properties.
  4. In the Layer Properties dialog, select the Symbology tab. The Custom Renderer category is listed in the Table of Contents (TOC) for this layer.
  5. Select Custom 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 ratio of 0.79 and click OK. The custom renderer is applied to the Golf layer and the points are dispersed.
  7. 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 Golf layer.
  8. Close ArcMap.
  9. Open ArcMap using the map document you just saved. Notice that the golf layer's custom symbology has been persisted and restored in ArcMap.

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/SimpleDispersalRenderer.java Custom Plain Old Java Object (POJO) that implements IFeatureRenderer, Externalizable and IDocumentVersionSupportGEN.
cartography/propertypage/SimpleRendererPropertyPage.java Custom POJO for creating a property page. It extends BaseCustomRendererPropertyPage.
cartography/propertypage/SimpleRendererPropertyPageUI.java POJO that creates a JFrame that is embedded as a property page within ArcMap's Layer Properties dialog box.

See Also:

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




Development licensing Deployment licensing
Engine Developer Kit