From dfed2deda8ff4dc12557f4f728acabf76e76496d Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Wed, 14 Sep 2005 15:44:27 +0000 Subject: [PATCH] Move bootStrap/distance settings outside thread --- src/jalview/gui/TreePanel.java | 42 ++++++++++------------------------------ 1 file changed, 10 insertions(+), 32 deletions(-) diff --git a/src/jalview/gui/TreePanel.java b/src/jalview/gui/TreePanel.java index f086162..c3bdd86 100755 --- a/src/jalview/gui/TreePanel.java +++ b/src/jalview/gui/TreePanel.java @@ -143,6 +143,16 @@ public class TreePanel extends GTreePanel public TreeLoader(NewickFile newtree) { this.newtree = newtree; + if (newtree != null) + { + // Must be outside run(), as Jalview2XML tries to + // update distance/bootstrap visibility at the same time + treeCanvas.setShowBootstrap(newtree.HasBootstrap()); + bootstrapMenu.setSelected(newtree.HasBootstrap()); + + treeCanvas.setShowDistances(newtree.HasDistances()); + distanceMenu.setSelected(newtree.HasDistances()); + } } public void run() @@ -155,13 +165,6 @@ public class TreePanel extends GTreePanel tree.reCount(tree.getTopNode()); tree.findHeight(tree.getTopNode()); treeCanvas.setTree(tree); - if(newtree!=null) - { - treeCanvas.setShowBootstrap(newtree.HasBootstrap()); - treeCanvas.setShowDistances(newtree.HasDistances()); - } - - setViewStateFromTreeCanvas(treeCanvas); treeCanvas.repaint(); @@ -179,31 +182,6 @@ public class TreePanel extends GTreePanel return tree; } - /** - * DOCUMENT ME! - * - * @param tree DOCUMENT ME! - */ - private void setViewStateFromTreeCanvas(TreeCanvas tree) - { - // update view menu state from treeCanvas render state - distanceMenu.setSelected(tree.showDistances); - bootstrapMenu.setSelected(tree.showBootstrap); - placeholdersMenu.setSelected(tree.markPlaceholders); - } - - /** - * DOCUMENT ME! - * - * @param tree DOCUMENT ME! - */ - private void setTreeCanvasFromViewState(TreeCanvas tree) - { - // update view menu state from treeCanvas render state - tree.showDistances = distanceMenu.isSelected(); - tree.showBootstrap = bootstrapMenu.isSelected(); - tree.markPlaceholders = placeholdersMenu.isSelected(); - } /** * DOCUMENT ME! -- 1.7.10.2