From: kiramt Date: Mon, 15 Jan 2018 13:38:56 +0000 (+0000) Subject: JAL-2759 Rename hideInsertionsFor to hideList, after review X-Git-Tag: Release_2_10_4~55^2~1^2~39 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b95ecdde59db976d721fe9aec626105947825b9e;p=jalview.git JAL-2759 Rename hideInsertionsFor to hideList, after review --- diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index f052c05..7cc2125 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -1920,7 +1920,7 @@ public class Alignment implements AlignmentI SequenceI repseq = getSequenceAt(0); setSeqrep(repseq); HiddenColumns cs = new HiddenColumns(); - cs.hideInsertionsFor(repseq.getInsertions()); + cs.hideList(repseq.getInsertions()); setHiddenColumns(cs); } } diff --git a/src/jalview/datamodel/HiddenColumns.java b/src/jalview/datamodel/HiddenColumns.java index 2b5185f..4a1a9a3 100644 --- a/src/jalview/datamodel/HiddenColumns.java +++ b/src/jalview/datamodel/HiddenColumns.java @@ -300,17 +300,16 @@ public class HiddenColumns } /** - * mark the columns corresponding to gap characters as hidden in the column - * selection + * hide a list of ranges * - * @param insertions + * @param ranges */ - public void hideInsertionsFor(List inserts) + public void hideList(List ranges) { try { LOCK.writeLock().lock(); - for (int[] r : inserts) + for (int[] r : ranges) { hideColumns(r[0], r[1]); } diff --git a/src/jalview/io/AnnotationFile.java b/src/jalview/io/AnnotationFile.java index 885a298..e578a45 100755 --- a/src/jalview/io/AnnotationFile.java +++ b/src/jalview/io/AnnotationFile.java @@ -968,7 +968,7 @@ public class AnnotationFile else { // consider deferring this till after the file has been parsed ? - hidden.hideInsertionsFor(sr.getInsertions()); + hidden.hideList(sr.getInsertions()); } } modified = true; diff --git a/test/jalview/datamodel/HiddenColumnsTest.java b/test/jalview/datamodel/HiddenColumnsTest.java index a31d527..e6c9b32 100644 --- a/test/jalview/datamodel/HiddenColumnsTest.java +++ b/test/jalview/datamodel/HiddenColumnsTest.java @@ -420,7 +420,7 @@ public class HiddenColumnsTest new SequenceI[] { new Sequence("refseqGaptest", "KTDVTI----------NFI-----G----L") }); HiddenColumns cs = new HiddenColumns(); - cs.hideInsertionsFor(al.getSequenceAt(0).getInsertions()); + cs.hideList(al.getSequenceAt(0).getInsertions()); assertEquals("G", "" + al.getSequenceAt(0).getCharAt(cs.visibleToAbsoluteColumn(9))); @@ -1139,10 +1139,10 @@ public class HiddenColumnsTest SequenceI seq1 = new Sequence("TEST1", "GAL---MFW-KQESPVICY--HRNDT"); SequenceI seq2 = new Sequence("TEST1", "GALMFWKQESPVICYHRNDT"); - h.hideInsertionsFor(seq2.getInsertions()); + h.hideList(seq2.getInsertions()); assertTrue(h.equals(h2)); - h.hideInsertionsFor(seq1.getInsertions()); + h.hideList(seq1.getInsertions()); h2.hideColumns(3, 5); h2.hideColumns(9, 9); h2.hideColumns(19, 20);