Jalview 2.8 Source Header
[jalview.git] / src / jalview / api / AlignViewportI.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3  * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
10  *  
11  * Jalview is distributed in the hope that it will be useful, but 
12  * WITHOUT ANY WARRANTY; without even the implied warranty 
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14  * PURPOSE.  See the GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 package jalview.api;
19
20 import java.util.Hashtable;
21 import java.util.Map;
22
23 import jalview.datamodel.AlignmentAnnotation;
24 import jalview.datamodel.AlignmentI;
25 import jalview.datamodel.AnnotatedCollectionI;
26 import jalview.datamodel.ColumnSelection;
27 import jalview.datamodel.SequenceCollectionI;
28 import jalview.datamodel.SequenceI;
29 import jalview.schemes.ColourSchemeI;
30 import jalview.schemes.RNAHelicesColour;
31
32 /**
33  * @author jimp
34  * 
35  */
36 public interface AlignViewportI
37 {
38
39   int getCharWidth();
40
41   int getEndRes();
42
43   int getCharHeight();
44
45   /**
46    * calculate the height for visible annotation, revalidating bounds where
47    * necessary ABSTRACT GUI METHOD
48    * 
49    * @return total height of annotation
50    */
51   public int calcPanelHeight();
52
53   boolean hasHiddenColumns();
54
55   boolean isValidCharWidth();
56
57   boolean isShowConsensusHistogram();
58
59   boolean isShowSequenceLogo();
60
61   boolean isNormaliseSequenceLogo();
62
63   ColourSchemeI getGlobalColourScheme();
64
65   AlignmentI getAlignment();
66
67   ColumnSelection getColumnSelection();
68
69   Hashtable[] getSequenceConsensusHash();
70
71   Hashtable[] getRnaStructureConsensusHash();
72
73   boolean getIgnoreGapsConsensus();
74
75   boolean getCentreColumnLabels();
76
77   boolean isCalculationInProgress(AlignmentAnnotation alignmentAnnotation);
78
79   AlignmentAnnotation getAlignmentQualityAnnot();
80
81   AlignmentAnnotation getAlignmentConservationAnnotation();
82
83   /**
84    * get the container for alignment consensus annotation
85    * 
86    * @return
87    */
88   AlignmentAnnotation getAlignmentConsensusAnnotation();
89
90   /**
91    * Test to see if viewport is still open and active
92    * 
93    * @return true indicates that all references to viewport should be dropped
94    */
95   boolean isClosed();
96
97   /**
98    * get the associated calculation thread manager for the view
99    * 
100    * @return
101    */
102   AlignCalcManagerI getCalcManager();
103
104   /**
105    * get the percentage gaps allowed in a conservation calculation
106    * 
107    */
108   public int getConsPercGaps();
109
110   /**
111    * set the consensus result object for the viewport
112    * 
113    * @param hconsensus
114    */
115   void setSequenceConsensusHash(Hashtable[] hconsensus);
116
117   /**
118    * 
119    * @return the alignment annotatino row for the structure consensus
120    *         calculation
121    */
122   AlignmentAnnotation getAlignmentStrucConsensusAnnotation();
123
124   /**
125    * set the Rna structure consensus result object for the viewport
126    * 
127    * @param hStrucConsensus
128    */
129   void setRnaStructureConsensusHash(Hashtable[] hStrucConsensus);
130
131   /**
132    * set global colourscheme
133    * 
134    * @param rhc
135    */
136   void setGlobalColourScheme(ColourSchemeI rhc);
137
138   Map<SequenceI, SequenceCollectionI> getHiddenRepSequences();
139
140   void setHiddenRepSequences(
141           Map<SequenceI, SequenceCollectionI> hiddenRepSequences);
142
143   /**
144    * hides or shows dynamic annotation rows based on groups and group and
145    * alignment associated auto-annotation state flags apply the current
146    * group/autoannotation settings to the alignment view. Usually you should
147    * call the AlignmentViewPanel.adjustAnnotationHeight() method afterwards to
148    * ensure the annotation panel bounds are set correctly.
149    * 
150    * @param applyGlobalSettings
151    *          - apply to all autoannotation rows or just the ones associated
152    *          with the current visible region
153    * @param preserveNewGroupSettings
154    *          - don't apply global settings to groups which don't already have
155    *          group associated annotation
156    */
157   void updateGroupAnnotationSettings(boolean applyGlobalSettings,
158           boolean preserveNewGroupSettings);
159
160 }