From 0616cee67a5fd2f8724f48232873c39d5fa3015a Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Tue, 14 Jun 2005 15:06:34 +0000 Subject: [PATCH] update conservation colours after edit --- src/jalview/gui/SeqPanel.java | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 27cb962..f827fba 100755 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -180,7 +180,7 @@ public class SeqPanel editingSeqs = false; groupEditing = false; - seqCanvas.repaint(); + ap.repaint(); } public void doMousePressed(MouseEvent evt) @@ -485,18 +485,22 @@ public class SeqPanel // Y O Y CLUSTALX ColourSchemeI cs = av.getGlobalColourScheme(); + if(av.getSelectionGroup()!=null) + av.getSelectionGroup().recalcConservation(); + + if (cs instanceof ConservationColourScheme) { ConservationColourScheme ccs = (ConservationColourScheme) cs; + Conservation c = new Conservation("All", + ResidueProperties.propHash, 3, + av.alignment.getSequences(), 0, + av.alignment.getWidth() - 1); + c.calculate(); + c.verdict(false, av.ConsPercGaps); if (ccs.cs instanceof ClustalxColourScheme) { - Conservation c = new Conservation("All", - ResidueProperties.propHash, 3, - av.alignment.getSequences(), 0, - av.alignment.getWidth() - 1); - c.calculate(); - c.verdict(false, av.ConsPercGaps); ClustalxColourScheme cxs = (ClustalxColourScheme) ccs.cs; cxs.resetClustalX(av.alignment.getSequences(), @@ -504,6 +508,11 @@ public class SeqPanel ccs = new ConservationColourScheme(c, cxs); av.setGlobalColourScheme(ccs); } + else + { + ccs = new ConservationColourScheme(c, ccs.cs); + av.setGlobalColourScheme(ccs); + } } if (cs instanceof ClustalxColourScheme) @@ -727,8 +736,7 @@ public class SeqPanel if (stretchGroup.sequences.contains(nextSeq)) { - stretchGroup.deleteSequence(seq, false); - stretchGroup.deleteSequence(nextSeq, false); + stretchGroup.deleteSequence(seq, false); } else { @@ -736,7 +744,6 @@ public class SeqPanel { stretchGroup.addSequence(seq, false); } - stretchGroup.addSequence(nextSeq, false); } } -- 1.7.10.2