- alignmentAnnotation.restrict(start, end);
- }
- }
- finally
- {
- LOCK.readLock().unlock();
- }
- }
-
- /**
- *
- * @return true if there are columns hidden
- */
- public boolean hasHiddenColumns()
- {
- try
- {
- LOCK.readLock().lock();
- return hiddenColumns != null && hiddenColumns.size() > 0;
- } finally
- {
- LOCK.readLock().unlock();
- }
- }
-
- /**
- *
- * @return true if there are more than one set of columns hidden
- */
- public boolean hasManyHiddenColumns()
- {
- try
- {
- LOCK.readLock().lock();
- return hiddenColumns != null && hiddenColumns.size() > 1;
- } finally
- {
- LOCK.readLock().unlock();
- }
- }
-
- /**
- * mark the columns corresponding to gap characters as hidden in the column
- * selection
- *
- * @param sr
- */
- public void hideInsertionsFor(SequenceI sr)
- {
- try
- {
- LOCK.writeLock().lock();
- List<int[]> inserts = sr.getInsertions();
- for (int[] r : inserts)
- {
- hideColumns(r[0], r[1], true);
- }
- } finally
- {
- LOCK.writeLock().unlock();
- }
- }
-
- /**
- * Unhides, and adds to the selection list, all hidden columns
- */
- public void revealAllHiddenColumns(ColumnSelection sel)
- {
- try
- {
- LOCK.writeLock().lock();
- if (hiddenColumns != null)
- {
- for (int i = 0; i < hiddenColumns.size(); i++)
- {
- int[] region = hiddenColumns.elementAt(i);
- for (int j = region[0]; j < region[1] + 1; j++)
- {
- sel.addElement(j);
- }
- }
- }
-
- hiddenColumns = null;
- }
- finally
- {
- LOCK.writeLock().unlock();
- }
- }
-
- /**
- * Reveals, and marks as selected, the hidden column range with the given
- * start column
- *
- * @param start
- */
- public void revealHiddenColumns(int start, ColumnSelection sel)
- {
- try
- {
- LOCK.writeLock().lock();
- for (int i = 0; i < hiddenColumns.size(); i++)
- {
- int[] region = hiddenColumns.elementAt(i);
- if (start == region[0])