From 8901bef4a03b0a1bdc24f5292422c96a564e8dff Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Tue, 4 Apr 2006 09:33:40 +0000 Subject: [PATCH] Get hiddenBoundaryLeft and right --- src/jalview/gui/ColumnSelection.java | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/jalview/gui/ColumnSelection.java b/src/jalview/gui/ColumnSelection.java index 26dba83..55c055c 100755 --- a/src/jalview/gui/ColumnSelection.java +++ b/src/jalview/gui/ColumnSelection.java @@ -267,7 +267,7 @@ public class ColumnSelection * In otherwords, the next hidden column. * @param index int */ - public int getHiddenRegionBoundary(int alPos) + public int getHiddenBoundaryRight(int alPos) { if (hiddenColumns != null) { @@ -286,6 +286,31 @@ public class ColumnSelection return alPos; } + /** + * 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 getHiddenBoundaryLeft(int alPos) + { + if (hiddenColumns != null) + { + int index = hiddenColumns.size()-1; + do + { + int[] region = (int[]) hiddenColumns.elementAt(index); + if(alPos > region[1]) + return region[1]; + + index--; + } + while(index >-1); + } + + return alPos; + + } public void hideColumns(int res, AlignViewport av) -- 1.7.10.2