From: kjvdheide Date: Wed, 29 Nov 2017 02:28:54 +0000 (+0000) Subject: JAL-2844 added colouring to partition selection X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b11fa95af04b94eeefee1786d2973a0e930fec1c;p=jalview.git JAL-2844 added colouring to partition selection --- diff --git a/forester b/forester index de67a09..b8121ed 160000 --- a/forester +++ b/forester @@ -1 +1 @@ -Subproject commit de67a099c57ee0483368de2880771cc1b755db65 +Subproject commit b8121ed04b4ec52eeb0361dd7417717a4c455d25 diff --git a/src/jalview/ext/archaeopteryx/AptxInit.java b/src/jalview/ext/archaeopteryx/AptxInit.java index 732e85a..9f2817e 100644 --- a/src/jalview/ext/archaeopteryx/AptxInit.java +++ b/src/jalview/ext/archaeopteryx/AptxInit.java @@ -472,6 +472,8 @@ public final class AptxInit MainFrame aptxApp = Archaeopteryx.createApplication(aptxTree, APTX_CONFIG, treeTitle); // addPartitioningSlider(aptxApp); + + LoadedTreeAssociation bindAptxNodes = new LoadedTreeAssociation( jalviewAlignport.getAlignment().getSequencesArray(), aptxTree); diff --git a/src/jalview/ext/archaeopteryx/JalviewBinding.java b/src/jalview/ext/archaeopteryx/JalviewBinding.java index 07d45c5..0e77243 100644 --- a/src/jalview/ext/archaeopteryx/JalviewBinding.java +++ b/src/jalview/ext/archaeopteryx/JalviewBinding.java @@ -13,6 +13,7 @@ import jalview.structure.StructureSelectionManager; import jalview.util.MessageManager; import jalview.viewmodel.AlignmentViewport; +import java.awt.Color; import java.awt.Graphics; import java.awt.event.ActionEvent; import java.awt.event.InputEvent; @@ -29,9 +30,11 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import org.forester.archaeopteryx.MainFrame; +import org.forester.archaeopteryx.TreePanelUtil; import org.forester.phylogeny.Phylogeny; import org.forester.phylogeny.PhylogenyMethods; import org.forester.phylogeny.PhylogenyNode; +import org.forester.phylogeny.data.BranchColor; /** * Class for binding the Archaeopteryx tree viewer to the Jalview alignment that @@ -241,16 +244,19 @@ public final class JalviewBinding // // System.out.println(relativeTreeWidth); - float xRoot = tree.getRoot().getXcoord(); - double threshold = ((double) x - xRoot) / longestBranch; - System.out.println(threshold); + float rootX = tree.getRoot().getXcoord(); + double threshold = ((double) x - rootX) / longestBranch; List foundNodes = getNodesAboveThreshold(threshold, longestBranch, tree.getRoot()); for (PhylogenyNode foundNode : foundNodes) { - System.out.println(foundNode); + Color randomColor = new Color((int) (Math.random() * 255), + (int) (Math.random() * 255), (int) (Math.random() * 255)); + TreePanelUtil.colorizeSubtree(foundNode, + new BranchColor(randomColor)); } + // groupNodes(threshold, tree.getRoot(), longestBranch); @@ -284,7 +290,7 @@ public final class JalviewBinding if (nodeCutoff > threshold) { - nodeList.add(node); + nodeList.add(childNode); } else