JAL-3080 remove tree partition if no groups created feature/JAL-3080clearTreeGroups
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 15 Aug 2018 10:01:27 +0000 (11:01 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 15 Aug 2018 10:01:27 +0000 (11:01 +0100)
src/jalview/gui/TreeCanvas.java

index 7dc1a99..fa30e13 100755 (executable)
@@ -962,6 +962,15 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
           }
         }
         colourGroups(groups);
+
+        /*
+         * clear partition (don't show vertical line) if
+         * it is to the right of all nodes
+         */
+        if (groups.isEmpty())
+        {
+          threshold = 0f;
+        }
       }
 
       PaintRefresher.Refresh(tp, ap.av.getSequenceSetId());
@@ -981,7 +990,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
 
       Vector<SequenceNode> l = tree.findLeaves(groups.get(i));
 
-      Vector<SequenceI> sequences = new Vector<SequenceI>();
+      Vector<SequenceI> sequences = new Vector<>();
 
       for (int j = 0; j < l.size(); j++)
       {