From 4ebc6d5b362bc093c39312aa1a69836e3dd6ae84 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Wed, 8 Jun 2005 16:36:57 +0000 Subject: [PATCH] recalc group conserve --- src/jalview/appletgui/AlignFrame.java | 4 ++-- src/jalview/appletgui/Finder.java | 2 +- src/jalview/appletgui/IdPanel.java | 9 ++++++--- src/jalview/appletgui/RedundancyPanel.java | 4 ++-- src/jalview/appletgui/RotatableCanvas.java | 10 +++------- src/jalview/appletgui/ScalePanel.java | 2 +- src/jalview/appletgui/TreeCanvas.java | 15 +++++---------- src/jalview/gui/Finder.java | 2 +- src/jalview/gui/IdPanel.java | 6 +++--- src/jalview/gui/RedundancyPanel.java | 2 +- 10 files changed, 25 insertions(+), 31 deletions(-) diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index 2783f26..25b74b6 100755 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -445,7 +445,7 @@ public class AlignFrame SequenceGroup sg = new SequenceGroup(); for (int i = 0; i < viewport.getAlignment().getSequences().size(); i++) { - sg.addSequence(viewport.getAlignment().getSequenceAt(i)); + sg.addSequence(viewport.getAlignment().getSequenceAt(i), false); } sg.setEndRes(viewport.alignment.getWidth()); viewport.setSelectionGroup(sg); @@ -466,7 +466,7 @@ public class AlignFrame SequenceGroup sg = viewport.getSelectionGroup(); for (int i = 0; i < viewport.getAlignment().getSequences().size(); i++) { - sg.addOrRemove(viewport.getAlignment().getSequenceAt(i)); + sg.addOrRemove(viewport.getAlignment().getSequenceAt(i), false); } PaintRefresher.Refresh(null); diff --git a/src/jalview/appletgui/Finder.java b/src/jalview/appletgui/Finder.java index a3a6124..e152506 100755 --- a/src/jalview/appletgui/Finder.java +++ b/src/jalview/appletgui/Finder.java @@ -113,7 +113,7 @@ public class Finder SequenceGroup sg = new SequenceGroup(searchString, ucs, true, true, false, startRes, endRes); - sg.addSequence(seq); + sg.addSequence(seq, false); av.alignment.addGroup(sg); searchGroup.addGroup(sg); diff --git a/src/jalview/appletgui/IdPanel.java b/src/jalview/appletgui/IdPanel.java index 39fab0a..33463d4 100755 --- a/src/jalview/appletgui/IdPanel.java +++ b/src/jalview/appletgui/IdPanel.java @@ -173,7 +173,7 @@ public class IdPanel selection.setEndRes(av.alignment.getWidth() - 1); for (int i = 0; i < sg.getSize(); i++) { - selection.addSequence(sg.getSequenceAt(i)); + selection.addSequence(sg.getSequenceAt(i), true); } av.setSelectionGroup(selection); @@ -205,7 +205,7 @@ public class IdPanel { lastid = seq; SequenceI pickedSeq = av.getAlignment().getSequenceAt(seq); - av.getSelectionGroup().addOrRemove(pickedSeq); + av.getSelectionGroup().addOrRemove(pickedSeq, false); } void selectSeqs(int start, int end) @@ -222,7 +222,7 @@ public class IdPanel for (int i = start; i <= end; i++) { - av.getSelectionGroup().addSequence(av.getAlignment().getSequenceAt(i)); + av.getSelectionGroup().addSequence(av.getAlignment().getSequenceAt(i), false); } } @@ -234,6 +234,9 @@ public class IdPanel scrollThread.running = false; } + if(av.getSelectionGroup()!=null) + av.getSelectionGroup().recalcConservation(); + mouseDragging = false; PaintRefresher.Refresh(this); } diff --git a/src/jalview/appletgui/RedundancyPanel.java b/src/jalview/appletgui/RedundancyPanel.java index 42ac7f4..8aed730 100755 --- a/src/jalview/appletgui/RedundancyPanel.java +++ b/src/jalview/appletgui/RedundancyPanel.java @@ -77,7 +77,7 @@ public class RedundancyPanel { if (sg.sequences.contains( (SequenceI) del.elementAt(i))) { - sg.deleteSequence( (SequenceI) del.elementAt(i)); + sg.deleteSequence( (SequenceI) del.elementAt(i), true); } } @@ -96,7 +96,7 @@ public class RedundancyPanel { if (sg.sequences.contains( (SequenceI) del.elementAt(j))) { - sg.deleteSequence( (SequenceI) del.elementAt(j)); + sg.deleteSequence( (SequenceI) del.elementAt(j), true); } } diff --git a/src/jalview/appletgui/RotatableCanvas.java b/src/jalview/appletgui/RotatableCanvas.java index 7d32b86..8d22f37 100755 --- a/src/jalview/appletgui/RotatableCanvas.java +++ b/src/jalview/appletgui/RotatableCanvas.java @@ -470,13 +470,13 @@ public class RotatableCanvas { if (av.getSelectionGroup() != null) { - av.getSelectionGroup().addOrRemove(found); + av.getSelectionGroup().addOrRemove(found, true); PaintRefresher.Refresh(this); } else { av.setSelectionGroup(new SequenceGroup()); - av.getSelectionGroup().addOrRemove(found); + av.getSelectionGroup().addOrRemove(found, true); av.getSelectionGroup().setEndRes(av.alignment.getWidth()); } @@ -555,15 +555,11 @@ public class RotatableCanvas { if (!av.getSelectionGroup().sequences.contains(sp.sequence)) { - changedSel = true; - av.getSelectionGroup().addSequence(sp.sequence); + av.getSelectionGroup().addSequence(sp.sequence, true); } } } } - // if (changedSel) { - // fireSequenceSelectionEvent(av.getSelection()); - // } } public SequenceI findPoint(int x, int y) diff --git a/src/jalview/appletgui/ScalePanel.java b/src/jalview/appletgui/ScalePanel.java index 71d360d..af226f3 100755 --- a/src/jalview/appletgui/ScalePanel.java +++ b/src/jalview/appletgui/ScalePanel.java @@ -82,7 +82,7 @@ public class ScalePanel sg = new SequenceGroup(); for (int i = 0; i < av.alignment.getSequences().size(); i++) { - sg.addSequence(av.alignment.getSequenceAt(i)); + sg.addSequence(av.alignment.getSequenceAt(i), false); } sg.setStartRes(res); diff --git a/src/jalview/appletgui/TreeCanvas.java b/src/jalview/appletgui/TreeCanvas.java index 434ad60..b00d6cc 100755 --- a/src/jalview/appletgui/TreeCanvas.java +++ b/src/jalview/appletgui/TreeCanvas.java @@ -83,7 +83,7 @@ public class TreeCanvas } selected.setEndRes(av.alignment.getWidth()); - selected.addOrRemove(sequence); + selected.addOrRemove(sequence, true); PaintRefresher.Refresh(this); repaint(); @@ -291,7 +291,7 @@ public class TreeCanvas SequenceGroup sg = av.getSelectionGroup(); if (sg != null) { - sg.addOrRemove(seq); + sg.addOrRemove(seq, true); } } } @@ -472,17 +472,12 @@ public class TreeCanvas Vector l = tree.findLeaves( (SequenceNode) tree.getGroups().elementAt( i), new Vector()); - SequenceGroup sg = null; + SequenceGroup sg = new SequenceGroup("TreeGroup", av.getGlobalColourScheme(), true, true, false, + 0, av.alignment.getWidth()); for (int j = 0; j < l.size(); j++) { SequenceNode sn = (SequenceNode) l.elementAt(j); - if (sg == null) - { - sg = new SequenceGroup("TreeGroup", av.getGlobalColourScheme(), true, true, false, - 0, av.alignment.getWidth()); - } - - sg.addSequence( (Sequence) sn.element()); + sg.addSequence( (Sequence) sn.element(), false); } if (av.getGlobalColourScheme() instanceof ConservationColourScheme) diff --git a/src/jalview/gui/Finder.java b/src/jalview/gui/Finder.java index af1888c..71a52e9 100755 --- a/src/jalview/gui/Finder.java +++ b/src/jalview/gui/Finder.java @@ -127,7 +127,7 @@ public class Finder SequenceGroup sg = new SequenceGroup(searchString, ucs, true, true, false, startRes, endRes); - sg.addSequence(seq); + sg.addSequence(seq, false); av.alignment.addGroup(sg); searchGroup.addGroup(sg); } diff --git a/src/jalview/gui/IdPanel.java b/src/jalview/gui/IdPanel.java index 4efef45..00fe35f 100755 --- a/src/jalview/gui/IdPanel.java +++ b/src/jalview/gui/IdPanel.java @@ -184,7 +184,7 @@ public class IdPanel for (int i = 0; i < sg.getSize(); i++) { - selection.addSequence(sg.getSequenceAt(i)); + selection.addSequence(sg.getSequenceAt(i), true); } av.setSelectionGroup(selection); @@ -218,7 +218,7 @@ public class IdPanel lastid = seq; SequenceI pickedSeq = av.getAlignment().getSequenceAt(seq); - av.getSelectionGroup().addOrRemove(pickedSeq); + av.getSelectionGroup().addOrRemove(pickedSeq, true); } void selectSeqs(int start, int end) @@ -235,7 +235,7 @@ public class IdPanel for (int i = start; i <= end; i++) { - av.getSelectionGroup().addSequence(av.getAlignment().getSequenceAt(i)); + av.getSelectionGroup().addSequence(av.getAlignment().getSequenceAt(i), true); } } diff --git a/src/jalview/gui/RedundancyPanel.java b/src/jalview/gui/RedundancyPanel.java index 44aa447..daee862 100755 --- a/src/jalview/gui/RedundancyPanel.java +++ b/src/jalview/gui/RedundancyPanel.java @@ -79,7 +79,7 @@ public class RedundancyPanel { if (sg.sequences.contains( (SequenceI) del.elementAt(i))) { - sg.deleteSequence( (SequenceI) del.elementAt(i)); + sg.deleteSequence( (SequenceI) del.elementAt(i), true); } } } -- 1.7.10.2