more efficient highlighting and selection display JAL-469
[jalview.git] / src / jalview / appletgui / TreeCanvas.java
index d1c6c61..4a38767 100755 (executable)
@@ -184,8 +184,7 @@ public class TreeCanvas extends Panel implements MouseListener,
       }
 
       String name = (markPlaceholders && node.isPlaceholder()) ? (PLACEHOLDER + node
-              .getName())
-              : node.getName();
+              .getName()) : node.getName();
       FontMetrics fm = g.getFontMetrics(font);
       int charWidth = fm.stringWidth(name) + 3;
       int charHeight = fm.getHeight();
@@ -509,6 +508,7 @@ public class TreeCanvas extends Panel implements MouseListener,
 
       PaintRefresher.Refresh(this, av.getSequenceSetId());
       repaint();
+      av.sendSelection();
     }
   }
 
@@ -551,6 +551,7 @@ public class TreeCanvas extends Panel implements MouseListener,
       treeSelectionChanged((Sequence) ob);
       PaintRefresher.Refresh(this, av.getSequenceSetId());
       repaint();
+      av.sendSelection();
       return;
     }
     else if (!(ob instanceof SequenceNode))
@@ -585,12 +586,12 @@ public class TreeCanvas extends Panel implements MouseListener,
     for (int i = 0; i < tree.getGroups().size(); i++)
     {
 
-      Color col = new Color((int) (Math.random() * 255), (int) (Math
-              .random() * 255), (int) (Math.random() * 255));
+      Color col = new Color((int) (Math.random() * 255),
+              (int) (Math.random() * 255), (int) (Math.random() * 255));
       setColor((SequenceNode) tree.getGroups().elementAt(i), col.brighter());
 
-      Vector l = tree.findLeaves((SequenceNode) tree.getGroups().elementAt(
-              i), new Vector());
+      Vector l = tree.findLeaves(
+              (SequenceNode) tree.getGroups().elementAt(i), new Vector());
 
       Vector sequences = new Vector();
       for (int j = 0; j < l.size(); j++)
@@ -609,8 +610,9 @@ public class TreeCanvas extends Panel implements MouseListener,
       {
         if (av.getGlobalColourScheme() instanceof UserColourScheme)
         {
-          cs = new UserColourScheme(((UserColourScheme) av
-                  .getGlobalColourScheme()).getColours());
+          cs = new UserColourScheme(
+                  ((UserColourScheme) av.getGlobalColourScheme())
+                          .getColours());
 
         }
         else
@@ -620,8 +622,8 @@ public class TreeCanvas extends Panel implements MouseListener,
                   .getGlobalColourScheme()));
         }
 
-        cs.setThreshold(av.getGlobalColourScheme().getThreshold(), av
-                .getIgnoreGapsConsensus());
+        cs.setThreshold(av.getGlobalColourScheme().getThreshold(),
+                av.getIgnoreGapsConsensus());
       }
 
       SequenceGroup sg = new SequenceGroup(sequences, "", cs, true, true,
@@ -633,8 +635,8 @@ public class TreeCanvas extends Panel implements MouseListener,
               && av.getGlobalColourScheme().conservationApplied())
       {
         Conservation c = new Conservation("Group",
-                ResidueProperties.propHash, 3, sg.getSequences(null), sg
-                        .getStartRes(), sg.getEndRes());
+                ResidueProperties.propHash, 3, sg.getSequences(null),
+                sg.getStartRes(), sg.getEndRes());
 
         c.calculate();
         c.verdict(false, av.ConsPercGaps);