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