From: kiramt Date: Tue, 26 Sep 2017 10:36:29 +0000 (+0100) Subject: JAL-2674 HiddenColumns interface tidies X-Git-Tag: Release_2_10_4~55^2~1^2~110 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=c2e16e95b564932deda33dc59ecaea367e7b33b0;p=jalview.git JAL-2674 HiddenColumns interface tidies --- diff --git a/src/jalview/datamodel/HiddenColumns.java b/src/jalview/datamodel/HiddenColumns.java index 9f3b929..88af9fa 100644 --- a/src/jalview/datamodel/HiddenColumns.java +++ b/src/jalview/datamodel/HiddenColumns.java @@ -1448,6 +1448,18 @@ public class HiddenColumns } } + public Iterator iterator() + { + if (hiddenColumns != null) + { + return new BoundedHiddenColsIterator(0, hiddenColumns.size(), true); + } + else + { + return new BoundedHiddenColsIterator(0, 0, true); + } + } + public Iterator getBoundedIterator(int start, int end, boolean useCopy) { diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index 1658f0f88..921c329 100644 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -1417,9 +1417,10 @@ public class Jalview2XML } else { - ArrayList hiddenRegions = hidden.getHiddenColumnsCopy(); - for (int[] region : hiddenRegions) + Iterator hiddenRegions = hidden.iterator(); + while (hiddenRegions.hasNext()) { + int[] region = hiddenRegions.next(); HiddenColumns hc = new HiddenColumns(); hc.setStart(region[0]); hc.setEnd(region[1]); diff --git a/test/jalview/io/JSONFileTest.java b/test/jalview/io/JSONFileTest.java index 158c901..bfb714d 100644 --- a/test/jalview/io/JSONFileTest.java +++ b/test/jalview/io/JSONFileTest.java @@ -205,7 +205,7 @@ public class JSONFileTest TEST_SEQ_HEIGHT = expectedSeqs.size(); TEST_GRP_HEIGHT = expectedGrps.size(); TEST_ANOT_HEIGHT = expectedAnnots.size(); - TEST_CS_HEIGHT = expectedColSel.getHiddenColumnsCopy().size(); + TEST_CS_HEIGHT = expectedColSel.getSize(); exportSettings = new AlignExportSettingI() {