selections sent when mouse is released (drags on ID panel)
[jalview.git] / src / jalview / gui / IdPanel.java
index 8f748a8..b5c2186 100755 (executable)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
- * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
+ * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
  * 
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -82,7 +82,8 @@ public class IdPanel extends JPanel implements MouseListener,
    */
   public void mouseMoved(MouseEvent e)
   {
-    int seq = Math.max(0, alignPanel.seqPanel.findSeq(e));
+    SeqPanel sp = alignPanel.seqPanel;
+    int seq = Math.max(0, sp.findSeq(e));
     String tmp;
     if (seq > -1 && seq < av.alignment.getHeight())
     {
@@ -122,7 +123,7 @@ public class IdPanel extends JPanel implements MouseListener,
           {
             int sz = -tip.length();
             tfeat[0] = features[i];
-            SeqPanel.appendFeatures(tip, linkImageURL, 0, tfeat);
+            sp.appendFeatures(tip, linkImageURL, 0, tfeat,sp.seqCanvas.fr.minmax);
             sz+=tip.length();
             maxWidth = Math.max(maxWidth, sz);
           }
@@ -162,7 +163,7 @@ public class IdPanel extends JPanel implements MouseListener,
     {
       selectSeqs(lastid + 1, seq);
     }
-
+    
     lastid = seq;
     alignPanel.paintAlignment(true);
   }
@@ -352,7 +353,6 @@ public class IdPanel extends JPanel implements MouseListener,
     {
       selectSeq(seq);
     }
-    av.sendSelection();
     alignPanel.paintAlignment(true);
   }
 
@@ -406,7 +406,6 @@ public class IdPanel extends JPanel implements MouseListener,
               av.getAlignment().getSequenceAt(i), true);
     }
   }
-
   /**
    * DOCUMENT ME!
    * 
@@ -419,6 +418,12 @@ public class IdPanel extends JPanel implements MouseListener,
     {
       scrollThread.running = false;
     }
+//    if (mouseDragging)
+    {
+      // always send selection message when mouse is released
+      av.sendSelection();
+      
+    }
 
     mouseDragging = false;
     PaintRefresher.Refresh(this, av.getSequenceSetId());