X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FHiddenColumns.java;h=8cb7971f5cfc43f0541c45601d14e4ccf3e1faac;hb=acf6d0deb9caf0148791f2993be0a2cd7987f569;hp=b903826c83071cb44cfb966b2dc037fc8ef041ae;hpb=e48cf231d302b758416cc9a3b38939853cf6b3bf;p=jalview.git diff --git a/src/jalview/datamodel/HiddenColumns.java b/src/jalview/datamodel/HiddenColumns.java index b903826..8cb7971 100644 --- a/src/jalview/datamodel/HiddenColumns.java +++ b/src/jalview/datamodel/HiddenColumns.java @@ -706,75 +706,6 @@ public class HiddenColumns } /** - * Locate the first position visible for this sequence. If seq isn't visible - * then return the position of the left side of the hidden boundary region. - * - * @param seq - * sequence to find position for - * @return visible start position - */ - public int locateVisibleStartOfSequence(SequenceI seq) - { - try - { - LOCK.readLock().lock(); - int start = 0; - - if (hiddenColumns.isEmpty()) - { - return seq.findIndex(seq.getStart()) - 1; - } - - // Simply walk along the sequence whilst watching for hidden column - // boundaries - Iterator regions = hiddenColumns.iterator(); - int hideStart = seq.getLength(); - int hideEnd = -1; - int visPrev = 0; - int visNext = 0; - boolean foundStart = false; - - // step through the non-gapped positions of the sequence - for (int i = seq.getStart(); i <= seq.getEnd() && (!foundStart); i++) - { - // get alignment position of this residue in the sequence - int p = seq.findIndex(i) - 1; - - // update hidden region start/end - while (hideEnd < p && regions.hasNext()) - { - int[] region = regions.next(); - visPrev = visNext; - visNext += region[0] - visPrev; - hideStart = region[0]; - hideEnd = region[1]; - } - if (hideEnd < p) - { - hideStart = seq.getLength(); - } - // update visible boundary for sequence - if (p < hideStart) - { - start = p; - foundStart = true; - } - } - - if (foundStart) - { - return absoluteToVisibleColumn(start); - } - // otherwise, sequence was completely hidden - return visPrev; - } finally - { - LOCK.readLock().unlock(); - } - } - - - /** * * @return true if there are columns hidden */