Refactored alignment viewport to use common base, extended viewport API with getters...
[jalview.git] / src / jalview / gui / TreeCanvas.java
index 9022182..b62a1c7 100755 (executable)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
- * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -905,9 +905,12 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
                   .getWidth(), ColourSchemeProperty.getColourName(av
                   .getGlobalColourScheme()));
         }
-
-        cs.setThreshold(av.getGlobalColourScheme().getThreshold(),
-                av.getIgnoreGapsConsensus());
+        // cs is null if shading is an annotationColourGradient
+        if (cs!=null)
+        {
+          cs.setThreshold(av.getGlobalColourScheme().getThreshold(),
+                  av.getIgnoreGapsConsensus());
+        }
       }
 
       SequenceGroup sg = new SequenceGroup(sequences, null, cs, true, true,
@@ -925,7 +928,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
                   sg.getStartRes(), sg.getEndRes());
 
           c.calculate();
-          c.verdict(false, aps[a].av.ConsPercGaps);
+          c.verdict(false, aps[a].av.getConsPercGaps());
           sg.cs.setConservation(c);
         }
 
@@ -936,6 +939,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
     for (int a = 0; a < aps.length; a++)
     {
       aps[a].updateAnnotation();
+      // TODO: JAL-868 - need to ensure view colour change message is broadcast to any Jmols listening in
     }
 
   }