JAL-1432 updated copyright notices
[jalview.git] / src / jalview / api / AlignViewportI.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
3  * Copyright (C) 2014 The Jalview Authors
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  * The Jalview Authors are detailed in the 'AUTHORS' file.
18  */
19 package jalview.api;
20
21 import java.awt.Color;
22 import java.util.Hashtable;
23 import java.util.Map;
24
25 import jalview.datamodel.AlignmentAnnotation;
26 import jalview.datamodel.AlignmentI;
27 import jalview.datamodel.AlignmentView;
28 import jalview.datamodel.CigarArray;
29 import jalview.datamodel.ColumnSelection;
30 import jalview.datamodel.SequenceCollectionI;
31 import jalview.datamodel.SequenceGroup;
32 import jalview.datamodel.SequenceI;
33 import jalview.schemes.ColourSchemeI;
34
35 /**
36  * @author jimp
37  * 
38  */
39 public interface AlignViewportI
40 {
41
42   int getCharWidth();
43
44   int getEndRes();
45
46   int getCharHeight();
47
48   /**
49    * calculate the height for visible annotation, revalidating bounds where
50    * necessary ABSTRACT GUI METHOD
51    * 
52    * @return total height of annotation
53    */
54   public int calcPanelHeight();
55
56   boolean hasHiddenColumns();
57
58   boolean isValidCharWidth();
59
60   boolean isShowConsensusHistogram();
61
62   boolean isShowSequenceLogo();
63
64   boolean isNormaliseSequenceLogo();
65
66   ColourSchemeI getGlobalColourScheme();
67
68   AlignmentI getAlignment();
69
70   ColumnSelection getColumnSelection();
71
72   Hashtable[] getSequenceConsensusHash();
73
74   Hashtable[] getRnaStructureConsensusHash();
75
76   boolean getIgnoreGapsConsensus();
77
78   boolean getCentreColumnLabels();
79
80   boolean isCalculationInProgress(AlignmentAnnotation alignmentAnnotation);
81
82   AlignmentAnnotation getAlignmentQualityAnnot();
83
84   AlignmentAnnotation getAlignmentConservationAnnotation();
85
86   /**
87    * get the container for alignment consensus annotation
88    * 
89    * @return
90    */
91   AlignmentAnnotation getAlignmentConsensusAnnotation();
92
93   /**
94    * Test to see if viewport is still open and active
95    * 
96    * @return true indicates that all references to viewport should be dropped
97    */
98   boolean isClosed();
99
100   /**
101    * get the associated calculation thread manager for the view
102    * 
103    * @return
104    */
105   AlignCalcManagerI getCalcManager();
106
107   /**
108    * get the percentage gaps allowed in a conservation calculation
109    * 
110    */
111   public int getConsPercGaps();
112
113   /**
114    * set the consensus result object for the viewport
115    * 
116    * @param hconsensus
117    */
118   void setSequenceConsensusHash(Hashtable[] hconsensus);
119
120   /**
121    * 
122    * @return the alignment annotatino row for the structure consensus
123    *         calculation
124    */
125   AlignmentAnnotation getAlignmentStrucConsensusAnnotation();
126
127   /**
128    * set the Rna structure consensus result object for the viewport
129    * 
130    * @param hStrucConsensus
131    */
132   void setRnaStructureConsensusHash(Hashtable[] hStrucConsensus);
133
134   /**
135    * set global colourscheme
136    * 
137    * @param rhc
138    */
139   void setGlobalColourScheme(ColourSchemeI rhc);
140
141   Map<SequenceI, SequenceCollectionI> getHiddenRepSequences();
142
143   void setHiddenRepSequences(
144           Map<SequenceI, SequenceCollectionI> hiddenRepSequences);
145
146   /**
147    * hides or shows dynamic annotation rows based on groups and group and
148    * alignment associated auto-annotation state flags apply the current
149    * group/autoannotation settings to the alignment view. Usually you should
150    * call the AlignmentViewPanel.adjustAnnotationHeight() method afterwards to
151    * ensure the annotation panel bounds are set correctly.
152    * 
153    * @param applyGlobalSettings
154    *          - apply to all autoannotation rows or just the ones associated
155    *          with the current visible region
156    * @param preserveNewGroupSettings
157    *          - don't apply global settings to groups which don't already have
158    *          group associated annotation
159    */
160   void updateGroupAnnotationSettings(boolean applyGlobalSettings,
161           boolean preserveNewGroupSettings);
162
163
164   SequenceGroup getSelectionGroup();
165
166   SequenceI[] getSequenceSelection();
167
168
169   CigarArray getViewAsCigars(boolean selectedRegionOnly);
170
171   AlignmentView getAlignmentView(boolean selectedOnly);
172
173   AlignmentView getAlignmentView(boolean selectedOnly, boolean markGroups);
174
175   String[] getViewAsString(boolean selectedRegionOnly);
176
177   void setSelectionGroup(SequenceGroup sg);
178
179   char getGapCharacter();
180
181
182 }