- // roundabout way to select each tree because getComponentAt(i) requires
- // casting to TreePanel which doesn't work
- aptxApp.getMainPanel().getTabbedPane().setSelectedIndex(i);
- Phylogeny tree = aptxApp.getMainPanel().getCurrentTreePanel()
- .getPhylogeny();
-
- LoadedTreeAssociation bindAptxNodes = new LoadedTreeAssociation(
- viewport.getAlignment().getSequencesArray(),
- tree);
+ JvOptionPane.showMessageDialog(Desktop.desktop, err,
+ MessageManager.getString("label.problem_reading_tree_file"),
+ JvOptionPane.WARNING_MESSAGE);
+ }
+ boolean nhx_or_nexus = false;
+ final PhylogenyParser p = ParserUtils.createParserDependingOnFileType(
+ treeFile, VALIDATE_PHYLOXML_XSD);
+ if (p instanceof NHXParser)
+ {
+ nhx_or_nexus = true;
+ final NHXParser nhx = (NHXParser) p;
+ nhx.setReplaceUnderscores(REPLACE_NHX_UNDERSCORES);
+ nhx.setIgnoreQuotes(false);
+ nhx.setTaxonomyExtraction(TAXONOMY_EXTRACTION);
+ }
+ else if (p instanceof NexusPhylogeniesParser)
+ {
+ nhx_or_nexus = true;
+ final NexusPhylogeniesParser nex = (NexusPhylogeniesParser) p;
+ nex.setReplaceUnderscores(REPLACE_NHX_UNDERSCORES);
+ nex.setIgnoreQuotes(false);
+ }
+// else if (p instanceof PhyloXmlParser)
+// {
+// MainFrameApplication.warnIfNotPhyloXmlValidation(APTX_CONFIG);
+// }
+ Phylogeny[] phylogenies = PhylogenyMethods.readPhylogenies(p, treeFile);
+ MainFrame[] aptxFrames = new MainFrame[phylogenies.length];
+ String treeTitle = treeFile.getName();
+
+ for (int i = 0; i < phylogenies.length; i++)
+ {
+ Phylogeny tree = phylogenies[i];
+ if (nhx_or_nexus && INTERNAL_NUMBERS_AS_CONFIDENCE)
+ {
+ PhylogenyMethods.transferInternalNodeNamesToConfidence(tree, "");
+ }
+
+ MainFrame aptxApp = Archaeopteryx.createApplication(tree, APTX_CONFIG,
+ treeTitle);
+ LoadedTreeAssociation bindAptxNodes = new LoadedTreeAssociation(
+ viewport.getAlignment().getSequencesArray(), tree);