MainFrame aptxApp = Archaeopteryx.createApplication(aptxTree,
APTX_CONFIG, treeTitle);
- adaptAptxGui(aptxApp);
+
LoadedTreeSequenceAssociation bindAptxNodes = new LoadedTreeSequenceAssociation(
jalviewAlignport.getAlignment().getSequencesArray(), aptxTree);
bindAptxNodes.associateLeavesToSequences();
bindAptxNodes.getNodesWithAlignment());
bindTreeViewFrameToJalview(aptxApp);
+ adaptAptxGui(aptxApp);
return aptxApp;
}
{
menu.addSeparator();
JMenuItem sortByTree = new JMenuItem("Sort alignment by tree");
+ JMenuItem refreshJalview = new JMenuItem(
+ "Filter alignment to show only currently visible sequences");
+
+ refreshJalview.setFont(menu.getFont());
+
menu.add(sortByTree);
+ menu.add(refreshJalview);
+
+ sortByTree.setFont(menu.getFont());
sortByTree.setVisible(false); // don't show unless it's actually
- // possible
+ // possible
+
+ refreshJalview.addActionListener(activeAptx.get(aptxFrame));
+
+
}
}
@Override
public void actionPerformed(ActionEvent e)
{
- // aptxFrame.actionPerformed(e);
+ if (treeView.isCurrentTreeIsSubtree())
+ {
+ LoadedTreeSequenceAssociation bindAptxNodes = new LoadedTreeSequenceAssociation(
+ parentAvport.getAlignment().getSequencesArray(),
+ treeView.getPhylogeny());
+ bindAptxNodes.associateLeavesToSequences();
+ sequencesBoundToNodes = bindAptxNodes.getAlignmentWithNodes();
+ nodesBoundToSequences = bindAptxNodes.getNodesWithAlignment();
+ AptxInit.bindNodesToJalviewSequences(aptxFrame, parentAvport,
+ sequencesBoundToNodes, nodesBoundToSequences);
+
+
+ for (SequenceI seq : parentAvport.getAlignment().getSequencesArray())
+ {
+ if (!sequencesBoundToNodes.containsKey(seq))
+ {
+ parentAvport.hideSequence(new SequenceI[] { seq });
+ }
+ }
+ }
+
+
}
*/
public void run()
{
+
+
final PhylogenyNode node = treeView.findNode(e.getX(), e.getY());
if (node != null)
{
}
showNodeSelectionOnAlign(node);
+
}
else
{
-
partitionTree(e.getX());
+
}
PaintRefresher.Refresh(treeView, parentAvport.getSequenceSetId());
treeView.repaint();
furthestNodeX = furthestNode.getXcoord();
rootX = tree.getRoot().getXcoord();
+
// don't bother if 0 distance tree or clicked x lies outside of tree
if (furthestNodeX != rootX && !(x > furthestNodeX))
{
public class LoadedTreeSequenceAssociation
implements ExternalLoadedTreeAssociationI
{
- SequenceI[] alignSequences;
+ private SequenceI[] alignSequences;
- Phylogeny tree;
+ private Phylogeny tree;
- Map<SequenceI, PhylogenyNode> alignmentWithNodes;
+ private Map<SequenceI, PhylogenyNode> alignmentWithNodes;
- Map<PhylogenyNode, SequenceI> nodesWithAlignment;
+ private Map<PhylogenyNode, SequenceI> nodesWithAlignment;
public LoadedTreeSequenceAssociation(SequenceI[] alignmentSequences,
Phylogeny aptxTree)