/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
package jalview.appletgui;
import jalview.analysis.NJTree;
+import jalview.api.analysis.ScoreModelI;
+import jalview.api.analysis.ViewBasedAnalysisI;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentView;
-import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.HiddenColumns;
import jalview.datamodel.SequenceI;
import jalview.io.NewickFile;
+import jalview.schemes.ResidueProperties;
import jalview.util.MessageManager;
import java.awt.BorderLayout;
return tree;
}
+ @Override
public void finalize() throws Throwable
{
ap = null;
}
;
Object[] alAndColsel = tree.seqData
- .getAlignmentAndColumnSelection(gc);
+ .getAlignmentAndHiddenColumns(gc);
if (alAndColsel != null && alAndColsel[0] != null)
{
AlignFrame af = new AlignFrame(al, av.applet,
"Original Data for Tree", false);
- af.viewport.setHiddenColumns((ColumnSelection) alAndColsel[1]);
+ af.viewport.getAlignment().setHiddenColumns(
+ (HiddenColumns) alAndColsel[1]);
}
}
else
this.newtree = newtree;
}
+ @Override
public void run()
{
if (newtree != null)
{
int start, end;
SequenceI[] seqs;
- boolean selview = (av.getSelectionGroup() != null)
- && (av.getSelectionGroup().getSize() > 1);
+ boolean selview = av.getSelectionGroup() != null
+ && av.getSelectionGroup().getSize() > 1;
AlignmentView seqStrings = av.getAlignmentView(selview);
if (!selview)
{
seqs = av.getSelectionGroup().getSequencesInOrder(
av.getAlignment());
}
-
- tree = new NJTree(seqs, seqStrings, type, pwtype, start, end);
+ ScoreModelI sm = ResidueProperties.getScoreModel(pwtype);
+ if (sm instanceof ViewBasedAnalysisI)
+ {
+ try
+ {
+ sm = sm.getClass().newInstance();
+ ((ViewBasedAnalysisI) sm)
+ .configureFromAlignmentView(treeCanvas.ap);
+ } catch (Exception q)
+ {
+ System.err.println("Couldn't create a scoremodel instance for "
+ + sm.getName());
+ q.printStackTrace();
+ }
+ tree = new NJTree(seqs, seqStrings, type, pwtype, sm, start, end);
+ }
+ else
+ {
+ tree = new NJTree(seqs, seqStrings, type, pwtype, null, start,
+ end);
+ }
}
tree.reCount(tree.getTopNode());
}
}
+ @Override
public void actionPerformed(ActionEvent evt)
{
if (evt.getSource() == newickOutput)
}
}
+ @Override
public void itemStateChanged(ItemEvent evt)
{
if (evt.getSource() == fitToWindow)