X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FGrouping.java;h=32ea204b73d39b539c0ecdae9aa2e6d3bf125f85;hb=e498cc04385671872ab98220219aaeac2ec245f2;hp=2cb4753bc0368392fa2bb7b554bc650cc4856955;hpb=153dd62dc91da13ae732600e6ea55ddbe15eab39;p=jalview.git diff --git a/src/jalview/analysis/Grouping.java b/src/jalview/analysis/Grouping.java index 2cb4753..32ea204 100644 --- a/src/jalview/analysis/Grouping.java +++ b/src/jalview/analysis/Grouping.java @@ -1,13 +1,13 @@ /* - * 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.8) + * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle * * This file is part of Jalview. * * 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. - * + * * 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 @@ -17,13 +17,11 @@ */ package jalview.analysis; -import jalview.datamodel.AlignmentI; -import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; -import java.util.Enumeration; import java.util.Hashtable; +import java.util.List; import java.util.Vector; /** @@ -42,25 +40,24 @@ public class Grouping * * @param sequences * @param selectedChars - * @param exgroups + * @param list * @return */ public static SequenceGroup[] makeGroupsFrom(SequenceI[] sequences, - String[] selectedChars, Vector exgroups) + String[] selectedChars, List list) { // TODO: determine how to get/recover input data for group generation Hashtable gps = new Hashtable(); int width = 0, i; Hashtable pgroup = new Hashtable(); - if (exgroups != null) + if (list != null) { - SequenceGroup sg; - for (Enumeration g = exgroups.elements(); g.hasMoreElements();) + for (SequenceGroup sg : list) { - sg = (SequenceGroup) g.nextElement(); - for (Enumeration sq = sg.getSequences(null).elements(); sq - .hasMoreElements();) - pgroup.put(sq.nextElement().toString(), sg); + for (SequenceI sq : sg.getSequences(null)) + { + pgroup.put(sq.toString(), sg); + } } } for (i = 0; i < sequences.length; i++)