Initial selection bug fixed
authoramwaterhouse <Andrew Waterhouse>
Thu, 13 Jan 2005 18:07:42 +0000 (18:07 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 13 Jan 2005 18:07:42 +0000 (18:07 +0000)
src/jalview/gui/IdPanel.java

index ff175aa..939a65e 100755 (executable)
@@ -110,7 +110,19 @@ public class IdPanel extends JPanel implements MouseListener, MouseMotionListene
     int y = e.getY();\r
     int seq = av.getIndex(y);\r
 \r
-    selectedSequenceGroup = av.getRubberbandGroup();\r
+    if (javax.swing.SwingUtilities.isRightMouseButton(e))\r
+    {\r
+      jalview.gui.PopupMenu pop = new jalview.gui.PopupMenu(alignPanel,\r
+          av.getAlignment().getSequenceAt(seq));\r
+      pop.show(this, e.getX(), y);\r
+      return;\r
+    }\r
+\r
+\r
+\r
+    if(av.getRubberbandGroup()!=null && (av.getRubberbandGroup().getSize() == av.getSelection().size()))\r
+          selectedSequenceGroup = av.getRubberbandGroup();\r
+\r
     if (selectedSequenceGroup == null)\r
     {\r
       selectedSequenceGroup = new SequenceGroup();\r
@@ -125,12 +137,6 @@ public class IdPanel extends JPanel implements MouseListener, MouseMotionListene
 \r
     lastid = seq;\r
 \r
-    if( javax.swing.SwingUtilities.isRightMouseButton(e))\r
-     {\r
-       jalview.gui.PopupMenu pop = new jalview.gui.PopupMenu(alignPanel, av.getAlignment().getSequenceAt(seq) );\r
-       pop.show(this, e.getX(), y);\r
-     }\r
-\r
 \r
     return;\r
   }\r