recalc group conserve
authoramwaterhouse <Andrew Waterhouse>
Wed, 8 Jun 2005 16:36:57 +0000 (16:36 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 8 Jun 2005 16:36:57 +0000 (16:36 +0000)
src/jalview/appletgui/AlignFrame.java
src/jalview/appletgui/Finder.java
src/jalview/appletgui/IdPanel.java
src/jalview/appletgui/RedundancyPanel.java
src/jalview/appletgui/RotatableCanvas.java
src/jalview/appletgui/ScalePanel.java
src/jalview/appletgui/TreeCanvas.java
src/jalview/gui/Finder.java
src/jalview/gui/IdPanel.java
src/jalview/gui/RedundancyPanel.java

index 2783f26..25b74b6 100755 (executable)
@@ -445,7 +445,7 @@ public class AlignFrame
     SequenceGroup sg = new SequenceGroup();\r
     for (int i = 0; i < viewport.getAlignment().getSequences().size(); i++)\r
     {\r
-      sg.addSequence(viewport.getAlignment().getSequenceAt(i));\r
+      sg.addSequence(viewport.getAlignment().getSequenceAt(i), false);\r
     }\r
     sg.setEndRes(viewport.alignment.getWidth());\r
     viewport.setSelectionGroup(sg);\r
@@ -466,7 +466,7 @@ public class AlignFrame
     SequenceGroup sg = viewport.getSelectionGroup();\r
     for (int i = 0; i < viewport.getAlignment().getSequences().size(); i++)\r
     {\r
-      sg.addOrRemove(viewport.getAlignment().getSequenceAt(i));\r
+      sg.addOrRemove(viewport.getAlignment().getSequenceAt(i), false);\r
     }\r
 \r
     PaintRefresher.Refresh(null);\r
index a3a6124..e152506 100755 (executable)
@@ -113,7 +113,7 @@ public class Finder
 \r
       SequenceGroup sg = new SequenceGroup(searchString, ucs, true, true, false,\r
                                            startRes, endRes);\r
-      sg.addSequence(seq);\r
+      sg.addSequence(seq, false);\r
       av.alignment.addGroup(sg);\r
       searchGroup.addGroup(sg);\r
 \r
index 39fab0a..33463d4 100755 (executable)
@@ -173,7 +173,7 @@ public class IdPanel
       selection.setEndRes(av.alignment.getWidth() - 1);\r
       for (int i = 0; i < sg.getSize(); i++)\r
       {\r
-        selection.addSequence(sg.getSequenceAt(i));\r
+        selection.addSequence(sg.getSequenceAt(i), true);\r
       }\r
 \r
       av.setSelectionGroup(selection);\r
@@ -205,7 +205,7 @@ public class IdPanel
   {\r
     lastid = seq;\r
     SequenceI pickedSeq = av.getAlignment().getSequenceAt(seq);\r
-    av.getSelectionGroup().addOrRemove(pickedSeq);\r
+    av.getSelectionGroup().addOrRemove(pickedSeq, false);\r
   }\r
 \r
   void selectSeqs(int start, int end)\r
@@ -222,7 +222,7 @@ public class IdPanel
 \r
     for (int i = start; i <= end; i++)\r
     {\r
-      av.getSelectionGroup().addSequence(av.getAlignment().getSequenceAt(i));\r
+      av.getSelectionGroup().addSequence(av.getAlignment().getSequenceAt(i), false);\r
     }\r
 \r
   }\r
@@ -234,6 +234,9 @@ public class IdPanel
       scrollThread.running = false;\r
     }\r
 \r
+    if(av.getSelectionGroup()!=null)\r
+      av.getSelectionGroup().recalcConservation();\r
+\r
     mouseDragging = false;\r
     PaintRefresher.Refresh(this);\r
   }\r
index 42ac7f4..8aed730 100755 (executable)
@@ -77,7 +77,7 @@ public class RedundancyPanel
       {\r
         if (sg.sequences.contains( (SequenceI) del.elementAt(i)))\r
         {\r
-          sg.deleteSequence( (SequenceI) del.elementAt(i));\r
+          sg.deleteSequence( (SequenceI) del.elementAt(i), true);\r
         }\r
       }\r
 \r
@@ -96,7 +96,7 @@ public class RedundancyPanel
       {\r
         if (sg.sequences.contains( (SequenceI) del.elementAt(j)))\r
         {\r
-          sg.deleteSequence( (SequenceI) del.elementAt(j));\r
+          sg.deleteSequence( (SequenceI) del.elementAt(j), true);\r
         }\r
 \r
       }\r
