click_to: get_ext_descendents_data display
# Default click-to option (any of the above if set to "display")
--default_click_to: display_node_data
++default_click_to: select_nodes
display_color: node_box 0x000000
display_color: collapsed 0x000000
display_color: matching_a 0xCC6600
--display_color: matching_b 0x0000CC
--display_color: matching_a_and_b 0xCC70CC
++display_color: matching_b 0xCC70CC
++display_color: matching_a_and_b 0x0000CC
display_color: duplication 0xFF00FF
display_color: speciation 0xFFFF00
display_color: duplication_or_specation 0xFFAA20
--Subproject commit b977efb66f2d0b539bd433e80762737925035edc
++Subproject commit eb22dac14771c467104f57362e3a624d0140f897
--- /dev/null
--- /dev/null
++package jalview.ext.archaeopteryx;
++
++import jalview.ext.treeviewer.ExternalTreeViewerI;
++
++import org.forester.archaeopteryx.MainFrame;
++
++public class Aptx implements ExternalTreeViewerI
++{
++ private final MainFrame aptxApp;
++
++ public Aptx(MainFrame aptx)
++ {
++ aptxApp = aptx;
++
++
++ }
++}
* @author kjvanderheide
*
*/
--public final class ArchaeopteryxInit
++public final class AptxInit
{
/**
* Test method, should generally not be used as it does not bind the tree to
public static MainFrame createInstance(
final TreeBuilder calculatedTree) // very dense method, to be split up
{
-- ExternalTreeBuilderI<Phylogeny, PhylogenyNode> aptxTreeBuilder = new ArchaeopteryxTreeBuilder(
++ ExternalTreeBuilderI<Phylogeny, PhylogenyNode> aptxTreeBuilder = new AptxTreeBuilder(
calculatedTree);
Phylogeny aptxTree = aptxTreeBuilder.buildTree();
int width = 400;
int height = 550;
aptxApp.setMinimumSize(new Dimension(width, height));
++ // aptxApp.setFont(Desktop.instance.getFont());
++ // aptxApp.getMainPanel().setFont(Desktop.instance.getFont());
Desktop.addInternalFrame(aptxApp, "Archaeopteryx Tree View", true,
width, height, true, true);
* @author kjvanderheide
*
*/
--public class ArchaeopteryxTreeBuilder
++public class AptxTreeBuilder
implements ExternalTreeBuilderI<Phylogeny, PhylogenyNode>
{
protected final SequenceI[] sequences;
private final Map<PhylogenyNode, SequenceI> nodesWithAlignment;
-- public ArchaeopteryxTreeBuilder(final TreeBuilder calculatedTree)
++ public AptxTreeBuilder(final TreeBuilder calculatedTree)
{
jalviewTree = calculatedTree;
sequences = jalviewTree.getSequences();
--- /dev/null
--- /dev/null
++package jalview.ext.archaeopteryx;
++
++import jalview.ext.treeviewer.ExternalTreePanelI;
++
++public class AptxTreePanel implements ExternalTreePanelI
++{
++ private final org.forester.archaeopteryx.TreePanel treeView;
++
++ public AptxTreePanel(org.forester.archaeopteryx.TreePanel aptxTreePanel)
++ {
++ treeView = aptxTreePanel;
++
++ }
++}
@Override
public void showMatchingChildSequences(final PhylogenyNode parentNode)
{
-- final List<PhylogenyNode> childNodes = PhylogenyMethods
++ List<PhylogenyNode> childNodes = PhylogenyMethods
.getAllDescendants(parentNode);
for (PhylogenyNode childNode : childNodes)
{
++
SequenceI matchingSequence = nodesBoundToSequences.get(childNode);
if (matchingSequence != null)
{
{
this.parentAvport = parentAvport;
}
--
+ // av.setCurrentTree(tree);
+ //
+ // /*
+ // * isPopupTrigger is set for mousePressed (Mac)
+ // * or mouseReleased (Windows)
+ // */
+ // if (e.isPopupTrigger())
+ // {
+ // if (highlightNode != null)
+ // {
+ // chooseSubtreeColour();
+ // }
+ // return;
+ // }
+ //
+ // /*
+ // * defer right-click handling on Windows to
+ // * mouseClicked; note isRightMouseButton
+ // * also matches Cmd-click on Mac which should do
+ // * nothing here
+ // */
+ // if (SwingUtilities.isRightMouseButton(e))
+ // {
+ // return;
+ // }
+ //
+ // int x = e.getX();
+ // int y = e.getY();
+ //
+ // Object ob = findElement(x, y);
+ //
+ // if (ob instanceof SequenceI)
+ // {
+ // treeSelectionChanged((Sequence) ob);
+ // PaintRefresher.Refresh(tp, ap.av.getSequenceSetId());
+ // repaint();
+ // av.sendSelection();
+ // return;
+ // }
+ // else if (!(ob instanceof SequenceNode))
+ // {
+ // // Find threshold
+ // if (tree.getMaxHeight() != 0)
+ // {
+ // threshold = (float) (x - offx)
+ // / (float) (getWidth() - labelLength - (2 * offx));
+ //
+ // List<SequenceNode> groups = tree.groupNodes(threshold);
+ // setColor(tree.getTopNode(), Color.black);
+ //
+ // AlignmentPanel[] aps = getAssociatedPanels();
+ //
+ // // TODO push calls below into a single AlignViewportI method?
+ // // see also AlignViewController.deleteGroups
+ // for (int a = 0; a < aps.length; a++)
+ // {
+ // aps[a].av.setSelectionGroup(null);
+ // aps[a].av.getAlignment().deleteAllGroups();
+ // aps[a].av.clearSequenceColours();
+ // if (aps[a].av.getCodingComplement() != null)
+ // {
+ // aps[a].av.getCodingComplement().setSelectionGroup(null);
+ // aps[a].av.getCodingComplement().getAlignment()
+ // .deleteAllGroups();
+ // aps[a].av.getCodingComplement().clearSequenceColours();
+ // }
+ // }
+ // colourGroups(groups);
+ // }
+ //
+ // PaintRefresher.Refresh(tp, ap.av.getSequenceSetId());
+ // repaint();
+ // }
-
}
}
++
++
public Map<SequenceI, PhylogenyNode> getAlignmentWithNodes()
{
return alignmentWithNodes;
package jalview.ext.forester.io;
-import jalview.ext.archaeopteryx.AptxBinding;
-import jalview.ext.archaeopteryx.AptxNodeAssociation;
-import jalview.ext.archaeopteryx.ArchaeopteryxInit;
++import jalview.ext.archaeopteryx.AptxInit;
+import jalview.ext.archaeopteryx.JalviewBinding;
+import jalview.ext.archaeopteryx.LoadedTreeAssociation;
- import jalview.ext.archaeopteryx.ArchaeopteryxInit;
+import jalview.ext.treeviewer.ExternalTreeParserI;
import jalview.gui.Desktop;
import jalview.gui.JvOptionPane;
import jalview.util.MessageManager;
aptx.getMainPanel().getCurrentTreePanel().getPhylogeny());
bindAptxNodes.associateLeavesToSequences();
- new AptxBinding(aptx, viewport, bindAptxNodes.getAlignmentWithNodes(),
++
+ new JalviewBinding(aptx, viewport, bindAptxNodes.getAlignmentWithNodes(),
bindAptxNodes.getNodesWithAlignment());
-- ArchaeopteryxInit.bindFrameToJalview(aptx);
++ AptxInit.bindFrameToJalview(aptx);
return aptx;
--- /dev/null
--- /dev/null
++package jalview.ext.treeviewer;
++
++public interface ExternalTreeViewerI
++{
++
++}
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
- import jalview.ext.forester.io.TreeParser;
-import jalview.ext.forester.io.ExternalTreeParserI;
-import jalview.ext.forester.io.ForesterTreeParser;
import jalview.ext.forester.io.SupportedTreeFileFilter;
++import jalview.ext.forester.io.TreeParser;
+import jalview.ext.treeviewer.ExternalTreeParserI;
import jalview.gui.ColourMenuHelper.ColourChangeListener;
import jalview.gui.ViewSelectionMenu.ViewSetProvider;
import jalview.io.AlignmentProperties;
NewickFile fin = null;
try
{
- ExternalTreeParserI<?> treeParser = new ForesterTreeParser(
+ ExternalTreeParserI<?> treeParser = new TreeParser(
filePath);
- treeParser.loadTree(viewport);
+ treeParser.loadTreeFile(viewport);
import jalview.api.analysis.ScoreModelI;
import jalview.api.analysis.SimilarityParamsI;
import jalview.datamodel.SequenceGroup;
--import jalview.ext.archaeopteryx.ArchaeopteryxInit;
++import jalview.ext.archaeopteryx.AptxInit;
import jalview.util.MessageManager;
import java.awt.BorderLayout;
substitutionMatrix, params);
TreeBuilder calculatedTree = treeCalculator.makeTree(af.getViewport());
-- ArchaeopteryxInit.createInstance(calculatedTree);
++ AptxInit.createInstance(calculatedTree);
TreeModel tree = new TreeModel(calculatedTree);
openTreePanel(tree, treeAlgo, substitutionMatrix);
@BeforeClass(dependsOnMethods = { "setUpTree" })
public void createTreeView()
{
-- treeView = ArchaeopteryxInit.createInstance(jalviewTree);
++ treeView = AptxInit.createInstance(jalviewTree);
aptx = (MainFrame) treeView; // still pretty ugly
treePanel = aptx.getMainPanel().getCurrentTreePanel();
@BeforeClass(dependsOnMethods = { "setUpJalview", "setUpTree" })
public void createTreeView()
{
-- treeView = ArchaeopteryxInit.createUnboundInstance(inputTree);
++ treeView = AptxInit.createUnboundInstance(inputTree);
aptx = (MainFrame) treeView; // pretty ugly
treePanel = aptx.getMainPanel().getCurrentTreePanel();
tree = treePanel.getPhylogeny();