From ab2005eb4fd46c5d9f2df238f2cf20bcb35bf1f3 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 16 Mar 2006 15:29:55 +0000 Subject: [PATCH] isVisible and hiddenboundary added --- src/jalview/gui/ColumnSelection.java | 39 +++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/src/jalview/gui/ColumnSelection.java b/src/jalview/gui/ColumnSelection.java index c9e232a..26dba83 100755 --- a/src/jalview/gui/ColumnSelection.java +++ b/src/jalview/gui/ColumnSelection.java @@ -20,7 +20,6 @@ package jalview.gui; import java.util.*; - /** * NOTE: Columns are zero based. */ @@ -262,6 +261,31 @@ public class ColumnSelection return result; } + /** + * THis method returns the rightmost limit of a + * region of an alignment with hidden columns. + * In otherwords, the next hidden column. + * @param index int + */ + public int getHiddenRegionBoundary(int alPos) + { + if (hiddenColumns != null) + { + int index = 0; + do + { + int[] region = (int[]) hiddenColumns.elementAt(index); + if(alPos < region[0]) + return region[0]; + + index++; + } + while(index < hiddenColumns.size()); + } + + return alPos; + + } public void hideColumns(int res, AlignViewport av) @@ -322,4 +346,17 @@ public class ColumnSelection av.hasHiddenColumns = false; } + public boolean isVisible(int column) + { + for(int i=0; i= region[0] && column <= region[1]) + { + return false; + } + } + return true; + } + } -- 1.7.10.2