index 7d32b86..8d22f37 100755 (executable)
@@ -470,13 +470,13 @@ public class RotatableCanvas
     {\r
       if (av.getSelectionGroup() != null)\r
       {\r
-        av.getSelectionGroup().addOrRemove(found);\r
+        av.getSelectionGroup().addOrRemove(found, true);\r
         PaintRefresher.Refresh(this);\r
       }\r
       else\r
       {\r
         av.setSelectionGroup(new SequenceGroup());\r
-        av.getSelectionGroup().addOrRemove(found);\r
+        av.getSelectionGroup().addOrRemove(found, true);\r
         av.getSelectionGroup().setEndRes(av.alignment.getWidth());\r
 \r
       }\r
@@ -555,15 +555,11 @@ public class RotatableCanvas
         {\r
           if (!av.getSelectionGroup().sequences.contains(sp.sequence))\r
           {\r
-            changedSel = true;\r
-            av.getSelectionGroup().addSequence(sp.sequence);\r
+            av.getSelectionGroup().addSequence(sp.sequence, true);\r
           }\r
         }\r
       }\r
     }\r
-    // if (changedSel) {\r
-    //    fireSequenceSelectionEvent(av.getSelection());\r
-    // }\r
   }\r
 \r
   public SequenceI findPoint(int x, int y)\r
index 71d360d..af226f3 100755 (executable)
@@ -82,7 +82,7 @@ public class ScalePanel
       sg = new SequenceGroup();\r
       for (int i = 0; i < av.alignment.getSequences().size(); i++)\r
       {\r
-        sg.addSequence(av.alignment.getSequenceAt(i));\r
+        sg.addSequence(av.alignment.getSequenceAt(i), false);\r
       }\r
 \r
       sg.setStartRes(res);\r
index 434ad60..b00d6cc 100755 (executable)
@@ -83,7 +83,7 @@ public class TreeCanvas
     }\r
 \r
     selected.setEndRes(av.alignment.getWidth());\r
-    selected.addOrRemove(sequence);\r
+    selected.addOrRemove(sequence, true);\r
 \r
     PaintRefresher.Refresh(this);\r
     repaint();\r
@@ -291,7 +291,7 @@ public class TreeCanvas
           SequenceGroup sg = av.getSelectionGroup();\r
           if (sg != null)\r
           {\r
-            sg.addOrRemove(seq);\r
+            sg.addOrRemove(seq, true);\r
           }\r
         }\r
       }\r
@@ -472,17 +472,12 @@ public class TreeCanvas
 \r
           Vector l = tree.findLeaves( (SequenceNode) tree.getGroups().elementAt(\r
               i), new Vector());\r
-          SequenceGroup sg = null;\r
+          SequenceGroup sg = new SequenceGroup("TreeGroup", av.getGlobalColourScheme(), true, true, false,\r
+                                     0, av.alignment.getWidth());\r
           for (int j = 0; j < l.size(); j++)\r
           {\r
             SequenceNode sn = (SequenceNode) l.elementAt(j);\r
-            if (sg == null)\r
-            {\r
-              sg = new SequenceGroup("TreeGroup", av.getGlobalColourScheme(), true, true, false,\r
-                                     0, av.alignment.getWidth());\r
-            }\r
-\r
-            sg.addSequence( (Sequence) sn.element());\r
+            sg.addSequence( (Sequence) sn.element(), false);\r
           }\r
 \r
           if (av.getGlobalColourScheme() instanceof ConservationColourScheme)\r
index af1888c..71a52e9 100755 (executable)
@@ -127,7 +127,7 @@ public class Finder
 \r
       SequenceGroup sg = new SequenceGroup(searchString, ucs, true, true,\r
                                            false, startRes, endRes);\r
-      sg.addSequence(seq);\r
+      sg.addSequence(seq, false);\r
       av.alignment.addGroup(sg);\r
       searchGroup.addGroup(sg);\r
     }\r
index 4efef45..00fe35f 100755 (executable)
@@ -184,7 +184,7 @@ public class IdPanel
 \r
       for (int i = 0; i < sg.getSize(); i++)\r
       {\r
-        selection.addSequence(sg.getSequenceAt(i));\r
+        selection.addSequence(sg.getSequenceAt(i), true);\r
       }\r
 \r
       av.setSelectionGroup(selection);\r
@@ -218,7 +218,7 @@ public class IdPanel
     lastid = seq;\r
 \r
     SequenceI pickedSeq = av.getAlignment().getSequenceAt(seq);\r
-    av.getSelectionGroup().addOrRemove(pickedSeq);\r
+    av.getSelectionGroup().addOrRemove(pickedSeq, true);\r
   }\r
 \r
   void selectSeqs(int start, int end)\r
@@ -235,7 +235,7 @@ public class IdPanel
 \r
     for (int i = start; i <= end; i++)\r
     {\r
-      av.getSelectionGroup().addSequence(av.getAlignment().getSequenceAt(i));\r
+      av.getSelectionGroup().addSequence(av.getAlignment().getSequenceAt(i), true);\r
     }\r
   }\r
 \r
index 44aa447..daee862 100755 (executable)
@@ -79,7 +79,7 @@ public class RedundancyPanel
       {\r
         if (sg.sequences.contains( (SequenceI) del.elementAt(i)))\r
         {\r
-          sg.deleteSequence( (SequenceI) del.elementAt(i));\r
+          sg.deleteSequence( (SequenceI) del.elementAt(i), true);\r
         }\r
       }\r
     }\r