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, June1991.
08 *
09 * A copy of this licence is included in the distribution in the file
10 * licence.html, and is also available at http://gate.ac.uk/gate/licence.html.
11 *
12 * Valentin Tablan 09/07/2001
13 *
14 * $Id: AnnotationVisualResource.java 12006 2009-12-01 17:24:28Z thomas_heitz $
15 */
16 package gate.creole;
17
18 import gate.*;
19 import gate.util.GateException;
20
21 /**
22 * Visual Resources that display and/or edit annotations.
23 * This type of resources can be used to either display or edit existing
24 * annotations or to create new annotations.
25 */
26 public interface AnnotationVisualResource extends VisualResource {
27
28 /**
29 * Called by the GUI when the user has pressed the "OK" button. This should
30 * trigger the saving of the newly created annotation(s)
31 */
32 public void okAction() throws GateException;
33
34 /**
35 * Called by the GUI when the user has pressed the "Cancel" button. This should
36 * trigger cleaning up action, if the editor has done any changes to the
37 * annotation sets or document or annotation
38 */
39 public void cancelAction() throws GateException;
40
41 /**
42 * Checks whether this editor supports the cancel option
43 * @return <tt>true</tt> iff this editor can rollback changes.
44 */
45 public boolean supportsCancel();
46
47 /**
48 * Checks whether this viewer/editor can handle a specific annotation type.
49 * If the annotation type provided is <tt>null</tt>, then the check is whether
50 * the viewer/editor can handle any arbitrary annotation.
51 */
52 public boolean canDisplayAnnotationType(String annotationType);
53
54 /**
55 * Changes the annotation currently being edited.
56 * @param ann the new annotation.
57 * @param set the set to which the new annotation belongs.
58 */
59 public void editAnnotation(Annotation ann, AnnotationSet set);
60
61 /**
62 * Checks whether the annotation currently being edited can be considered
63 * complete.
64 * @return <tt>true</tt> iff the editor has finished editing the current
65 * annotation. This might return <tt>false</tt> for instance when the current
66 * annotation does not yet comply with the schema and the editor
67 * implementation is designed to enforce schemas.
68 */
69 public boolean editingFinished();
70
71 /**
72 * Checks whether the annotation editor is active (shown on screen and ready
73 * to edit annotations.
74 * @return <tt>true</tt> iff the editor is active.
75 */
76 public boolean isActive();
77
78 /**
79 * @return the annotation currently edited
80 */
81 public Annotation getAnnotationCurrentlyEdited();
82
83 /**
84 * @return the annotation set currently edited
85 */
86 public AnnotationSet getAnnotationSetCurrentlyEdited();
87
88
89
90 }//public interface AnnotationVisualResource extends VisualResource
|