Desktop.instance.startLoading(filePath);
}
boolean nhx_or_nexus = false;
- final PhylogenyParser p = ParserUtils.createParserDependingOnFileType(
+ final PhylogenyParser parser = ParserUtils.createParserDependingOnFileType(
treeFile, VALIDATE_PHYLOXML_XSD);
- if (p instanceof NHXParser)
+ if (parser instanceof NHXParser)
{
nhx_or_nexus = true;
- final NHXParser nhx = (NHXParser) p;
+ final NHXParser nhx = (NHXParser) parser;
nhx.setReplaceUnderscores(REPLACE_NHX_UNDERSCORES);
nhx.setIgnoreQuotes(false);
nhx.setTaxonomyExtraction(TAXONOMY_EXTRACTION);
}
- else if (p instanceof NexusPhylogeniesParser)
+ else if (parser instanceof NexusPhylogeniesParser)
{
nhx_or_nexus = true;
- final NexusPhylogeniesParser nex = (NexusPhylogeniesParser) p;
+ final NexusPhylogeniesParser nex = (NexusPhylogeniesParser) parser;
nex.setReplaceUnderscores(REPLACE_NHX_UNDERSCORES);
nex.setIgnoreQuotes(false);
}
// {
// MainFrameApplication.warnIfNotPhyloXmlValidation(APTX_CONFIG);
// }
- Phylogeny[] phylogenies = PhylogenyMethods.readPhylogenies(p, treeFile);
- MainFrame[] aptxFrames = new MainFrame[phylogenies.length];
+ Phylogeny[] trees = PhylogenyMethods.readPhylogenies(parser, treeFile);
+ MainFrame[] aptxFrames = new MainFrame[trees.length];
String treeTitle = treeFile.getName();
- for (int i = 0; i < phylogenies.length; i++)
+ for (int i = 0; i < trees.length; i++)
{
- Phylogeny tree = phylogenies[i];
+ Phylogeny tree = trees[i];
if (nhx_or_nexus && INTERNAL_NUMBERS_AS_CONFIDENCE)
{
PhylogenyMethods.transferInternalNodeNamesToConfidence(tree, "");
}
-
aptxFrames[i] = createAptxFrame(tree, viewport, treeTitle);
+
}
if (Desktop.instance != null)
{
public static MainFrame[] createInstancesFromDb(int databaseIndex,
AlignmentViewport viewport)
{
- if (Desktop.desktop != null)
- {
- // Desktop.desktop.startLoading(treeTitle);
- }
URL url = null;
Phylogeny[] trees = null;
client.getInstructions() + "\n(Reference: "
+ client.getReference() + ")",
client.getDescription(), JvOptionPane.QUESTION_MESSAGE);
+
if ((identifier != null) && (identifier.trim().length() > 0))
{
+ if (Desktop.instance != null)
+ {
+ Desktop.instance.startLoading(identifier);
+ }
+
identifier = identifier.trim();
if (client.isQueryInteger())
{
identifier = identifier.replaceAll("^\\D+", "");
- int id = -1;
+
+ int id;
try
{
id = Integer.parseInt(identifier);
} catch (final NumberFormatException e)
{
- id = -1;
- }
- if (id < 1)
- {
JvOptionPane.showInternalMessageDialog(Desktop.desktop,
"Identifier is expected to be a number",
"Can not open URL", JvOptionPane.ERROR_MESSAGE);
{
MainFrame aptxApp = Archaeopteryx.createApplication(aptxTree,
APTX_CONFIG, treeTitle);
- // addPartitioningSlider(aptxApp);
-
- LoadedTreeAssociation bindAptxNodes = new LoadedTreeAssociation(
+ LoadedTreeSequenceAssociation bindAptxNodes = new LoadedTreeSequenceAssociation(
jalviewAlignport.getAlignment().getSequencesArray(), aptxTree);
-
bindAptxNodes.associateLeavesToSequences();
+
bindNodesToJalviewSequences(aptxApp, jalviewAlignport,
bindAptxNodes.getAlignmentWithNodes(),
bindAptxNodes.getNodesWithAlignment());
- bindFrameToJalview(aptxApp);
+ bindTreeViewFrameToJalview(aptxApp);
+
return aptxApp;
}
}
- public static MainFrame bindFrameToJalview(final MainFrame aptxApp)
+ public static MainFrame bindTreeViewFrameToJalview(
+ final MainFrame aptxApp)
{
int width = 400;
int height = 550;