- // get index of hidden region to left of start
- int index = getHiddenIndexLeft(start);
- if (index == -1)
- {
- // no hidden regions to left of startColumn
- return start - distance;
- }
-
- // walk backwards through the alignment subtracting the counts of visible
- // columns from distance
- int[] region;
- int gap = 0;
- int nextstart = start;
-
- while ((index > -1) && (distance - gap > 0))
- {
- // subtract the gap to right of region from distance
- distance -= gap;
- start = nextstart;
-
- // calculate the next gap
- region = hiddenColumns.get(index);
- gap = start - region[1];
-
- // set start to just to left of current region
- nextstart = region[0] - 1;
- index--;
- }
-
- if (distance - gap > 0)
- {
- // fell out of loop because there are no more hidden regions
- distance -= gap;
- return nextstart - distance;
- }
- return start - distance;
- } finally
- {
- LOCK.readLock().unlock();
- }
-
- }
-
- /**
- * Use this method to determine the set of hiddenRegion start positions
- * between absolute position <start> and absolute position <end>
- *
- * @param start
- * absolute residue to start from
- * @param end
- * absolute residue to end at
- *
- * @return list of column numbers in *visible* view where hidden regions start
- */
- public List<Integer> findHiddenRegionPositions(int start, int end)
- {
- try
- {
- LOCK.readLock().lock();
- List<Integer> positions = null;