import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.HashMap;
import java.util.Map;
import org.forester.archaeopteryx.AptxUtil;
private final static NHXParser.TAXONOMY_EXTRACTION TAXONOMY_EXTRACTION = APTX_CONFIG
.getTaxonomyExtraction();
+ private static Map<MainFrame, JalviewBinding> activeAptx = new HashMap<>();
+
public static MainFrame createInstanceFromCalculation(
nex.setReplaceUnderscores(REPLACE_NHX_UNDERSCORES);
nex.setIgnoreQuotes(false);
}
-// else if (p instanceof PhyloXmlParser)
-// {
-// MainFrameApplication.warnIfNotPhyloXmlValidation(APTX_CONFIG);
-// }
+ else if (parser instanceof PhyloXmlParser)
+ {
+ if ( VALIDATE_PHYLOXML_XSD ) {
+ JvOptionPane.showInternalMessageDialog( null,
+ ForesterUtil.wordWrap(
+ "phyloXML XSD-based validation is turned off [enable with line 'validate_against_phyloxml_xsd_schem: true' in configuration file]",
+ 80 ),
+ "Warning",
+ JvOptionPane.WARNING_MESSAGE );
+ }
+ }
Phylogeny[] trees = PhylogenyMethods.readPhylogenies(parser, treeFile);
MainFrame[] aptxFrames = new MainFrame[trees.length];
- String treeTitle = treeFile.getName();
+
for (int i = 0; i < trees.length; i++)
{
{
PhylogenyMethods.transferInternalNodeNamesToConfidence(tree, "");
}
+ String treeTitle = treeFile.getName() + "[" + i + "]";
+ tree.setName(treeTitle);
aptxFrames[i] = createAptxFrame(tree, viewport, treeTitle);
}
* @return
*/
public static MainFrame[] createInstancesFromDb(int databaseIndex,
- AlignmentViewport viewport)
+ AlignmentViewport viewport, String defaultIdentifier)
{
URL url = null;
Desktop.desktop,
client.getInstructions() + "\n(Reference: "
+ client.getReference() + ")",
- client.getDescription(), JvOptionPane.QUESTION_MESSAGE);
+ client.getDescription(), JvOptionPane.QUESTION_MESSAGE, null,
+ null, defaultIdentifier).toString();
if ((identifier != null) && (identifier.trim().length() > 0))
{
final Map<SequenceI, PhylogenyNode> alignMappedToNodes,
final Map<PhylogenyNode, SequenceI> nodesMappedToAlign)
{
- return new JalviewBinding(aptxApp, jalviewAlignViewport,
+ JalviewBinding treeBinding = new JalviewBinding(aptxApp,
+ jalviewAlignViewport,
alignMappedToNodes, nodesMappedToAlign);
+ activeAptx.put(aptxApp, treeBinding);
+ return treeBinding;
}
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);
-
+ String frameTitle = MessageManager.getString("label.aptx_title");
+ File treeFile = aptxApp.getMainPanel().getCurrentTreePanel()
+ .getTreeFile();
+ if (treeFile != null)
+ {
+ frameTitle += MessageManager.formatMessage("label.aptx_title_append",
+ new String[]
+ { treeFile.getAbsolutePath() });
+ }
+ Desktop.addInternalFrame(aptxApp, frameTitle, true, width, height, true,
+ true);
return aptxApp;
}
+ public static Map<MainFrame, JalviewBinding> getAllAptxFrames()
+ {
+ return activeAptx;
+ }
}