X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FAlignViewport.java;h=d0a0f11e28a5cc9f93d5f54991a2c879ee08c816;hb=eed52865f3bf3e1d4d8c7f08fba483ecce6d83e6;hp=692cd18b2156671387b096322853087c9768a51f;hpb=8136b9b35478ec46e2f2064c32506b6bcdd85533;p=jalview.git diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 692cd18..d0a0f11 100644 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -18,24 +18,6 @@ * along with Jalview. If not, see . * The Jalview Authors are detailed in the 'AUTHORS' file. */ -/* - * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle - * - * This program 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 2 - * of the License, or (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ package jalview.gui; import jalview.analysis.AlignmentUtils; @@ -419,10 +401,11 @@ public class AlignViewport extends AlignmentViewport implements * @param align * DOCUMENT ME! */ + @Override public void setAlignment(AlignmentI align) { replaceMappings(align); - this.alignment = align; + super.setAlignment(align); } /** @@ -507,17 +490,6 @@ public class AlignViewport extends AlignmentViewport implements /** * DOCUMENT ME! * - * @return DOCUMENT ME! - */ - @Override - public ColumnSelection getColumnSelection() - { - return colSel; - } - - /** - * DOCUMENT ME! - * * @param tree * DOCUMENT ME! */ @@ -683,27 +655,44 @@ public class AlignViewport extends AlignmentViewport implements List seqvectors = new ArrayList(); for (PDBEntry pdb : pdbEntries) { - List seqs = new ArrayList(); + List choosenSeqs = new ArrayList(); for (SequenceI sq : alignment.getSequences()) { - Vector pdbs = sq.getDatasetSequence().getAllPDBEntries(); - if (pdbs == null) + Vector pdbRefEntries = sq.getDatasetSequence() + .getAllPDBEntries(); + if (pdbRefEntries == null) { continue; } - for (PDBEntry p1 : pdbs) + for (PDBEntry pdbRefEntry : pdbRefEntries) { - if (p1.getId().equals(pdb.getId())) + if (pdbRefEntry.getId().equals(pdb.getId())) { - if (!seqs.contains(sq)) + if (pdbRefEntry.getChainCode() != null + && pdb.getChainCode() != null) { - seqs.add(sq); - continue; + if (pdbRefEntry.getChainCode().equalsIgnoreCase( + pdb.getChainCode()) + && !choosenSeqs.contains(sq)) + { + choosenSeqs.add(sq); + continue; + } } + else + { + if (!choosenSeqs.contains(sq)) + { + choosenSeqs.add(sq); + continue; + } + } + } } } - seqvectors.add(seqs.toArray(new SequenceI[seqs.size()])); + seqvectors + .add(choosenSeqs.toArray(new SequenceI[choosenSeqs.size()])); } return seqvectors.toArray(new SequenceI[seqvectors.size()][]); } @@ -1103,6 +1092,7 @@ public class AlignViewport extends AlignmentViewport implements * * @param featureSettings */ + @Override public void applyFeaturesStyle(FeatureSettingsModelI featureSettings) { if (featureSettings == null)