Related Object Event Handler custom Java class extension


Purpose
This sample demonstrates how to create, deploy, and use a custom class extension tool in Java. The class extension featured in this sample is associated with a feature class (Transformer) that has a simple relationship with another feature class (Poles). When a feature in Poles is moved or rotated, the move or rotate event is caught and handled by the class extension. This enables you to add custom logic to handle such events.
 
This sample creates a file geodatabase (GDB), creates the Transformer and Poles feature classes, and creates a relationship between the two feature classes. It then rotates and moves a pole feature.

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.

Deploy extension to ArcGIS Engine Runtime
  1. Navigate to this sample's lib folder (relatedobjectevent/lib) and copy RelatedObjectEventExt.jar into the <ArcGIS Engine Runtime Install Dir>/java/lib/ext folder to deploy the custom feature class extension. The extension functionality will become available to you when you start the runner application.
  2. Navigate to this sample's bin folder (relatedobjectevent/bin) and execute the RelatedObjectEvent.jar to start the application (Eclipse can also be used to execute the application - RelatedObjectsRunner.java).
  3. Review the output messages on the command prompt or in Eclipse's output window.
  4. Use ArcCatalog or ArcMap to review the data in the output location.


Download the files for Java
geodatabase/RelatedObjectsRunner.java Main class
geodatabase/classextension/RelatedObjectEventHandler.java Class extension class

See Also:

Getting started with class extensions




Additional Requirements
  • ArcGIS Engine Runtime installed

Development licensing Deployment licensing
Engine Developer Kit Engine Runtime: Geodatabase Update