update conservation and consensus
authoramwaterhouse <Andrew Waterhouse>
Fri, 1 Apr 2005 16:44:16 +0000 (16:44 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 1 Apr 2005 16:44:16 +0000 (16:44 +0000)
src/jalview/gui/SeqPanel.java

index 8e7141b..9f05887 100755 (executable)
@@ -250,7 +250,9 @@ public class SeqPanel extends JPanel
        // Group editing\r
        if (evt.isAltDown() || evt.isControlDown())\r
         {\r
-         SequenceGroup sg = av.getAlignment().findGroup(startseq);\r
+         SequenceGroup sg = av.getSelectionGroup();\r
+          if(sg==null)\r
+            av.getAlignment().findGroup(startseq);\r
           if (sg != null)\r
           {\r
             boolean deleteAllowed = false;\r
@@ -360,21 +362,8 @@ public class SeqPanel extends JPanel
 \r
   void updateConservation(int i)\r
   {\r
-  /*  Alignment al = (Alignment) av.getAlignment();\r
-    SequenceGroup sg = av.alignment.findGroup( al.getSequenceAt(i));\r
-    if(sg==null || !(sg.cs instanceof ConservationColourScheme))\r
-      return;\r
-\r
-    Conservation c = sg.getConservation();\r
-\r
-    c = new Conservation("All", al.cons,\r
-                         ResidueProperties.propHash, 3, sg.sequences, 0,\r
-                         al.getWidth());\r
-    c.calculate();\r
-    c.verdict(false, 100);\r
-    sg.setConservation(c);\r
-    ConservationColourScheme ccs = (ConservationColourScheme)sg.cs;\r
-    ccs.conserve = c;*/\r
+    av.updateConservation();\r
+    av.updateConsensus();\r
   }\r
 \r
 //////////////////////////////////////////\r
@@ -397,7 +386,7 @@ public class SeqPanel extends JPanel
     if(stretchGroup == null)\r
      {\r
        stretchGroup = av.alignment.findGroup( sequence );\r
-       if(res>stretchGroup.getStartRes() && res<stretchGroup.getEndRes())\r
+       if(stretchGroup!=null && res>stretchGroup.getStartRes() && res<stretchGroup.getEndRes())\r
          av.setSelectionGroup(stretchGroup);\r
        else\r
          stretchGroup = null;\r