From 3cd08a9d5d30d45c06b57f494441721979d82932 Mon Sep 17 00:00:00 2001 From: kjvdheide Date: Thu, 26 Oct 2017 15:46:08 +0100 Subject: [PATCH] Added full names to the tree algorithm enum --- src/jalview/analysis/TreeAlgorithm.java | 25 +++++++++++++++++++++---- src/jalview/gui/CalculationChooser.java | 6 ++++-- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/jalview/analysis/TreeAlgorithm.java b/src/jalview/analysis/TreeAlgorithm.java index 55175f2..7aaa913 100644 --- a/src/jalview/analysis/TreeAlgorithm.java +++ b/src/jalview/analysis/TreeAlgorithm.java @@ -2,13 +2,30 @@ package jalview.analysis; public enum TreeAlgorithm { - NEIGHBOUR_JOINING("NJ"), AVERAGE_DISTANCE("AV"), MAXIMUM_PARSIMONY("MP"), - MAXIMUM_LIKELIHOOD("ML"), BAYESIAN("BY"); + NEIGHBOUR_JOINING("NJ", "Neighbour Joining"), + AVERAGE_DISTANCE("AV", "Average Distance (UPGMA)"), + MAXIMUM_PARSIMONY("MP", ("Maximum Parsimony")), + MAXIMUM_LIKELIHOOD("ML", "Maximum Likelihood"), + BAYESIAN("BY", "Bayesian Inference"); private final String abbreviation; - TreeAlgorithm(String abbreviatedAlgorithm) + private final String name; + + TreeAlgorithm(String abbreviatedName, String fullName) + { + this.abbreviation = abbreviatedName; + this.name = fullName; + } + + public String getAbbreviation() { - this.abbreviation = abbreviatedAlgorithm; + return abbreviation; } + + public String getName() + { + return name; + } + } diff --git a/src/jalview/gui/CalculationChooser.java b/src/jalview/gui/CalculationChooser.java index 8b4c212..ebb12b9 100644 --- a/src/jalview/gui/CalculationChooser.java +++ b/src/jalview/gui/CalculationChooser.java @@ -483,11 +483,13 @@ public class CalculationChooser extends JPanel substitutionMatrix, params); TreeBuilder calculatedTree = treeCalculator .makeTree(af.getViewport()); - TreeModel tree = new TreeModel(calculatedTree); - openTreePanel(tree, treeAlgo, substitutionMatrix); ArchaeopteryxInit.createInstance(calculatedTree); + TreeModel tree = new TreeModel(calculatedTree); + openTreePanel(tree, treeAlgo, substitutionMatrix); + + } -- 1.7.10.2