JAL-1065 JAL-1066 generic 'annotation collection updated' method called when alignmen...
authorjprocter <jprocter@compbio.dundee.ac.uk>
Fri, 4 May 2012 15:46:07 +0000 (16:46 +0100)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Fri, 4 May 2012 15:46:07 +0000 (16:46 +0100)
src/jalview/appletgui/AlignViewport.java
src/jalview/datamodel/SequenceGroup.java
src/jalview/gui/AlignViewport.java
src/jalview/schemes/ColourSchemeI.java
src/jalview/schemes/ResidueColourScheme.java

index ff8f7df..46945b6 100644 (file)
@@ -1478,6 +1478,7 @@ public class AlignViewport implements SelectionSource, VamsasSource
     ColourSchemeI cs = globalColourScheme;
     if (cs != null)
     {
+      cs.alignmentChanged(alignment);
       if (cs instanceof ClustalxColourScheme)
       {
         ((ClustalxColourScheme) cs).resetClustalX(alignment.getSequences(),
index 94e359a..b0eabff 100755 (executable)
@@ -477,7 +477,10 @@ public class SequenceGroup implements AnnotatedCollectionI
     {
       return;
     }
-
+    if (cs!=null)
+    {
+      cs.alignmentChanged(this);
+    }
     try
     {
       Hashtable cnsns[] = AAFrequency.calculate(sequences, startRes,
index 13f66d9..ac364b9 100644 (file)
@@ -1763,6 +1763,7 @@ public class AlignViewport implements SelectionSource, VamsasSource
     ColourSchemeI cs = globalColourScheme;
     if (cs != null)
     {
+      cs.alignmentChanged(alignment);
       if (cs instanceof ClustalxColourScheme)
       {
         ((ClustalxColourScheme) cs).resetClustalX(alignment.getSequences(),
index b197906..273273f 100755 (executable)
@@ -19,7 +19,9 @@ package jalview.schemes;
 
 import java.awt.Color;
 
+import jalview.datamodel.AnnotatedCollectionI;
 import jalview.datamodel.SequenceI;
+
 public interface ColourSchemeI
 {
   public Color findColour(char c);
@@ -40,4 +42,6 @@ public interface ColourSchemeI
 
   public void setThreshold(int ct, boolean ignoreGaps);
 
+  public void alignmentChanged(AnnotatedCollectionI alignment);
+
 }
index 5c0aa53..ea9e44b 100755 (executable)
@@ -19,6 +19,7 @@ package jalview.schemes;
 
 import jalview.analysis.AAFrequency;
 import jalview.analysis.Conservation;
+import jalview.datamodel.AnnotatedCollectionI;
 import jalview.datamodel.SequenceI;
 
 import java.awt.Color;
@@ -104,6 +105,7 @@ public class ResidueColourScheme implements ColourSchemeI
 
     return currentColour;
   }
+  @Override public void alignmentChanged(AnnotatedCollectionI alignment) {};
 
   /**
    * Get the percentage threshold for this colour scheme