X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FSeqPanel.java;h=3bc9bc56f33848ec04e901519cc1d0199fb423fd;hb=e7ed63f1ea56432246a6ed1553f0fe56d26f56ea;hp=55bec56139156b54db198696e1010d9c89542289;hpb=99cb058c4b312055ca758890b10d41428105dabe;p=jalview.git diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 55bec56..3bc9bc5 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,10 @@ public class SeqPanel extends JPanel if(stretchGroup == null) { stretchGroup = av.alignment.findGroup( sequence ); - av.setSelectionGroup( stretchGroup ); + if(stretchGroup!=null && res>stretchGroup.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)) @@ -457,7 +441,6 @@ public class SeqPanel extends JPanel changeStartRes = true; - seqCanvas.paintFlag = true; repaint(); } @@ -478,28 +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; - - Conservation c = new Conservation("Group", - ResidueProperties.propHash, 3, stretchGroup.sequences, 0, - av.alignment.getWidth() ); - - c.calculate(); - c.verdict(false, 100); - ccs = new ConservationColourScheme(c, ccs.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 @@ -507,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()); } } @@ -531,6 +499,10 @@ public class SeqPanel extends JPanel if(stretchGroup==null) return; + if(res>av.alignment.getWidth()) + res = av.alignment.getWidth()-1; + + if(stretchGroup.getEndRes()==res) // Edit end res position of selected group changeEndRes = true; @@ -562,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