From c5db2e1951d834169caae93721d3af96391784ad Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Tue, 14 Dec 2004 14:50:31 +0000 Subject: [PATCH] Can now select groups using column selection --- src/jalview/gui/ScalePanel.java | 68 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 5 deletions(-) diff --git a/src/jalview/gui/ScalePanel.java b/src/jalview/gui/ScalePanel.java index 73be873..e2fd20b 100755 --- a/src/jalview/gui/ScalePanel.java +++ b/src/jalview/gui/ScalePanel.java @@ -1,8 +1,8 @@ package jalview.gui; +import jalview.datamodel.*; import java.awt.*; import java.awt.event.*; - import javax.swing.*; public class ScalePanel extends JPanel @@ -14,9 +14,12 @@ public class ScalePanel extends JPanel public int width; protected AlignViewport av; + AlignmentPanel ap; - public ScalePanel(AlignViewport av) { + public ScalePanel(AlignViewport av, AlignmentPanel ap) + { this.av = av; + this.ap = ap; scaleCanvas = new ScaleCanvas(av); setLayout(new BorderLayout()); @@ -27,7 +30,20 @@ public class ScalePanel extends JPanel { doMousePressed(evt); } + public void mouseReleased(MouseEvent evt) + { + doMouseReleased(evt); + } + + }); + addMouseMotionListener(new MouseMotionAdapter() + { + public void mouseDragged(MouseEvent evt) + { + doMouseDragged(evt); + } }); + } public Dimension getMinimumSize() { @@ -44,9 +60,51 @@ public class ScalePanel extends JPanel if (! av.getColumnSelection().contains(res)) av.getColumnSelection().addElement(res); - else - av.getColumnSelection().removeElement(res); + else + return; + + SequenceGroup sg = new SequenceGroup(); + for(int i=0; isg.getStartRes()) + sg.setEndRes(res); + else if(ressg.getStartRes()) + sg.setEndRes(res); + else if(res