X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FHiddenColumnsCursor.java;h=9cb329864400f391cb510027fca2587e7a412740;hb=4d3cf3e91660d6b1c5bcdee4bef34c2747ac7023;hp=04d7189588b56a178e0c2f0882491a863e247c5d;hpb=caa89ac856d432b159653d92d2f6fbb001dc42d6;p=jalview.git diff --git a/src/jalview/datamodel/HiddenColumnsCursor.java b/src/jalview/datamodel/HiddenColumnsCursor.java index 04d7189..9cb3298 100644 --- a/src/jalview/datamodel/HiddenColumnsCursor.java +++ b/src/jalview/datamodel/HiddenColumnsCursor.java @@ -48,15 +48,34 @@ public class HiddenColumnsCursor * already exist. * * @param hiddenCols + * new hidden columns collection */ protected void resetCursor(List hiddenCols) { + resetCursor(hiddenCols, 0, 0); + } + + /** + * Reset the cursor with a new hidden columns collection, where we know in + * advance the index and hidden columns count of a particular location. + * + * @param hiddenCols + * new hidden columns collection + * @param index + * cursor index to reset to + * @param hiddencount + * hidden columns count to reset to + */ + protected void resetCursor(List hiddenCols, int index, + int hiddencount) + { hiddenColumns = hiddenCols; if ((hiddenCols != null) && (!hiddenCols.isEmpty())) { firstColumn = hiddenColumns.get(0)[0]; HiddenCursorPosition oldpos = cursorPos.get(); - HiddenCursorPosition newpos = new HiddenCursorPosition(0, 0); + HiddenCursorPosition newpos = new HiddenCursorPosition(index, + hiddencount); cursorPos.compareAndSet(oldpos, newpos); } }