Move bootStrap/distance settings outside thread
authoramwaterhouse <Andrew Waterhouse>
Wed, 14 Sep 2005 15:44:27 +0000 (15:44 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 14 Sep 2005 15:44:27 +0000 (15:44 +0000)
src/jalview/gui/TreePanel.java

index f086162..c3bdd86 100755 (executable)
@@ -143,6 +143,16 @@ public class TreePanel extends GTreePanel
       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
@@ -155,13 +165,6 @@ public class TreePanel extends GTreePanel
         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
@@ -179,31 +182,6 @@ public class TreePanel extends GTreePanel
         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