X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fdatamodel%2FAlignmentView.java;h=a23aad5e837e04ad8d4e19a8feacadb76b2aba0b;hb=27d1490bba5753b3f9c8fac0647cfe8148c53310;hp=21b5e7f26963750eadc951a5ac7b8ec52965ec21;hpb=1f5616e7db919162a5cc3b25b09ccf95845f03ee;p=jalview.git diff --git a/src/jalview/datamodel/AlignmentView.java b/src/jalview/datamodel/AlignmentView.java index 21b5e7f..a23aad5 100644 --- a/src/jalview/datamodel/AlignmentView.java +++ b/src/jalview/datamodel/AlignmentView.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6) - * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7) + * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle * * This file is part of Jalview. * @@ -21,6 +21,7 @@ import jalview.util.ShiftList; import java.io.PrintStream; import java.util.Enumeration; +import java.util.List; import java.util.Vector; /** @@ -105,9 +106,9 @@ public class AlignmentView SequenceI[] selseqs; if (selection != null) { - Vector sel = selection.getSequences(null); + List sel = selection.getSequences(null); this.selected = new Vector(); - selseqs = selection.getSequencesInOrder(alignment, false); + selseqs = selection.getSequencesInOrder(alignment, selectedRegionOnly); } else { @@ -116,12 +117,8 @@ public class AlignmentView // get the alignment's group list and make a copy Vector grps = new Vector(); - Vector gg = alignment.getGroups(); - Enumeration gge = gg.elements(); - while (gge.hasMoreElements()) - { - grps.addElement(gge.nextElement()); - } + List gg = alignment.getGroups(); + grps.addAll(gg); ScGroup[] sgrps = null; boolean addedgps[] = null; if (grps != null) @@ -351,9 +348,14 @@ public class AlignmentView continue; } } + + // clone group properties + nsg[g] = new SequenceGroup(sg); + // may need to shift/trim start and end ? if (r && !viscontigs) { + // Not fully tested code - routine not yet called with viscontigs==false if (nsg[g].getStartRes() < gstart) { nsg[g].setStartRes(0); @@ -363,14 +365,11 @@ public class AlignmentView nsg[g].setStartRes(nsg[g].getStartRes() - gstart); nsg[g].setEndRes(nsg[g].getEndRes() - gstart); } - if (nsg[g].getEndRes() > gend) + if (nsg[g].getEndRes() > (gend-gstart)) { - nsg[g].setEndRes(gend); + nsg[g].setEndRes(gend-gstart); } } - - // clone group properties - nsg[g] = new SequenceGroup(sg); } if (viscontigs) { @@ -1045,12 +1044,10 @@ public class AlignmentView + " wide and has " + visal.getHeight() + " seqs."); if (visal.getGroups() != null && visal.getGroups().size() > 0) { - SequenceGroup sg; - Enumeration en = visal.getGroups().elements(); + int i = 1; - while (en.hasMoreElements()) + for (SequenceGroup sg:visal.getGroups()) { - sg = (SequenceGroup) en.nextElement(); os.println("Group " + (i++) + " begins at column " + sg.getStartRes() + " and ends at " + sg.getEndRes()); }