X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FCigarArray.java;h=f6e586227c3c76ef20328b9cdc5a962340620e6b;hb=c3b8fbc19c04c2daec702a2bffdfab5d10555143;hp=529891f6dacfdd3a1ae14fb8eca77600fa4f7df7;hpb=47168f025aefdaa044802bd5f8f510ffe43a4808;p=jalview.git diff --git a/src/jalview/datamodel/CigarArray.java b/src/jalview/datamodel/CigarArray.java index 529891f..f6e5862 100644 --- a/src/jalview/datamodel/CigarArray.java +++ b/src/jalview/datamodel/CigarArray.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) - * Copyright (C) 2014 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -20,7 +20,7 @@ */ package jalview.datamodel; -import java.util.Vector; +import java.util.List; public class CigarArray extends CigarBase { @@ -97,8 +97,7 @@ public class CigarArray extends CigarBase private static int[] _calcStartEndBounds(AlignmentI alignment, SequenceGroup selectionGroup) { - int[] startend = new int[] - { 0, 0, 0 }; + int[] startend = new int[] { 0, 0, 0 }; if (selectionGroup != null) { startend[0] = selectionGroup.getSize(); @@ -148,25 +147,25 @@ public class CigarArray extends CigarBase * internal constructor function - called by CigarArray(AlignmentI, ...); * * @param alignment - * @param columnSelection + * @param list * - vector of visible regions as returned from * columnSelection.getHiddenColumns() * @param selectionGroup */ private void constructFromAlignment(AlignmentI alignment, - Vector columnSelection, SequenceGroup selectionGroup) + List list, SequenceGroup selectionGroup) { int[] _startend = _calcStartEndBounds(alignment, selectionGroup); int start = _startend[1], end = _startend[2]; // now construct the CigarArray operations - if (columnSelection != null) + if (list != null) { int[] region; int hideStart, hideEnd; int last = start; - for (int j = 0; last < end & j < columnSelection.size(); j++) + for (int j = 0; last < end & j < list.size(); j++) { - region = (int[]) columnSelection.elementAt(j); + region = list.get(j); hideStart = region[0]; hideEnd = region[1]; // edit hidden regions to selection range @@ -343,8 +342,11 @@ public class CigarArray extends CigarBase delpos = new java.util.Vector(); } int delstart = cursor, delend = cursor + range[i] - 1; // inclusive - delpos.addElement(new int[] - { vcursor + offset, range[i] }); // index of right hand column after + delpos.addElement(new int[] { vcursor + offset, range[i] }); // index of + // right + // hand + // column + // after // hidden region boundary offset += range[i] - 1; // shift in visible column coordinates System.arraycopy(operation, i + 1, operation, i, length - i);