How to use
See How to use ArcGIS samples for help on running the sample.
- Navigate to this sample's lib folder (mzrenderer\lib) and copy MZRendererPropertyPage.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.
- Start ArcMap and add the ushigh.shp file from the <DevKitHome Install Dir>/java/samples/data/usa folder.
- Right-click the ushigh layer and click Properties.
- In the Layer Properties dialog, select the Symbology tab. The MZ Renderer category is listed in the Table of Contents (TOC) for this layer.
- Select MZ Renderer from the TOC. To the right a dialog box opens for you to provide details that are used to define your custom renderer.
- Enter values in the dialog and click OK to apply your settings. Depending on which rendering mode you select the M or Z values will be displayed in the map with the required symbology. The ArcMap TOC is also updated to reflect the custom symbology.
- 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 ushigh layer.
- Close ArcMap.
- Open ArcMap using the map document you just saved. Notice that the ushigh layer's custom symbology has been persisted and restored in ArcMap.
- Navigate to the sample's lib folder (mzrenderer\lib) and copy MZRendererExt.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.
- Navigate to this sample's bin folder (mzrenderer\bin) and execute the MZRenderer.jar to start the application. The JFrame is loaded with a ToolbarBean, TOCBean, MapBean with the ushigh layer already present, and two buttons: Open new shapefile … and Apply Custom Renderer.
- Click 'Apply Custom Renderer'. The custom renderer is applied to the ushigh layer.
- Notice that this sample is only applicable for line vector data.
- After the renderer is applied, click Save to save a map document (give a logical name for your .mxd).
- Navigate to this sample's bin folder (mzrenderer\bin) and execute the MZRenderer.jar to start the application again.
- Open the map document you just saved. Notice that the renderer is already applied to the ushigh 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/MZRendererMain.java||Main class that consumes the custom renderer in an ArcGIS Engine application.|
|cartography/MZRenderer.java||Custom renderer that implements IFeatureRenderer, ILegendInfo, Externalizable, and IDocumentVersionSupportGEN and contains the draw method.|
|cartography/propertypage/MZPropertyPage.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/MZPropertyPageUI.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|