From 973ebf84c9968d596886729c9b5bfa52b51e3521 Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 2 Mar 2012 16:23:20 +0000 Subject: [PATCH] (JAL-942) more tweaking mapping between 2-struct and seqs --- src/jalview/gui/AppVarna.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/jalview/gui/AppVarna.java b/src/jalview/gui/AppVarna.java index 06de21f..cbb3f95 100644 --- a/src/jalview/gui/AppVarna.java +++ b/src/jalview/gui/AppVarna.java @@ -190,7 +190,7 @@ public class AppVarna extends JInternalFrame implements { if (ofstart > -1) { - offset.addShift(ofstart, ofstart - i); + offset.addShift(offset.shift(ofstart), ofstart - i); ofstart = -1; } } @@ -198,7 +198,7 @@ public class AppVarna extends JInternalFrame implements // final gap if (ofstart > -1) { - offset.addShift(ofstart, ofstart - sleng); + offset.addShift(offset.shift(ofstart), ofstart - sleng); ofstart = -1; } String newSeq = rnaTrim.getSeq().replace("-", ""); @@ -327,12 +327,14 @@ public class AppVarna extends JInternalFrame implements public void mouseOverSequence(SequenceI sequence, int index) { RNA rna = vab.getSelectedRNA(); - if (rnas.get(sequence) == rna) + if (seqs.get(rna) == sequence) { ShiftList shift = offsets.get(rna); if (shift != null) { - index = shift.shift(index); + // System.err.print("Orig pos:"+index); + index = shift.shift(index); + // System.err.println("\nFinal pos:"+index); } mouseOverHighlighter.highlightRegion(rna, index, index); vab.updateSelectedRNA(rna); @@ -388,9 +390,9 @@ public class AppVarna extends JInternalFrame implements { if (shift != null) { - int i=shift.shift(arg1.getIndex()); - ssm.mouseOverVamsasSequence(seq, - i, this); + int i = shift.shift(arg1.getIndex()); + // System.err.println("shifted "+(arg1.getIndex())+" to "+i); + ssm.mouseOverVamsasSequence(seq, i, this); } else { -- 1.7.10.2