IBM Content Manager, Version 8.5      Supports:  Oracle, DB2, Java

Adding a custom annotation type to your application

You can add a custom annotation type to your application.

To add a custom annotation type to the annotation services, complete the following steps. See the Application Programming Reference for details about API usage.

Remember: This custom annotation cannot be saved because the built-in annotation engine will not support or understand it.
  1. Create a subclass of CMBPageAnnotation.
    public class TImageAnnotation extends CMBPageAnnotation
  2. Define a constant for the custom annotation with a value larger than 100. The range of 1 to 99 is reserved.
    public static final int ANN_IMAGE = 101;
  3. Override the following methods of CMBPageAnnotation.
        public void draw(Graphics2D g2);
        public void drawOutline(Graphics2D g2);
        public CMBPropertiesPanel getAnnotationPropertiesPanel();
  4. Implement the CMBAnnotationPropertiesInterface interface to create the properties window. The properties window appears when a user chooses to edit the custom annotation properties.
  5. Provide set and get methods specific to the custom annotation properties.
  6. Add the custom annotation type.
    annoServices.prepareToAddAnnotation(TImageAnnotation.ANN_IMAGE,
    "TImageAnnotation",1);

The annotation type sample TImageAnnotation is included in the samples directory. The sample demonstrates how to add a custom annotation type to the annotation services.



Feedback

Last updated: December 2013
dcmjv022.htm

© Copyright IBM Corporation 2013.