X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fapi%2FAlignViewportI.java;h=33a0061b8b678418489d79354e434402c9fc68c2;hb=424f6f03e8fb5e40cceca09fc8ffd72b41e3a9e4;hp=fa73194239fbbf77709f2dd234288a43bb9cdc27;hpb=2e2e6d269fbaa505151fe777374f41111f2910d5;p=jalview.git diff --git a/src/jalview/api/AlignViewportI.java b/src/jalview/api/AlignViewportI.java index fa73194..33a0061 100644 --- a/src/jalview/api/AlignViewportI.java +++ b/src/jalview/api/AlignViewportI.java @@ -20,22 +20,25 @@ */ package jalview.api; -import java.awt.Color; -import java.util.Hashtable; -import java.util.List; -import java.util.Map; - import jalview.analysis.Conservation; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; import jalview.datamodel.AlignmentView; import jalview.datamodel.CigarArray; import jalview.datamodel.ColumnSelection; +import jalview.datamodel.ProfilesI; +import jalview.datamodel.SearchResultsI; import jalview.datamodel.SequenceCollectionI; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; +import jalview.renderer.ResidueShaderI; import jalview.schemes.ColourSchemeI; +import java.awt.Color; +import java.util.Hashtable; +import java.util.List; +import java.util.Map; + /** * @author jimp * @@ -53,6 +56,18 @@ public interface AlignViewportI extends ViewStyleI */ public int calcPanelHeight(); + /** + * Answers true if the viewport has at least one column selected + * + * @return + */ + boolean hasSelectedColumns(); + + /** + * Answers true if the viewport has at least one hidden column + * + * @return + */ boolean hasHiddenColumns(); boolean isValidCharWidth(); @@ -65,11 +80,19 @@ public interface AlignViewportI extends ViewStyleI ColourSchemeI getGlobalColourScheme(); + /** + * Returns an object that describes colouring (including any thresholding or + * fading) of the alignment + * + * @return + */ + ResidueShaderI getViewportColourScheme(); + AlignmentI getAlignment(); ColumnSelection getColumnSelection(); - Hashtable[] getSequenceConsensusHash(); + ProfilesI getSequenceConsensusHash(); /** * Get consensus data table for the cDNA complement of this alignment (if any) @@ -110,6 +133,11 @@ public interface AlignViewportI extends ViewStyleI boolean isClosed(); /** + * Dispose of all references or resources held by the viewport + */ + void dispose(); + + /** * get the associated calculation thread manager for the view * * @return @@ -127,7 +155,7 @@ public interface AlignViewportI extends ViewStyleI * * @param hconsensus */ - void setSequenceConsensusHash(Hashtable[] hconsensus); + void setSequenceConsensusHash(ProfilesI hconsensus); /** * Set the cDNA complement consensus for the viewport @@ -138,7 +166,7 @@ public interface AlignViewportI extends ViewStyleI /** * - * @return the alignment annotatino row for the structure consensus + * @return the alignment annotation row for the structure consensus * calculation */ AlignmentAnnotation getAlignmentStrucConsensusAnnotation(); @@ -151,11 +179,13 @@ public interface AlignViewportI extends ViewStyleI void setRnaStructureConsensusHash(Hashtable[] hStrucConsensus); /** - * set global colourscheme + * Sets the colour scheme for the background alignment (as distinct from + * sub-groups, which may have their own colour schemes). A null value is used + * for no residue colour (white). * - * @param rhc + * @param cs */ - void setGlobalColourScheme(ColourSchemeI rhc); + void setGlobalColourScheme(ColourSchemeI cs); Map getHiddenRepSequences(); @@ -178,7 +208,7 @@ public interface AlignViewportI extends ViewStyleI */ void updateGroupAnnotationSettings(boolean applyGlobalSettings, boolean preserveNewGroupSettings); - + void setSequenceColour(SequenceI seq, Color col); Color getSequenceColour(SequenceI seq); @@ -235,11 +265,31 @@ public interface AlignViewportI extends ViewStyleI * This method returns the visible alignment as text, as seen on the GUI, ie * if columns are hidden they will not be returned in the result. Use this for * calculating trees, PCA, redundancy etc on views which contain hidden + * columns. This method doesn't exclude hidden sequences from the output. + * + * @param selectedRegionOnly + * - determines if only the selected region or entire alignment is + * exported + * @return String[] + */ + String[] getViewAsString(boolean selectedRegionOnly); + + /** + * This method returns the visible alignment as text, as seen on the GUI, ie + * if columns are hidden they will not be returned in the result. Use this for + * calculating trees, PCA, redundancy etc on views which contain hidden * columns. * + * @param selectedRegionOnly + * - determines if only the selected region or entire alignment is + * exported + * @param isExportHiddenSeqs + * - determines if hidden sequences would be exported or not. + * * @return String[] */ - String[] getViewAsString(boolean selectedRegionOnly); + String[] getViewAsString(boolean selectedRegionOnly, + boolean isExportHiddenSeqs); void setSelectionGroup(SequenceGroup sg); @@ -251,8 +301,11 @@ public interface AlignViewportI extends ViewStyleI /** * get a copy of the currently visible alignment annotation - * @param selectedOnly if true - trim to selected regions on the alignment - * @return an empty list or new alignment annotation objects shown only visible columns trimmed to selected region only + * + * @param selectedOnly + * if true - trim to selected regions on the alignment + * @return an empty list or new alignment annotation objects shown only + * visible columns trimmed to selected region only */ List getVisibleAlignmentAnnotation( boolean selectedOnly); @@ -373,25 +426,34 @@ public interface AlignViewportI extends ViewStyleI */ void setFollowHighlight(boolean b); + public void applyFeaturesStyle(FeatureSettingsModelI featureSettings); + /** - * Returns a FeatureRenderer instance + * check if current selection group is defined on the view, or is simply a + * temporary group. * - * @return + * @return true if group is defined on the alignment */ - public FeatureRenderer getFeatureRenderer(); + boolean isSelectionDefinedGroup(); /** - * Sets a FeatureRenderer for a viewport * - * @param featureRenderer + * @return true if there are search results on the view */ - public void setFeatureRenderer(FeatureRenderer featureRenderer); + boolean hasSearchResults(); /** - * Returns Settings for exporting an Alignment + * set the search results for the view * - * @return + * @param results + * - or null to clear current results */ - public AlignExportSettingI getExportSettings(); + void setSearchResults(SearchResultsI results); + /** + * get search results for this view (if any) + * + * @return search results or null + */ + SearchResultsI getSearchResults(); }