From: tcofoegbu Date: Wed, 1 Jun 2016 15:33:46 +0000 (+0100) Subject: JAL-1944 updated bugfix implementation X-Git-Tag: Release_2_10_0~195 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e7b6c76c3b028aeeef7770c99c87d895c1b46172;p=jalview.git JAL-1944 updated bugfix implementation --- diff --git a/src/jalview/api/AlignViewportI.java b/src/jalview/api/AlignViewportI.java index f40b73b..9d5c075 100644 --- a/src/jalview/api/AlignViewportI.java +++ b/src/jalview/api/AlignViewportI.java @@ -240,6 +240,19 @@ public interface AlignViewportI extends ViewStyleI * @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. However, If + * there are hidden sequences, isExportHiddenSeqs flag decides if they would + * be exported or not. Use this for calculating trees, PCA, redundancy etc on + * views which contain hidden columns. + * + * @param selectedRegionOnly + * @param isExportHiddenSeqs + * @return String[] + */ + String[] getViewAsString(boolean selectedRegionOnly, boolean isExportHiddenSeqs); void setSelectionGroup(SequenceGroup sg); @@ -376,20 +389,6 @@ public interface AlignViewportI extends ViewStyleI */ void setFollowHighlight(boolean b); - /** - * Set whether hidden Sequences should be trimmed off during an export - * operation. - * - * @param isExportHiddenSeqs - */ - public void setExportHiddenSeqs(boolean isExportHiddenSeqs); - - /** - * If true hidden Sequences are exported otherwise they aren't - * - * @return - */ - public boolean isExportHiddenSeqs(); public void applyFeaturesStyle(FeatureSettingsModelI featureSettings); } diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 818c150..d973bb7 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -1313,8 +1313,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, if (viewport.hasHiddenColumns() && !settings.isExportHiddenColumns()) { - viewport.setExportHiddenSeqs(settings.isExportHiddenSequences()); - omitHidden = viewport.getViewAsString(false); + omitHidden = viewport.getViewAsString(false, + settings.isExportHiddenSequences()); } int[] alignmentStartEnd = new int[2]; diff --git a/src/jalview/viewmodel/AlignmentViewport.java b/src/jalview/viewmodel/AlignmentViewport.java index 6581bef..7cea5a3 100644 --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@ -1588,6 +1588,13 @@ public abstract class AlignmentViewport implements AlignViewportI, @Override public String[] getViewAsString(boolean selectedRegionOnly) { + return getViewAsString(selectedRegionOnly, true); + } + + @Override + public String[] getViewAsString(boolean selectedRegionOnly, + boolean isExportHiddenSeqs) + { String[] selection = null; SequenceI[] seqs = null; int i, iSize; @@ -2720,17 +2727,5 @@ public abstract class AlignmentViewport implements AlignViewportI, } } - private boolean isExportHiddenSeqs = true; - @Override - public void setExportHiddenSeqs(boolean isExportHiddenSeqs) - { - this.isExportHiddenSeqs = isExportHiddenSeqs; - } - - @Override - public boolean isExportHiddenSeqs() - { - return isExportHiddenSeqs; - } }