From: amwaterhouse Date: Thu, 16 Mar 2006 15:29:55 +0000 (+0000) Subject: isVisible and hiddenboundary added X-Git-Tag: Root_VamJalview_2_07b+~39 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ab2005eb4fd46c5d9f2df238f2cf20bcb35bf1f3;p=jalview.git isVisible and hiddenboundary added --- 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; + } + }