X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FHiddenColumns.java;h=49f82f5b46793e038551250568305fa40264b406;hb=62086b8b7a0b9436c445a94bfab5eff253adb6d5;hp=c666a4146daba62f06ca5ba04e538a40be57e780;hpb=650bed7f2109092a55ca924039a03628fef2126b;p=jalview.git diff --git a/src/jalview/datamodel/HiddenColumns.java b/src/jalview/datamodel/HiddenColumns.java index c666a41..49f82f5 100644 --- a/src/jalview/datamodel/HiddenColumns.java +++ b/src/jalview/datamodel/HiddenColumns.java @@ -1058,119 +1058,6 @@ public class HiddenColumns } } - /** - * delete any columns in alignmentAnnotation that are hidden (including - * sequence associated annotation). - * - * @param alignmentAnnotation - */ - public void makeVisibleAnnotation(AlignmentAnnotation alignmentAnnotation) - { - if (alignmentAnnotation != null - && alignmentAnnotation.annotations != null) - { - makeVisibleAnnotation(0, alignmentAnnotation.annotations.length, - alignmentAnnotation); - } - } - - /** - * delete any columns in alignmentAnnotation that are hidden (including - * sequence associated annotation). - * - * @param start - * remove any annotation to the right of this column - * @param end - * remove any annotation to the left of this column - * @param alignmentAnnotation - * the annotation to operate on - */ - public void makeVisibleAnnotation(int start, int end, - AlignmentAnnotation alignmentAnnotation) - { - try - { - LOCK.readLock().lock(); - - int startFrom = start; - int endAt = end; - - if (alignmentAnnotation != null - && alignmentAnnotation.annotations != null) - { - if (!hiddenColumns.isEmpty()) - { - removeHiddenAnnotation(startFrom, endAt, alignmentAnnotation); - } - else - { - alignmentAnnotation.restrict(startFrom, endAt); - } - } - } finally - { - LOCK.readLock().unlock(); - } - } - - private void removeHiddenAnnotation(int start, int end, - AlignmentAnnotation alignmentAnnotation) - { - // mangle the alignmentAnnotation annotation array - ArrayList annels = new ArrayList<>(); - Annotation[] els = null; - - int w = 0; - - Iterator blocks = new VisibleContigsIterator(start, end + 1, - hiddenColumns); - - int copylength; - int annotationLength; - while (blocks.hasNext()) - { - int[] block = blocks.next(); - annotationLength = block[1] - block[0] + 1; - - if (blocks.hasNext()) - { - // copy just the visible segment of the annotation row - copylength = annotationLength; - } - else - { - if (annotationLength + block[0] <= alignmentAnnotation.annotations.length) - { - // copy just the visible segment of the annotation row - copylength = annotationLength; - } - else - { - // copy to the end of the annotation row - copylength = alignmentAnnotation.annotations.length - block[0]; - } - } - - els = new Annotation[annotationLength]; - annels.add(els); - System.arraycopy(alignmentAnnotation.annotations, block[0], els, 0, - copylength); - w += annotationLength; - } - - if (w != 0) - { - alignmentAnnotation.annotations = new Annotation[w]; - - w = 0; - for (Annotation[] chnk : annels) - { - System.arraycopy(chnk, 0, alignmentAnnotation.annotations, w, - chnk.length); - w += chnk.length; - } - } - } /** *