public TreeLoader(NewickFile newtree)\r
{\r
this.newtree = newtree;\r
+ if (newtree != null)\r
+ {\r
+ // Must be outside run(), as Jalview2XML tries to\r
+ // update distance/bootstrap visibility at the same time\r
+ treeCanvas.setShowBootstrap(newtree.HasBootstrap());\r
+ bootstrapMenu.setSelected(newtree.HasBootstrap());\r
+\r
+ treeCanvas.setShowDistances(newtree.HasDistances());\r
+ distanceMenu.setSelected(newtree.HasDistances());\r
+ }\r
}\r
\r
public void run()\r
tree.reCount(tree.getTopNode());\r
tree.findHeight(tree.getTopNode());\r
treeCanvas.setTree(tree);\r
- if(newtree!=null)\r
- {\r
- treeCanvas.setShowBootstrap(newtree.HasBootstrap());\r
- treeCanvas.setShowDistances(newtree.HasDistances());\r
- }\r
-\r
- setViewStateFromTreeCanvas(treeCanvas);\r
\r
treeCanvas.repaint();\r
\r
return tree;\r
}\r
\r
- /**\r
- * DOCUMENT ME!\r
- *\r
- * @param tree DOCUMENT ME!\r
- */\r
- private void setViewStateFromTreeCanvas(TreeCanvas tree)\r
- {\r
- // update view menu state from treeCanvas render state\r
- distanceMenu.setSelected(tree.showDistances);\r
- bootstrapMenu.setSelected(tree.showBootstrap);\r
- placeholdersMenu.setSelected(tree.markPlaceholders);\r
- }\r
-\r
- /**\r
- * DOCUMENT ME!\r
- *\r
- * @param tree DOCUMENT ME!\r
- */\r
- private void setTreeCanvasFromViewState(TreeCanvas tree)\r
- {\r
- // update view menu state from treeCanvas render state\r
- tree.showDistances = distanceMenu.isSelected();\r
- tree.showBootstrap = bootstrapMenu.isSelected();\r
- tree.markPlaceholders = placeholdersMenu.isSelected();\r
- }\r
\r
/**\r
* DOCUMENT ME!\r