An annotation is an object that is, similar to drawings, associated to an image. The annotation is attached at a certain position of the image and is visible as a little squared box -- the annotation icon. It contains a collection of text messages that are entered by users.
The class Annotation is a subclass of the GipDrawing class (figure 4.18), even though it cannot be considered a real drawing object. However, since the squared box needs to be drawn on top of the image the same way as drawings, it was inherited from the GipDrawing class. A single control point defines the position of the annotation. The position of the annotation icon is defined with the methods addPoint, changePoint and finish, which are called by the image window after appropriate mouse events. This is done the same way as drawings are defined as explained in section 4.4.
The annotation texts are stored as a vector of GipText objects. Every GipText object contains one annotation text and a reference to the user that created that text. The Annotation object is a displayable artifact (see section 4.1) and therefore implements the display method. This method creates an AnnotationWindow frame, which contains a text field and several navigation buttons. The frame uses the methods getText, setText, insertText and removeText to retrieve, change, add and remove the annotation texts. These actions are again initiated by button events received by the AnnotationWindow frame.