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, 22 March 2004
11 *
12 * $Id: DocumentView.java 12006 2009-12-01 17:24:28Z thomas_heitz $
13 */
14
15 package gate.gui.docview;
16
17 import java.awt.Component;
18 import java.util.List;
19
20 import gate.VisualResource;
21 import gate.gui.ActionsPublisher;
22 import gate.gui.annedit.AnnotationData;
23
24 /**
25 * A document viewer is composed out of several views (like the one showing the
26 * text, the one showing the annotation sets, the on showing the annotations
27 * table, etc.). This is the base interface for all the document views.
28 * All document views are panes inside a {@link gate.gui.docview.DocumentEditor}
29 * object.
30 */
31
32 public interface DocumentView extends ActionsPublisher, VisualResource{
33
34 /**
35 * Returns the actual UI component this view represents.
36 * @return a {@link Component} value.
37 */
38 public Component getGUI();
39
40 /**
41 * Returns the type of this view.
42 * @return an int value
43 * @see #CENTRAL
44 * @see #HORIZONTAL
45 * @see #VERTICAL
46 */
47 public int getType();
48
49 /**
50 * Notifies this view that it has become active or inactive.
51 * Implementers are encouraged to lazily populate the UI elements, that is
52 * to use as little CPU time as possible before the view becomes active.
53 * @param active a boolean value.
54 */
55 public void setActive(boolean active);
56
57 /**
58 * Returns the active state of this view.
59 * @return a boolean value
60 */
61 public boolean isActive();
62
63 /**
64 * Notifies this view of its owner.
65 * @param editor the {@link DocumentEditor} that contains this view.
66 */
67 public void setOwner(DocumentEditor editor);
68
69 /**
70 * Some document views can use the concept of selected annotations. This
71 * method is called to change the set of selected annotations.
72 * The recommended way to change the selected annotations set is by calling
73 * the {@link DocumentEditor#setSelectedAnnotations(List)} method.
74 * @param selectedAnnots
75 */
76 public void setSelectedAnnotations(List<AnnotationData> selectedAnnots);
77
78 /**
79 * Constant for the CENTRAL type of the view inside the document editor. Views
80 * of this type are placed in the center of the document editor.
81 */
82 public static final int CENTRAL = 0;
83
84 /**
85 * Constant for the VERTICAL type of the view inside the document editor.
86 * Views of this type are placed as a vertical band on the right side of the
87 * document editor.
88 */
89 public static final int VERTICAL = 1;
90
91 /**
92 * Constant for the HORIZONTAL type of the view inside the document editor.
93 * Views of this type are placed as a horizontal band on the lower side of the
94 * document editor.
95 */
96 public static final int HORIZONTAL = 2;
97
98
99 }
|