2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
3 * Copyright (C) 2014 The Jalview Authors
5 * This file is part of Jalview.
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
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
23 import jalview.analysis.Conservation;
24 import jalview.datamodel.AlignmentAnnotation;
25 import jalview.datamodel.AlignmentI;
26 import jalview.datamodel.AlignmentView;
27 import jalview.datamodel.CigarArray;
28 import jalview.datamodel.ColumnSelection;
29 import jalview.datamodel.SequenceCollectionI;
30 import jalview.datamodel.SequenceGroup;
31 import jalview.datamodel.SequenceI;
32 import jalview.schemes.ColourSchemeI;
34 import java.awt.Color;
35 import java.util.Hashtable;
36 import java.util.List;
43 public interface AlignViewportI
53 * calculate the height for visible annotation, revalidating bounds where
54 * necessary ABSTRACT GUI METHOD
56 * @return total height of annotation
58 public int calcPanelHeight();
60 boolean hasHiddenColumns();
62 boolean isValidCharWidth();
64 boolean isShowConsensusHistogram();
66 boolean isShowSequenceLogo();
68 boolean isNormaliseSequenceLogo();
70 ColourSchemeI getGlobalColourScheme();
72 AlignmentI getAlignment();
74 ColumnSelection getColumnSelection();
76 Hashtable[] getSequenceConsensusHash();
78 Hashtable[] getRnaStructureConsensusHash();
81 boolean getCentreColumnLabels();
82 boolean isIgnoreGapsConsensus();
84 boolean isCalculationInProgress(AlignmentAnnotation alignmentAnnotation);
86 AlignmentAnnotation getAlignmentQualityAnnot();
88 AlignmentAnnotation getAlignmentConservationAnnotation();
91 * get the container for alignment consensus annotation
95 AlignmentAnnotation getAlignmentConsensusAnnotation();
98 * Test to see if viewport is still open and active
100 * @return true indicates that all references to viewport should be dropped
105 * get the associated calculation thread manager for the view
109 AlignCalcManagerI getCalcManager();
112 * get the percentage gaps allowed in a conservation calculation
115 public int getConsPercGaps();
118 * set the consensus result object for the viewport
122 void setSequenceConsensusHash(Hashtable[] hconsensus);
126 * @return the alignment annotatino row for the structure consensus
129 AlignmentAnnotation getAlignmentStrucConsensusAnnotation();
132 * set the Rna structure consensus result object for the viewport
134 * @param hStrucConsensus
136 void setRnaStructureConsensusHash(Hashtable[] hStrucConsensus);
139 * set global colourscheme
143 void setGlobalColourScheme(ColourSchemeI rhc);
145 Map<SequenceI, SequenceCollectionI> getHiddenRepSequences();
147 void setHiddenRepSequences(
148 Map<SequenceI, SequenceCollectionI> hiddenRepSequences);
151 * hides or shows dynamic annotation rows based on groups and group and
152 * alignment associated auto-annotation state flags apply the current
153 * group/autoannotation settings to the alignment view. Usually you should
154 * call the AlignmentViewPanel.adjustAnnotationHeight() method afterwards to
155 * ensure the annotation panel bounds are set correctly.
157 * @param applyGlobalSettings
158 * - apply to all autoannotation rows or just the ones associated
159 * with the current visible region
160 * @param preserveNewGroupSettings
161 * - don't apply global settings to groups which don't already have
162 * group associated annotation
164 void updateGroupAnnotationSettings(boolean applyGlobalSettings,
165 boolean preserveNewGroupSettings);
168 * @return true if a reference sequence is set and should be displayed
170 public boolean isDisplayReferenceSeq();
173 * @return set the flag for displaying reference sequences when they are
176 public void setDisplayReferenceSeq(boolean displayReferenceSeq);
179 * @return true if colourschemes should render according to reference sequence
180 * rather than consensus if available
182 public boolean isColourByReferenceSeq();
185 * @return true set flag for deciding if colourschemes should render according
186 * to reference sequence rather than consensus if available
188 public void setColourByReferenceSeq(boolean colourByReferenceSeq);
190 void setSequenceColour(SequenceI seq, Color col);
192 Color getSequenceColour(SequenceI seq);
194 void updateSequenceIdColours();
196 SequenceGroup getSelectionGroup();
199 * get the currently selected sequence objects or all the sequences in the
200 * alignment. TODO: change to List<>
202 * @return array of references to sequence objects
204 SequenceI[] getSequenceSelection();
206 void clearSequenceColours();
209 * This method returns the visible alignment as text, as seen on the GUI, ie
210 * if columns are hidden they will not be returned in the result. Use this for
211 * calculating trees, PCA, redundancy etc on views which contain hidden
216 CigarArray getViewAsCigars(boolean selectedRegionOnly);
219 * return a compact representation of the current alignment selection to pass
220 * to an analysis function
222 * @param selectedOnly
223 * boolean true to just return the selected view
224 * @return AlignmentView
226 AlignmentView getAlignmentView(boolean selectedOnly);
229 * return a compact representation of the current alignment selection to pass
230 * to an analysis function
232 * @param selectedOnly
233 * boolean true to just return the selected view
235 * boolean true to annotate the alignment view with groups on the
236 * alignment (and intersecting with selected region if selectedOnly
238 * @return AlignmentView
240 AlignmentView getAlignmentView(boolean selectedOnly, boolean markGroups);
243 * This method returns the visible alignment as text, as seen on the GUI, ie
244 * if columns are hidden they will not be returned in the result. Use this for
245 * calculating trees, PCA, redundancy etc on views which contain hidden
250 String[] getViewAsString(boolean selectedRegionOnly);
252 void setSelectionGroup(SequenceGroup sg);
254 char getGapCharacter();
256 void setColumnSelection(ColumnSelection cs);
258 void setConservation(Conservation cons);
261 * get a copy of the currently visible alignment annotation
262 * @param selectedOnly if true - trim to selected regions on the alignment
263 * @return an empty list or new alignment annotation objects shown only visible columns trimmed to selected region only
265 List<AlignmentAnnotation> getVisibleAlignmentAnnotation(
266 boolean selectedOnly);
268 FeaturesDisplayedI getFeaturesDisplayed();
270 String getSequenceSetId();
272 boolean isShowSequenceFeatures();
274 void setShowSequenceFeatures(boolean b);
279 * indicating if annotation panel shown below alignment
282 void setShowAnnotation(boolean b);
285 * flag indicating if annotation panel shown below alignment
289 boolean isShowAnnotation();
291 boolean isRightAlignIds();
293 void setRightAlignIds(boolean rightAlignIds);
295 boolean areFeaturesDisplayed();
297 void setShowSequenceFeaturesHeight(boolean selected);
299 boolean isShowSequenceFeaturesHeight();
301 void setFeaturesDisplayed(FeaturesDisplayedI featuresDisplayedI);
303 void alignmentChanged(AlignmentViewPanel ap);
306 * @return the padGaps
314 void setPadGaps(boolean padGaps);
317 * return visible region boundaries within given column range
320 * first column (inclusive, from 0)
322 * last column (exclusive)
323 * @return int[][] range of {start,end} visible positions TODO: change to list
326 int[][] getVisibleRegionBoundaries(int min, int max);
329 * This method returns an array of new SequenceI objects derived from the
330 * whole alignment or just the current selection with start and end points
333 * @note if you need references to the actual SequenceI objects in the
334 * alignment or currently selected then use getSequenceSelection()
335 * @return selection as new sequenceI objects
337 SequenceI[] getSelectionAsNewSequence();
339 void invertColumnSelection();
342 * broadcast selection to any interested parties
344 void sendSelection();
347 * calculate the row position for alignmentIndex if all hidden sequences were
350 * @param alignmentIndex
351 * @return adjusted row position
353 int adjustForHiddenSeqs(int alignmentIndex);
355 boolean hasHiddenRows();
359 * @return a copy of this view's current display settings
361 public ViewStyleI getViewStyle();
364 * update the view's display settings with the given style set
366 * @param settingsForView
368 public void setViewStyle(ViewStyleI settingsForView);