From c65705aaa543f77ae4340ddb9d3691041c210f14 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Tue, 1 Feb 2005 19:03:32 +0000 Subject: [PATCH] Bugs in column selection fixed --- src/jalview/gui/ScalePanel.java | 41 +++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/src/jalview/gui/ScalePanel.java b/src/jalview/gui/ScalePanel.java index e2fd20b..d550651 100755 --- a/src/jalview/gui/ScalePanel.java +++ b/src/jalview/gui/ScalePanel.java @@ -16,6 +16,8 @@ public class ScalePanel extends JPanel protected AlignViewport av; AlignmentPanel ap; + boolean stretchingGroup = false; + public ScalePanel(AlignViewport av, AlignmentPanel ap) { this.av = av; @@ -57,24 +59,30 @@ public class ScalePanel extends JPanel public void doMousePressed(MouseEvent evt) { int x = evt.getX(); int res = x/av.getCharWidth() + av.getStartRes(); + SequenceGroup sg = null; - if (! av.getColumnSelection().contains(res)) - av.getColumnSelection().addElement(res); + if (av.getColumnSelection().contains(res)) + av.getColumnSelection().removeElement(res); else - return; + { + av.getColumnSelection().addElement(res); - SequenceGroup sg = new SequenceGroup(); - for(int i=0; isg.getStartRes()) - sg.setEndRes(res); - else if(res sg.getStartRes()) + sg.setEndRes(res); + else if (res < sg.getStartRes()) + sg.setStartRes(res); + + ap.RefreshPanels(); + } } } -- 1.7.10.2