61b295011936780382499de3c3e2101457d9e1b6
[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    * get the container for alignment consensus annotation
70    * @return
71    */
72   AlignmentAnnotation getAlignmentConsensusAnnotation();
73
74   /**
75    * Test to see if viewport is still open and active
76    * @return true indicates that all references to viewport should be dropped 
77    */
78   boolean isClosed();
79   /**
80    * get the associated calculation thread manager for the view
81    * @return
82    */
83   AlignCalcManagerI getCalcManager();
84   
85   /**
86    * get the percentage gaps allowed in a conservation calculation
87    * 
88    */
89   public int getConsPercGaps();
90
91   /**
92    * set the consensus result object for the viewport
93    * @param hconsensus
94    */
95   void setSequenceConsensusHash(Hashtable[] hconsensus);
96
97   /**
98    * 
99    * @return the alignment annotatino row for the structure consensus calculation
100    */
101   AlignmentAnnotation getAlignmentStrucConsensusAnnotation();
102
103   /**
104    * set the Rna structure consensus result object for the viewport
105    * @param hStrucConsensus 
106    */
107   void setRnaStructureConsensusHash(Hashtable[] hStrucConsensus);
108
109   /**
110    * set global colourscheme
111    * @param rhc
112    */
113   void setGlobalColourScheme(ColourSchemeI rhc);
114
115   Map<SequenceI, SequenceCollectionI> getHiddenRepSequences();
116
117   void setHiddenRepSequences(
118           Map<SequenceI, SequenceCollectionI> hiddenRepSequences);
119
120   /**
121    * hides or shows dynamic annotation rows based on groups and group and alignment associated auto-annotation state flags
122    * apply the current group/autoannotation settings to the alignment view. 
123    * Usually you should call the AlignmentViewPanel.adjustAnnotationHeight() method afterwards to ensure the annotation panel bounds are set correctly.
124    * @param applyGlobalSettings - apply to all autoannotation rows or just the ones associated with the current visible region
125    * @param preserveNewGroupSettings - don't apply global settings to groups which don't already have group associated annotation
126    */
127   void updateGroupAnnotationSettings(boolean applyGlobalSettings,
128           boolean preserveNewGroupSettings);
129
130 }