From b29fc6b24c97d0817a116c0241781a0410f6d8c7 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Sun, 18 Jan 2015 15:32:30 +0000 Subject: [PATCH] JAL-1628 wrappers for common checks on ColumnSelection --- src/jalview/datamodel/ColumnSelection.java | 18 ++++++++++++++++++ src/jalview/viewmodel/AlignmentViewport.java | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) 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; -- 1.7.10.2