fix unselectable tree leaf nodes when node mapping changes after aligmment update...
[jalview.git] / src / jalview / analysis / NJTree.java
index b1141c5..78c4e60 100755 (executable)
@@ -284,12 +284,21 @@ public class NJTree
 
                 if (nam != null)
                 {
+                    if (!leaf.isPlaceholder()) {
+                      // remapping the node to a new sequenceI - should remove any refs to old one.
+                      // TODO - make many sequenceI to one leaf mappings possible! (JBPNote)
+                    }
                     leaf.setPlaceholder(false);
                     leaf.setElement(nam);
                 }
                 else
                 {
+                    if (!leaf.isPlaceholder()) {
+                        // Construct a new placeholder sequence object for this leaf
+                        leaf.setElement(new Sequence(leaf.getName(), "THISISAPLACEHLDER"));
+                    }
                     leaf.setPlaceholder(true);
+                    
                 }
             }
         }