1   /*
2    *  Copyright (c) 1998-2005, The University of Sheffield.
3    *
4    *  This file is part of GATE (see http://gate.ac.uk/), and is free
5    *  software, licenced under the GNU Library General Public License,
6    *  Version 2, June 1991 (in the distribution as file licence.html,
7    *  and also available at http://gate.ac.uk/gate/licence.html).
8    *
9    *  Valentin Tablan, 22 March 2004
10   *
11   *  $Id: DocumentView.java,v 1.7 2005/01/11 13:51:35 ian Exp $
12   */
13  
14  package gate.gui.docview;
15  
16  import java.awt.Component;
17  
18  import gate.VisualResource;
19  import gate.gui.ActionsPublisher;
20  
21  /**
22   * A document viewer is composed out of several views (like the one showing the
23   * text, the one showing the annotation sets, the on showing the annotations
24   * table, etc.). This is the base interface for all the document views.
25   * All document views are panes inside a {@link gate.gui.docview.DocumentEditor}
26   * object.
27   */
28  
29  public interface DocumentView extends ActionsPublisher, VisualResource{
30  
31    /**
32     * Returns the actual UI component this view represents.
33     * @return a {@link Component} value.
34     */
35    public Component getGUI();
36  
37    /**
38     * Returns the type of this view.
39     * @return an int value
40     * @see #CENTRAL
41     * @see #HORIZONTAL
42     * @see #VERTICAL
43     */
44    public int getType();
45    
46    /**
47     * Notifies this view that it has become active or inactive.
48     * Implementers are encouraged to lazily populate the UI elements, that is 
49     * to use as little CPU time as possible before the view becomes active.
50     * @param active a boolean value.
51     */
52    public void setActive(boolean active);
53    
54    /**
55     * Returns the active state of this view. 
56     * @return a boolean value
57     */
58    public boolean isActive();
59    
60    /**
61     * Notifies this view of its owner.
62     * @param editor the {@link DocumentEditor} that contains this view.
63     */
64    public void setOwner(DocumentEditor editor);
65    
66    /**
67     * Constant for the CENTRAL type of the view inside the document editor. Views
68     * of this type are placed in the center of the document editor.
69     */
70    public static final int CENTRAL = 0;
71  
72    /**
73     * Constant for the VERTICAL type of the view inside the document editor.
74     * Views of this type are placed as a vertical band on the right side of the
75     * document editor.
76     */
77    public static final int VERTICAL = 1;
78  
79    /**
80     * Constant for the HORIZONTAL type of the view inside the document editor.
81     * Views of this type are placed as a horizontal band on the lower side of the
82     * document editor.
83     */
84    public static final int HORIZONTAL = 2;
85    
86  
87  }