X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FColumnSelection.java;h=eb6cafe3fb9283b4d1af2ab3400c43c6fb833caa;hb=ef6291f17491f1c426e2cad44021c31f609e2808;hp=26dba83bd36d44c00093efbe57d37d7959e00e31;hpb=ab2005eb4fd46c5d9f2df238f2cf20bcb35bf1f3;p=jalview.git diff --git a/src/jalview/gui/ColumnSelection.java b/src/jalview/gui/ColumnSelection.java index 26dba83..eb6cafe 100755 --- a/src/jalview/gui/ColumnSelection.java +++ b/src/jalview/gui/ColumnSelection.java @@ -171,6 +171,23 @@ public class ColumnSelection selected.setElementAt(new Integer(temp - change), i); } } + + if(hiddenColumns!=null) + { + for(int i=0; i start) + { + region[0] -= change; + region[1] -= change; + } + if(region[0]<0) + region[0] = 0; + if(region[1] <0) + region[1] = 0; + } + } } /** @@ -267,7 +284,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 +303,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) @@ -325,6 +367,14 @@ public class ColumnSelection public void revealAllHiddenColumns(AlignViewport av) { + for(int i=0; i