X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fdatamodel%2FColumnSelection.java;h=f414d1304b992b5e7644f5d9d368675d2dd2c5a6;hb=393d4a79542f70fd6975e2a5250b819d5023f590;hp=0655660e4ad9da84136ec807586e075da0c36e95;hpb=a8f483d04205bb8273ee311c12968b7e86d205fa;p=jalview.git
diff --git a/src/jalview/datamodel/ColumnSelection.java b/src/jalview/datamodel/ColumnSelection.java
index 0655660..f414d13 100644
--- a/src/jalview/datamodel/ColumnSelection.java
+++ b/src/jalview/datamodel/ColumnSelection.java
@@ -6,21 +6,26 @@
*
* Jalview is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
*
* Jalview is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along with Jalview. If not, see .
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see .
* The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.datamodel;
-import java.util.*;
+import jalview.util.ShiftList;
-import jalview.util.*;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Vector;
/**
* NOTE: Columns are zero based.
@@ -184,9 +189,9 @@ public class ColumnSelection
* @param left
* shift in edit (+ve for removal, or -ve for inserts)
*/
- public Vector compensateForEdit(int start, int change)
+ public List compensateForEdit(int start, int change)
{
- Vector deletedHiddenColumns = null;
+ List deletedHiddenColumns = null;
for (int i = 0; i < size(); i++)
{
int temp = columnAt(i);
@@ -199,14 +204,14 @@ public class ColumnSelection
if (hiddenColumns != null)
{
- deletedHiddenColumns = new Vector();
+ deletedHiddenColumns = new ArrayList();
int hSize = hiddenColumns.size();
for (int i = 0; i < hSize; i++)
{
int[] region = (int[]) hiddenColumns.elementAt(i);
if (region[0] > start && start + change > region[1])
{
- deletedHiddenColumns.addElement(hiddenColumns.elementAt(i));
+ deletedHiddenColumns.add(region);
hiddenColumns.removeElementAt(i);
i--;
@@ -750,6 +755,7 @@ public class ColumnSelection
public boolean isVisible(int column)
{
if (hiddenColumns != null)
+ {
for (int i = 0; i < hiddenColumns.size(); i++)
{
int[] region = (int[]) hiddenColumns.elementAt(i);
@@ -758,6 +764,7 @@ public class ColumnSelection
return false;
}
}
+ }
return true;
}
@@ -1016,7 +1023,9 @@ public class ColumnSelection
w += els.length;
}
if (w == 0)
+ {
return;
+ }
Enumeration e = annels.elements();
alignmentAnnotation.annotations = new Annotation[w];
w = 0;