* along with Jalview. If not, see <http://www.gnu.org/licenses/>.
* 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;
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
import jalview.api.FeatureColourI;
-import jalview.api.FeatureSettingsI;
+import jalview.api.FeatureSettingsModelI;
import jalview.api.FeaturesDisplayedI;
import jalview.api.ViewStyleI;
import jalview.bin.Cache;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
-import java.util.Map;
import java.util.Vector;
import javax.swing.JInternalFrame;
* @param align
* DOCUMENT ME!
*/
+ @Override
public void setAlignment(AlignmentI align)
{
replaceMappings(align);
- this.alignment = align;
+ super.setAlignment(align);
}
/**
/**
* DOCUMENT ME!
*
- * @return DOCUMENT ME!
- */
- @Override
- public ColumnSelection getColumnSelection()
- {
- return colSel;
- }
-
- /**
- * DOCUMENT ME!
- *
* @param tree
* DOCUMENT ME!
*/
}
/**
- * synthesize a column selection if none exists so it covers the given
- * selection group. if wholewidth is false, no column selection is made if the
- * selection group covers the whole alignment width.
- *
- * @param sg
- * @param wholewidth
- */
- public void expandColSelection(SequenceGroup sg, boolean wholewidth)
- {
- int sgs, sge;
- if (sg != null
- && (sgs = sg.getStartRes()) >= 0
- && sg.getStartRes() <= (sge = sg.getEndRes())
- && (colSel == null || colSel.getSelected() == null || colSel
- .getSelected().size() == 0))
- {
- if (!wholewidth && alignment.getWidth() == (1 + sge - sgs))
- {
- // do nothing
- return;
- }
- if (colSel == null)
- {
- colSel = new ColumnSelection();
- }
- for (int cspos = sg.getStartRes(); cspos <= sg.getEndRes(); cspos++)
- {
- colSel.addElement(cspos);
- }
- }
- }
-
- /**
* Returns the (Desktop) instance of the StructureSelectionManager
*/
@Override
List<SequenceI[]> seqvectors = new ArrayList<SequenceI[]>();
for (PDBEntry pdb : pdbEntries)
{
- List<SequenceI> seqs = new ArrayList<SequenceI>();
+ List<SequenceI> choosenSeqs = new ArrayList<SequenceI>();
for (SequenceI sq : alignment.getSequences())
{
- Vector<PDBEntry> pdbs = sq.getDatasetSequence().getAllPDBEntries();
- if (pdbs == null)
+ Vector<PDBEntry> 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()][]);
}
*
* @param featureSettings
*/
- public void applyFeaturesStyle(FeatureSettingsI featureSettings)
+ @Override
+ public void applyFeaturesStyle(FeatureSettingsModelI featureSettings)
{
if (featureSettings == null)
{
FeatureRenderer fr = getAlignPanel().getSeqPanel().seqCanvas
.getFeatureRenderer();
- Map<String, Object> featureColours = fr.getFeatureColours();
fr.findAllFeatures(true);
List<String> renderOrder = fr.getRenderOrder();
FeaturesDisplayedI displayed = fr.getFeaturesDisplayed();