From: kjvdheide Date: Thu, 26 Oct 2017 15:12:04 +0000 (+0100) Subject: Added TreeBuilder as parameter to the converter constructor X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=22cc40b671171d958839a9455cba4e6cbe1bae1f;p=jalview.git Added TreeBuilder as parameter to the converter constructor --- diff --git a/src/jalview/ext/archaeopteryx/ArchaeopteryxInit.java b/src/jalview/ext/archaeopteryx/ArchaeopteryxInit.java index 7ca870c..3bd9d19 100644 --- a/src/jalview/ext/archaeopteryx/ArchaeopteryxInit.java +++ b/src/jalview/ext/archaeopteryx/ArchaeopteryxInit.java @@ -28,8 +28,9 @@ public final class ArchaeopteryxInit public static MainFrame createInstance( TreeBuilder calculatedTree) { - ArchaeopteryxTreeBuilder aptxTreeBuilder = new ArchaeopteryxTreeBuilder(); - Phylogeny aptxTree = aptxTreeBuilder.buildAptxTree(calculatedTree); + ArchaeopteryxTreeConverter aptxTreeBuilder = new ArchaeopteryxTreeConverter( + calculatedTree); + Phylogeny aptxTree = aptxTreeBuilder.buildAptxTree(); Phylogeny[] aptxTrees = { aptxTree }; // future possibility to load in // several trees simultaneously diff --git a/src/jalview/ext/archaeopteryx/ArchaeopteryxTreeConverter.java b/src/jalview/ext/archaeopteryx/ArchaeopteryxTreeConverter.java index e159763..780acee 100644 --- a/src/jalview/ext/archaeopteryx/ArchaeopteryxTreeConverter.java +++ b/src/jalview/ext/archaeopteryx/ArchaeopteryxTreeConverter.java @@ -7,11 +7,7 @@ import jalview.math.MatrixI; import org.forester.phylogeny.Phylogeny; import org.forester.phylogeny.PhylogenyNode; -public class ArchaeopteryxTreeBuilder // cannot inherit - // TreeBuilder as that - // demands the use of - // SequenceNode (instead - // of PhylogenyNode) +public class ArchaeopteryxTreeConverter { protected SequenceI[] sequences; @@ -26,27 +22,29 @@ public class ArchaeopteryxTreeBuilder // cannot inherit } - public ArchaeopteryxTreeBuilder() + public ArchaeopteryxTreeConverter(TreeBuilder calculatedTree) { + this.sequences = calculatedTree.getSequences(); + this.distances = calculatedTree.getDistances(); this.rootNode = new PhylogenyNode(); this.rootNode.setName("root"); } - public ArchaeopteryxTreeBuilder(PhylogenyNode treeRoot) + public ArchaeopteryxTreeConverter(PhylogenyNode treeRoot, + TreeBuilder calculatedTree) { - + this(calculatedTree); this.rootNode = treeRoot; } - public Phylogeny buildAptxTree(TreeBuilder tree) + public Phylogeny buildAptxTree() { - this.sequences = tree.getSequences(); - this.distances = tree.getDistances(); - aptxTree.setName( + + this.aptxTree.setName( "PLEASE FIX ME reheaheth35yheqhb3q5hyq3bt3q5u4jwqjwuh6"); // final NeighborJoiningF nj = NeighborJoiningF.createInstance(false, 5);