1 package jalview.ext.archaeopteryx;
3 import jalview.analysis.TreeBuilder;
4 import jalview.gui.Desktop;
6 import java.awt.Dimension;
8 import org.forester.archaeopteryx.Archaeopteryx;
9 import org.forester.archaeopteryx.MainFrame;
10 import org.forester.phylogeny.Phylogeny;
12 public final class ArchaeopteryxInit
14 public static MainFrame createInstance(Phylogeny[] aptxTrees)
16 return createBoundAptxFrame(aptxTrees);
20 public static MainFrame createInstance(Phylogeny aptxTree)
22 Phylogeny[] aptxTrees = { aptxTree }; // future possibility to load in
23 // several trees simultaneously
24 return createBoundAptxFrame(aptxTrees);
28 public static MainFrame createInstance(
29 TreeBuilder calculatedTree)
31 ArchaeopteryxTreeBuilder aptxTreeBuilder = new ArchaeopteryxTreeBuilder();
32 Phylogeny aptxTree = aptxTreeBuilder.buildAptxTree(calculatedTree);
33 Phylogeny[] aptxTrees = { aptxTree }; // future possibility to load in
34 // several trees simultaneously
36 return createBoundAptxFrame(aptxTrees);
41 private static MainFrame createBoundAptxFrame(Phylogeny[] aptxTrees)
43 MainFrame aptxApp = Archaeopteryx.createApplication(aptxTrees,
44 "_aptx_jalview_configuration_file", null);
45 return bindFrameToJalview(aptxApp);
50 private static MainFrame bindFrameToJalview(MainFrame aptxApp)
54 aptxApp.setMinimumSize(new Dimension(width, height));
56 Desktop.addInternalFrame(aptxApp, "Archaeopteryx Tree View", true,
57 width, height, true, true);