package jalview.ext.archaeopteryx;
-import jalview.analysis.TreeBuilder;
import jalview.ext.forester.io.UtilityMethods;
import jalview.ext.treeviewer.LoadedTreeAssociationI;
import jalview.ext.treeviewer.LoadedTreeSequenceAssociation;
-import jalview.ext.treeviewer.TreeBuilderI;
import jalview.ext.treeviewer.TreeFrameI;
import jalview.ext.treeviewer.TreeI;
import jalview.ext.treeviewer.TreeViewerUtils;
private final static NHXParser.TAXONOMY_EXTRACTION TAXONOMY_EXTRACTION = APTX_CONFIG
.getTaxonomyExtraction();
- public static TreeFrameI createInstanceFromCalculation(
- final TreeBuilder calculatedTree)
+
+ public static TreeFrameI createInstanceFromNhx(String treeTitle,
+ String nhxString, AlignmentViewport viewport)
+ throws IOException
{
- TreeBuilderI aptxTreeBuilder = new AptxTreeBuilder(
- calculatedTree);
+ if (Desktop.instance != null)
+ {
+ Desktop.instance.startLoading(treeTitle);
+ }
- TreeI aptxTree = aptxTreeBuilder.buildTree();
+ Phylogeny aptxPhylogeny = Phylogeny
+ .createInstanceFromNhxString(nhxString);
+ aptxPhylogeny.setName(treeTitle);
+
+ TreeFrameI aptxFrame = createAptxFrame(aptxPhylogeny, viewport,
+ treeTitle);
+
+ if (Desktop.instance != null)
+ {
+ Desktop.instance.stopLoading();
+ }
+
+ return aptxFrame;
- TreeFrameI aptxApp = createAptxFrame(aptxTree,
- calculatedTree.getAvport(), null);
-
- return aptxApp;
}
+ /**
+ * Refactored from Archaeopteryx.main
+ *
+ * @param filePath
+ * @param viewport
+ * @return
+ * @throws IOException
+ * @throws FileNotFoundException
+ */
public static TreeFrameI[] createInstancesFromFile(File treeFile,
AlignmentViewport viewport)
throws FileNotFoundException, IOException
return aptxFrames;
}
- /**
- * Refactored from Archaeopteryx.main
- *
- * @param filePath
- * @param viewport
- * @return
- * @throws IOException
- * @throws FileNotFoundException
- */
+
public static TreeFrameI[] createInstancesFromFile(
String filePath,
AlignmentViewport viewport)
}
-
public static TreeFrameI[] createInstancesFromUrl(URL treeUrl,
AlignmentViewport viewport)
throws FileNotFoundException, IOException, RuntimeException
{
// Not important if this fails, do nothing.
}
- // _main_frame.getContentPane().repaint();
}
}
- System.gc();
-
if (Desktop.instance != null)
{