X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FSeqPanel.java;h=fb11579f29a9cfc3d20ec42a333baed76b583f12;hb=9344c308a62c48e2ddedd12247edab74e581c2e7;hp=ee7676ce79e749da0ef7467b38a8e816d9053c91;hpb=da18eb63c94018e134fb60d70e6de43e99bbff50;p=jalview.git diff --git a/src/jalview/appletgui/SeqPanel.java b/src/jalview/appletgui/SeqPanel.java index ee7676c..fb11579 100755 --- a/src/jalview/appletgui/SeqPanel.java +++ b/src/jalview/appletgui/SeqPanel.java @@ -152,6 +152,8 @@ public class SeqPanel ap.repaint(); } + int startWrapBlock=-1; + int wrappedBlock=-1; int findRes(MouseEvent evt) { int res = 0; @@ -165,10 +167,10 @@ public class SeqPanel int chunkHeight = (av.getAlignment().getHeight() + 2) * av.charHeight; int cwidth = seqCanvas.getWrappedCanvasWidth(this.getSize().width); - int block = y/chunkHeight; - block += av.getStartRes()/cwidth; + wrappedBlock = y/chunkHeight; + wrappedBlock += av.getStartRes()/cwidth; - res = block*cwidth + x / av.getCharWidth(); + res = wrappedBlock*cwidth + x / av.getCharWidth(); } else { @@ -231,7 +233,7 @@ public class SeqPanel int res = findRes(evt); int seq = findSeq(evt); - if (seq >= av.getAlignment().getHeight() || seq<0) + if (seq >= av.getAlignment().getHeight() || seq<0 || res<0) { return; } @@ -457,105 +459,7 @@ public class SeqPanel ap.alignFrame.updateEditMenuBar(); } - av.updateConservation(); - av.updateConsensus(); - - - //Does the edit affect any groups? - ////////////////////////////// - Vector groupsToUpdate = new Vector(); - SequenceGroup sg = av.getSelectionGroup(); - - int s, g, gSize = av.alignment.getGroups().size(); - if (sg != null) - { - groupsToUpdate.addElement(av.getSelectionGroup()); - int sSize = sg.getSize(); - for (s = 0; s < sSize; s++) - { - SequenceI seq = sg.getSequenceAt(s); - - for (g = 0; g < gSize; g++) - { - SequenceGroup sg2 = (SequenceGroup) av.alignment.getGroups(). - elementAt( - g); - if (sg2.sequences.contains(seq)) - { - if (!groupsToUpdate.contains(sg2)) - groupsToUpdate.addElement(sg2); - continue; - } - } - } - } - else - { - SequenceI seq = av.alignment.getSequenceAt(startseq); - for (g = 0; g < gSize; g++) - { - SequenceGroup sg2 = (SequenceGroup) av.alignment.getGroups().elementAt( - g); - if (sg2.sequences.contains(seq)) - { - if (!groupsToUpdate.contains(sg2)) - groupsToUpdate.addElement(sg2); - continue; - } - } - } - - gSize = groupsToUpdate.size(); - for (g = 0; g < gSize; g++) - { - ( (SequenceGroup) groupsToUpdate.elementAt(g)).recalcConservation(); - } - ////End of updating groups - ////////////////////////////////////////// - - - // Y O Y CLUSTALX - ColourSchemeI cs = av.getGlobalColourScheme(); - - if (av.getSelectionGroup() != null) - { - av.getSelectionGroup().recalcConservation(); - } - - if(cs!=null) - { - if (cs.conservationApplied()) - { - jalview.analysis.Conservation c = new jalview.analysis.Conservation("All", - ResidueProperties.propHash, 3, - av.alignment.getSequences(), - 0, av.alignment.getWidth() - 1); - c.calculate(); - c.verdict(false, av.ConsPercGaps); - - if (cs instanceof ClustalxColourScheme) - { - ((ClustalxColourScheme)cs). - resetClustalX(av.alignment.getSequences(), - av.alignment.getWidth()); - cs.setConservation(c); - av.setGlobalColourScheme(cs); - } - else - { - cs.setConservation(c); - av.setGlobalColourScheme(cs); - } - - } - - if (cs instanceof ClustalxColourScheme) - { - ( (ClustalxColourScheme) cs).resetClustalX(av.alignment.getSequences(), - av.alignment.getWidth()); - av.setGlobalColourScheme(cs); - } - } + av.firePropertyChange("alignment", null,av.getAlignment().getSequences()); } ////////////////////////////////////////// @@ -567,6 +471,7 @@ public class SeqPanel int res = findRes(evt); int seq = findSeq(evt); oldSeq = seq; + startWrapBlock=wrappedBlock; SequenceI sequence = (Sequence) av.getAlignment().getSequenceAt(seq); @@ -705,6 +610,9 @@ public class SeqPanel int res = findRes(evt); int y = findSeq(evt); + if(wrappedBlock!=startWrapBlock) + return; + if(y>=av.alignment.getHeight()) y = av.alignment.getHeight()-1; @@ -713,7 +621,7 @@ public class SeqPanel return; } - if (res > av.alignment.getWidth() && !av.getWrapAlignment()) + if (res > av.alignment.getWidth()) { res = av.alignment.getWidth() - 1; }