update conservation colours after edit
authoramwaterhouse <Andrew Waterhouse>
Tue, 14 Jun 2005 15:06:34 +0000 (15:06 +0000)
committeramwaterhouse <Andrew Waterhouse>
Tue, 14 Jun 2005 15:06:34 +0000 (15:06 +0000)
src/jalview/gui/SeqPanel.java

index 27cb962..f827fba 100755 (executable)
@@ -180,7 +180,7 @@ public class SeqPanel
     editingSeqs = false;\r
     groupEditing = false;\r
 \r
-    seqCanvas.repaint();\r
+    ap.repaint();\r
   }\r
 \r
   public void doMousePressed(MouseEvent evt)\r
@@ -485,18 +485,22 @@ public class SeqPanel
     // Y O Y CLUSTALX\r
     ColourSchemeI cs = av.getGlobalColourScheme();\r
 \r
+    if(av.getSelectionGroup()!=null)\r
+      av.getSelectionGroup().recalcConservation();\r
+\r
+\r
     if (cs instanceof ConservationColourScheme)\r
     {\r
       ConservationColourScheme ccs = (ConservationColourScheme) cs;\r
+      Conservation c = new Conservation("All",\r
+                                        ResidueProperties.propHash, 3,\r
+                                        av.alignment.getSequences(), 0,\r
+                                        av.alignment.getWidth() - 1);\r
+      c.calculate();\r
+      c.verdict(false, av.ConsPercGaps);\r
 \r
       if (ccs.cs instanceof ClustalxColourScheme)\r
       {\r
-        Conservation c = new Conservation("All",\r
-                                          ResidueProperties.propHash, 3,\r
-                                          av.alignment.getSequences(), 0,\r
-                                          av.alignment.getWidth() - 1);\r
-        c.calculate();\r
-        c.verdict(false, av.ConsPercGaps);\r
 \r
         ClustalxColourScheme cxs = (ClustalxColourScheme) ccs.cs;\r
         cxs.resetClustalX(av.alignment.getSequences(),\r
@@ -504,6 +508,11 @@ public class SeqPanel
         ccs = new ConservationColourScheme(c, cxs);\r
         av.setGlobalColourScheme(ccs);\r
       }\r
+      else\r
+      {\r
+        ccs = new ConservationColourScheme(c, ccs.cs);\r
+        av.setGlobalColourScheme(ccs);\r
+      }\r
     }\r
 \r
     if (cs instanceof ClustalxColourScheme)\r
@@ -727,8 +736,7 @@ public class SeqPanel
 \r
       if (stretchGroup.sequences.contains(nextSeq))\r
       {\r
-        stretchGroup.deleteSequence(seq, false);\r
-        stretchGroup.deleteSequence(nextSeq, false);\r
+          stretchGroup.deleteSequence(seq, false);\r
       }\r
       else\r
       {\r
@@ -736,7 +744,6 @@ public class SeqPanel
         {\r
           stretchGroup.addSequence(seq, false);\r
         }\r
-\r
         stretchGroup.addSequence(nextSeq, false);\r
       }\r
     }\r