01 /*
02 * Copyright (c) 1995-2010, The University of Sheffield. See the file
03 * COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
04 *
05 * This file is part of GATE (see http://gate.ac.uk/), and is free
06 * software, licenced under the GNU Library General Public License,
07 * Version 2, June 1991 (in the distribution as file licence.html,
08 * and also available at http://gate.ac.uk/gate/licence.html).
09 *
10 * Valentin Tablan, 17 Sep 2007
11 *
12 * $Id: AnnotationEditorOwner.java 12006 2009-12-01 17:24:28Z thomas_heitz $
13 */
14 package gate.gui.annedit;
15
16 import javax.swing.text.JTextComponent;
17
18 import gate.*;
19 import gate.gui.docview.AnnotationList;
20 import gate.gui.docview.DocumentEditor;
21
22 /**
23 * Objects of this type control the interaction with an
24 * {@link OwnedAnnotationEditor}.
25 */
26 public interface AnnotationEditorOwner {
27
28 /**
29 * Gets the document currently being edited.
30 * @return a {@link Document} object.
31 */
32 public Document getDocument();
33
34 /**
35 * Gets the UI component used to display the document text. This is used by
36 * the annotation editor for obtaining positioning information.
37 * @return a {@link JTextComponent} object.
38 */
39 public JTextComponent getTextComponent();
40
41
42 /**
43 * Called by the annotation editor when an annotation has been
44 * changed.
45 * @param ann the annotation modified (after the modification occurred).
46 * @param set the parent annotation set for the annotation
47 * @param oldType the old type of the annotation. This value is only set if
48 * the annotation modification included a change of type.
49 */
50 public void annotationChanged(Annotation ann, AnnotationSet set,
51 String oldType);
52
53 /**
54 * Called by the editor when a new annotation needs to be selected.
55 */
56 public void selectAnnotation(AnnotationData aData);
57
58 /**
59 * Called by the editor for obtaining the next annotation to be edited.
60 * @return an {@link Annotation} value.
61 */
62 public Annotation getNextAnnotation();
63
64 /**
65 * Called by the editor for obtaining the previous annotation to be edited.
66 * @return an {@link Annotation} value.
67 */
68 public Annotation getPreviousAnnotation();
69 }
|