f42293d8d6178355ca2bfe3c4e47e2fc552d0281
[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.ColumnSelection;
26 import jalview.datamodel.SequenceCollectionI;
27 import jalview.datamodel.SequenceI;
28 import jalview.schemes.ColourSchemeI;
29
30 /**
31  * @author jimp
32  * 
33  */
34 public interface AlignViewportI
35 {
36
37   int getCharWidth();
38
39   int getEndRes();
40
41   int getCharHeight();
42
43   /**
44    * calculate the height for visible annotation, revalidating bounds where
45    * necessary ABSTRACT GUI METHOD
46    * 
47    * @return total height of annotation
48    */
49   public int calcPanelHeight();
50
51   boolean hasHiddenColumns();
52
53   boolean isValidCharWidth();
54
55   boolean isShowConsensusHistogram();
56
57   boolean isShowSequenceLogo();
58
59   boolean isNormaliseSequenceLogo();
60
61   ColourSchemeI getGlobalColourScheme();
62
63   AlignmentI getAlignment();
64
65   ColumnSelection getColumnSelection();
66
67   Hashtable[] getSequenceConsensusHash();
68
69   Hashtable[] getRnaStructureConsensusHash();
70
71   boolean getIgnoreGapsConsensus();
72
73   boolean getCentreColumnLabels();
74
75   boolean isCalculationInProgress(AlignmentAnnotation alignmentAnnotation);
76
77   AlignmentAnnotation getAlignmentQualityAnnot();
78
79   AlignmentAnnotation getAlignmentConservationAnnotation();
80
81   /**
82    * get the container for alignment consensus annotation
83    * 
84    * @return
85    */
86   AlignmentAnnotation getAlignmentConsensusAnnotation();
87
88   /**
89    * Test to see if viewport is still open and active
90    * 
91    * @return true indicates that all references to viewport should be dropped
92    */
93   boolean isClosed();
94
95   /**
96    * get the associated calculation thread manager for the view
97    * 
98    * @return
99    */
100   AlignCalcManagerI getCalcManager();
101
102   /**
103    * get the percentage gaps allowed in a conservation calculation
104    * 
105    */
106   public int getConsPercGaps();
107
108   /**
109    * set the consensus result object for the viewport
110    * 
111    * @param hconsensus
112    */
113   void setSequenceConsensusHash(Hashtable[] hconsensus);
114
115   /**
116    * 
117    * @return the alignment annotatino row for the structure consensus
118    *         calculation
119    */
120   AlignmentAnnotation getAlignmentStrucConsensusAnnotation();
121
122   /**
123    * set the Rna structure consensus result object for the viewport
124    * 
125    * @param hStrucConsensus
126    */
127   void setRnaStructureConsensusHash(Hashtable[] hStrucConsensus);
128
129   /**
130    * set global colourscheme
131    * 
132    * @param rhc
133    */
134   void setGlobalColourScheme(ColourSchemeI rhc);
135
136   Map<SequenceI, SequenceCollectionI> getHiddenRepSequences();
137
138   void setHiddenRepSequences(
139           Map<SequenceI, SequenceCollectionI> hiddenRepSequences);
140
141   /**
142    * hides or shows dynamic annotation rows based on groups and group and
143    * alignment associated auto-annotation state flags apply the current
144    * group/autoannotation settings to the alignment view. Usually you should
145    * call the AlignmentViewPanel.adjustAnnotationHeight() method afterwards to
146    * ensure the annotation panel bounds are set correctly.
147    * 
148    * @param applyGlobalSettings
149    *          - apply to all autoannotation rows or just the ones associated
150    *          with the current visible region
151    * @param preserveNewGroupSettings
152    *          - don't apply global settings to groups which don't already have
153    *          group associated annotation
154    */
155   void updateGroupAnnotationSettings(boolean applyGlobalSettings,
156           boolean preserveNewGroupSettings);
157
158 }