X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FSeqPanel.java;h=0b84fa53172fd7531db253bd4349e5cfc64507d1;hb=8548008f4fbd321b445c7e69fbdffda26e21f457;hp=8e7141be41852f6a4f0b5db85d3191f82a79c3ef;hpb=f602f5590ae442664ecd8024087a62f71f00d82c;p=jalview.git diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 8e7141b..0b84fa5 100755 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -115,8 +115,7 @@ public class SeqPanel extends JPanel seqEditOccurred = -1; - ap.RefreshPanels(); - repaint(); + ap.repaint(); } @@ -175,8 +174,6 @@ public class SeqPanel extends JPanel y %= chunkHeight; seq = y / av.getCharHeight() + av.getStartSeq(); - // chunkHeight = (da.getHeight() + 2)*charHeight; - // startx += chunkWidth; } else { @@ -250,7 +247,9 @@ public class SeqPanel extends JPanel // Group editing if (evt.isAltDown() || evt.isControlDown()) { - SequenceGroup sg = av.getAlignment().findGroup(startseq); + SequenceGroup sg = av.getSelectionGroup(); + if(sg==null) + av.getAlignment().findGroup(startseq); if (sg != null) { boolean deleteAllowed = false; @@ -360,21 +359,8 @@ public class SeqPanel extends JPanel void updateConservation(int i) { - /* Alignment al = (Alignment) av.getAlignment(); - SequenceGroup sg = av.alignment.findGroup( al.getSequenceAt(i)); - if(sg==null || !(sg.cs instanceof ConservationColourScheme)) - return; - - Conservation c = sg.getConservation(); - - c = new Conservation("All", al.cons, - ResidueProperties.propHash, 3, sg.sequences, 0, - al.getWidth()); - c.calculate(); - c.verdict(false, 100); - sg.setConservation(c); - ConservationColourScheme ccs = (ConservationColourScheme)sg.cs; - ccs.conserve = c;*/ + av.updateConservation(); + av.updateConsensus(); } ////////////////////////////////////////// @@ -397,7 +383,7 @@ public class SeqPanel extends JPanel if(stretchGroup == null) { stretchGroup = av.alignment.findGroup( sequence ); - if(res>stretchGroup.getStartRes() && resstretchGroup.getStartRes() && res 0) - Desktop.setPIDSliderSource(ap, av.getGlobalColourScheme(), "Background"); - } + SliderPanel.setConservationSlider(ap, av.getGlobalColourScheme(), "Background"); + if(av.getAbovePIDThreshold()) + SliderPanel.setPIDSliderSource(ap, av.getGlobalColourScheme(), "Background"); } else if( javax.swing.SwingUtilities.isRightMouseButton(evt)) @@ -460,7 +441,6 @@ public class SeqPanel extends JPanel changeStartRes = true; - seqCanvas.paintFlag = true; repaint(); } @@ -481,21 +461,15 @@ public class SeqPanel extends JPanel if(stretchGroup.cs instanceof ClustalxColourScheme) { stretchGroup.cs = new ClustalxColourScheme(stretchGroup.sequences, av.alignment.getWidth()); - seqCanvas.paintFlag = true; repaint(); } else if(stretchGroup.cs instanceof ConservationColourScheme) { - ConservationColourScheme ccs = (ConservationColourScheme)stretchGroup.cs; - - + ConservationColourScheme ccs = (ConservationColourScheme)stretchGroup.cs; stretchGroup.cs = ccs; + SliderPanel.setConservationSlider(ap, stretchGroup.cs, stretchGroup.getName()) ; - - Desktop.setConservationSliderSource(ap, stretchGroup.cs, stretchGroup.getName()) ; - - seqCanvas.paintFlag = true; repaint(); } else @@ -503,9 +477,7 @@ public class SeqPanel extends JPanel if(stretchGroup.cs !=null && stretchGroup.cs.canThreshold()) { ResidueColourScheme rcs = (ResidueColourScheme) stretchGroup.cs; - int threshold = rcs.getThreshold(); - if(threshold>0) - Desktop.setPIDSliderSource(ap, stretchGroup.cs, stretchGroup.getName()); + SliderPanel.setPIDSliderSource(ap, stretchGroup.cs, stretchGroup.getName()); } } @@ -527,6 +499,10 @@ public class SeqPanel extends JPanel if(stretchGroup==null) return; + if(res>av.alignment.getWidth()-2) + res = av.alignment.getWidth()-2; + + if(stretchGroup.getEndRes()==res) // Edit end res position of selected group changeEndRes = true; @@ -558,7 +534,7 @@ public class SeqPanel extends JPanel else if (y < oldSeq) dragDirection = -1; - while (y != oldSeq && oldSeq>0) + while (y != oldSeq && oldSeq>0 && y