import jalview.analysis.scoremodels.ScoreModels;
import jalview.analysis.scoremodels.SimilarityParams;
import jalview.api.analysis.ScoreModelI;
-import jalview.api.analysis.ViewBasedAnalysisI;
-import jalview.bin.Cache;
import jalview.datamodel.Alignment;
import jalview.datamodel.ColumnSelection;
import jalview.datamodel.SequenceI;
/**
* Creates a new TreePanel object.
- *
- * @param av
- * DOCUMENT ME!
- * @param seqVector
- * DOCUMENT ME!
- * @param type
- * DOCUMENT ME!
- * @param pwtype
- * DOCUMENT ME!
- * @param s
- * DOCUMENT ME!
- * @param e
- * DOCUMENT ME!
*/
- public TreePanel(AlignmentPanel ap, String type, String pwtype)
+ public TreePanel(AlignmentPanel alignPanel, String type, String pwtype)
{
try
{
ex.printStackTrace();
}
- initTreePanel(ap, type, pwtype, null);
+ initTreePanel(alignPanel, type, pwtype, null);
}
/**
* Creates a new TreePanel object.
*
- * @param av
- * DOCUMENT ME!
- * @param seqVector
- * DOCUMENT ME!
- * @param newtree
- * DOCUMENT ME!
- * @param type
- * DOCUMENT ME!
- * @param pwtype
- * DOCUMENT ME!
*/
public TreePanel(AlignmentPanel ap, String type, String pwtype,
NewickFile newtree)
}
else
{
- ScoreModelI sm = configureScoreModel(pwtype);
+ ScoreModelI sm1 = ScoreModels.getInstance().getScoreModel(pwtype,
+ treeCanvas.ap);
+ ScoreModelI sm = sm1;
TreeBuilder njtree = type.equals(TreeBuilder.NEIGHBOUR_JOINING) ? new NJTree(
av, sm, SimilarityParams.Jalview)
: new AverageDistanceTree(av, sm, SimilarityParams.Jalview);
inputData.addActionListener(this);
}
- /**
- * Gets the score model for the given name. If the score model is one that
- * requires to get state data from the current view, allow it to do so
- *
- * @param sm
- * @return
- */
- protected ScoreModelI configureScoreModel(String modelName)
- {
- ScoreModelI sm = ScoreModels.getInstance().forName(modelName);
- if (sm instanceof ViewBasedAnalysisI)
- {
- try
- {
- sm = sm.getClass().newInstance();
- ((ViewBasedAnalysisI) sm).configureFromAlignmentView(treeCanvas.ap);
- } catch (Exception q)
- {
- Cache.log.error("Couldn't create a scoremodel instance for "
- + sm.getName());
- }
- }
- return sm;
- }
-
}