From: Jim Procter Date: Sun, 18 Jan 2015 15:32:30 +0000 (+0000) Subject: JAL-1628 wrappers for common checks on ColumnSelection X-Git-Tag: Jalview_2_9~108^2~22 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b29fc6b24c97d0817a116c0241781a0410f6d8c7;p=jalview.git JAL-1628 wrappers for common checks on ColumnSelection --- diff --git a/src/jalview/datamodel/ColumnSelection.java b/src/jalview/datamodel/ColumnSelection.java index f5f792c..97b7c67 100644 --- a/src/jalview/datamodel/ColumnSelection.java +++ b/src/jalview/datamodel/ColumnSelection.java @@ -1267,6 +1267,24 @@ public class ColumnSelection } /** + * + * @return true if there are columns marked + */ + public boolean hasSelectedColumns() + { + return (selected != null && selected.size() > 0); + } + + /** + * + * @return true if there are columns hidden + */ + public boolean hasHiddenColumns() + { + return hiddenColumns != null && hiddenColumns.size() > 0; + } + + /** * mark the columns corresponding to gap characters as hidden in the column * selection * diff --git a/src/jalview/viewmodel/AlignmentViewport.java b/src/jalview/viewmodel/AlignmentViewport.java index 72cd316..9510c2f 100644 --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@ -675,7 +675,7 @@ public abstract class AlignmentViewport implements AlignViewportI public void updateHiddenColumns() { - hasHiddenColumns = colSel.getHiddenColumns() != null; + hasHiddenColumns = colSel.hasHiddenColumns(); } protected boolean hasHiddenRows = false;