From: amwaterhouse Date: Fri, 10 Dec 2004 14:35:18 +0000 (+0000) Subject: sequence selection modified X-Git-Tag: Release_2_0~850 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=95d5181c5173b5ded7d1ef0da1f8c779409fde6d;p=jalview.git sequence selection modified --- diff --git a/src/jalview/gui/IdPanel.java b/src/jalview/gui/IdPanel.java index 4509ab3..14f60d5 100755 --- a/src/jalview/gui/IdPanel.java +++ b/src/jalview/gui/IdPanel.java @@ -17,6 +17,7 @@ public class IdPanel extends JPanel implements MouseListener, MouseMotionListene public int width; public int lastid; + SequenceGroup selectedSequenceGroup; public IdPanel(AlignViewport av, AlignmentPanel parent) { @@ -41,14 +42,29 @@ public class IdPanel extends JPanel implements MouseListener, MouseMotionListene for (int i = start; i <= end; i++) { SequenceI pickedSeq = av.getAlignment().getSequenceAt(i); - if (av.getSelection().contains(pickedSeq)) + { av.getSelection().removeElement(pickedSeq); - else + selectedSequenceGroup.deleteSequence(pickedSeq); + } + else + { av.getSelection().addElement(pickedSeq); + if(selectedSequenceGroup==null) + { + selectedSequenceGroup = new SequenceGroup(); + av.alignment.addGroup( selectedSequenceGroup ); + selectedSequenceGroup.setStartRes(0); + selectedSequenceGroup.setEndRes( pickedSeq.getSequence().length()); + } + + selectedSequenceGroup.addSequence( pickedSeq ); + } } + alignPanel.seqPanel.seqCanvas.paintFlag=true; + alignPanel.repaint(); repaint(); } @@ -117,6 +133,8 @@ public class IdPanel extends JPanel implements MouseListener, MouseMotionListene } else { + selectedSequenceGroup = av.alignment.findGroup(seq); + if (seq != -1) selectSeqs(seq,seq); @@ -129,5 +147,6 @@ public class IdPanel extends JPanel implements MouseListener, MouseMotionListene { lastid = -1; PaintRefresher.Refresh(this); + selectedSequenceGroup = null; } }