From 7f0c664bf9b089007ae9c39a6798a815426aa978 Mon Sep 17 00:00:00 2001 From: kjvdheide Date: Mon, 13 Nov 2017 20:19:43 +0000 Subject: [PATCH] JAL-2805 interface comments --- .../archaeopteryx/ArchaeopteryxTreeBuilder.java | 20 ++++++++++++-------- .../ExternalLoadedTreeAssociationI.java | 1 + .../ext/archaeopteryx/ExternalTreeBuilderI.java | 9 +++++++++ .../archaeopteryx/ExternalTreeViewerBindingI.java | 3 +++ .../ext/forester/io/ExternalTreeParserI.java | 7 +++++++ 5 files changed, 32 insertions(+), 8 deletions(-) diff --git a/src/jalview/ext/archaeopteryx/ArchaeopteryxTreeBuilder.java b/src/jalview/ext/archaeopteryx/ArchaeopteryxTreeBuilder.java index af270c2..9166497 100644 --- a/src/jalview/ext/archaeopteryx/ArchaeopteryxTreeBuilder.java +++ b/src/jalview/ext/archaeopteryx/ArchaeopteryxTreeBuilder.java @@ -40,9 +40,9 @@ public class ArchaeopteryxTreeBuilder private PhylogenyNode rootNode; - private final Map alignmentBoundNodes; + private final Map alignmentWithNodes; - private final Map nodesBoundAlignment; + private final Map nodesWithAlignment; public ArchaeopteryxTreeBuilder(final TreeBuilder calculatedTree) { @@ -50,10 +50,13 @@ public class ArchaeopteryxTreeBuilder sequences = jalviewTree.getSequences(); distances = ForesterMatrix.convertJalviewToForester( jalviewTree.getDistances(), sequences); + aptxTree = new Phylogeny(); rootNode = new PhylogenyNode(); - alignmentBoundNodes = new HashMap<>(distances.getSize()); - nodesBoundAlignment = new HashMap<>(distances.getSize()); + + int amountOfSequences = distances.getSize(); + alignmentWithNodes = new HashMap<>(amountOfSequences); + nodesWithAlignment = new HashMap<>(amountOfSequences); } @@ -83,11 +86,12 @@ public class ArchaeopteryxTreeBuilder Sequence seq = ForesterDataConversions .createForesterSequence(sequence, true); PhylogenyNode sequenceNode = new PhylogenyNode(sequence.getName()); + NodeData nodeData = sequenceNode.getNodeData(); nodeData.setSequence(seq); - nodesBoundAlignment.put(sequenceNode, sequence); - alignmentBoundNodes.put(sequence, sequenceNode); + nodesWithAlignment.put(sequenceNode, sequence); + alignmentWithNodes.put(sequence, sequenceNode); rootNode.addAsChild(sequenceNode); } @@ -104,13 +108,13 @@ public class ArchaeopteryxTreeBuilder @Override public Map getAlignmentBoundNodes() { - return alignmentBoundNodes; + return alignmentWithNodes; } @Override public Map getNodesBoundAlignment() { - return nodesBoundAlignment; + return nodesWithAlignment; } private Phylogeny clusterNodes() diff --git a/src/jalview/ext/archaeopteryx/ExternalLoadedTreeAssociationI.java b/src/jalview/ext/archaeopteryx/ExternalLoadedTreeAssociationI.java index 9c84527..08a0cdc 100644 --- a/src/jalview/ext/archaeopteryx/ExternalLoadedTreeAssociationI.java +++ b/src/jalview/ext/archaeopteryx/ExternalLoadedTreeAssociationI.java @@ -8,6 +8,7 @@ import jalview.datamodel.SequenceI; * @author kjvanderheide * * @param + * Tree object. */ interface ExternalLoadedTreeAssociationI { diff --git a/src/jalview/ext/archaeopteryx/ExternalTreeBuilderI.java b/src/jalview/ext/archaeopteryx/ExternalTreeBuilderI.java index f27117d..8f10e73 100644 --- a/src/jalview/ext/archaeopteryx/ExternalTreeBuilderI.java +++ b/src/jalview/ext/archaeopteryx/ExternalTreeBuilderI.java @@ -4,6 +4,15 @@ import jalview.datamodel.SequenceI; import java.util.Map; +/** + * + * @author kjvanderheide + * + * @param + * Tree object that the tree viewer requires. + * @param + * Tree node object that the tree viewer requires. + */ interface ExternalTreeBuilderI { public T buildTree(N treeRoot); diff --git a/src/jalview/ext/archaeopteryx/ExternalTreeViewerBindingI.java b/src/jalview/ext/archaeopteryx/ExternalTreeViewerBindingI.java index 2bef9d6..c9f5820 100644 --- a/src/jalview/ext/archaeopteryx/ExternalTreeViewerBindingI.java +++ b/src/jalview/ext/archaeopteryx/ExternalTreeViewerBindingI.java @@ -29,11 +29,14 @@ import java.awt.event.MouseEvent; import java.awt.event.MouseListener; /** + * * Interface for binding a tree viewer to Jalview alignments. Assumes a tree * viewer will both want to receive and send selection events. * * @author kjvanderheide * + * @param + * Tree node object. */ interface ExternalTreeViewerBindingI extends ActionListener, MouseListener, SelectionListener, diff --git a/src/jalview/ext/forester/io/ExternalTreeParserI.java b/src/jalview/ext/forester/io/ExternalTreeParserI.java index 9095a0f..2c26623 100644 --- a/src/jalview/ext/forester/io/ExternalTreeParserI.java +++ b/src/jalview/ext/forester/io/ExternalTreeParserI.java @@ -2,6 +2,13 @@ package jalview.ext.forester.io; import javax.swing.JInternalFrame; +/** + * + * @author kjvanderheide + * + * @param + * Frame containing the tree viewer. + */ public interface ExternalTreeParserI { public F loadTree(); -- 1.7.10.2