Sequence selection now done via popup menu
authoramwaterhouse <Andrew Waterhouse>
Tue, 14 Dec 2004 11:20:51 +0000 (11:20 +0000)
committeramwaterhouse <Andrew Waterhouse>
Tue, 14 Dec 2004 11:20:51 +0000 (11:20 +0000)
src/jalview/gui/IdPanel.java

index 14f60d5..644d2ce 100755 (executable)
@@ -53,7 +53,8 @@ public class IdPanel extends JPanel implements MouseListener, MouseMotionListene
          if(selectedSequenceGroup==null)\r
          {\r
            selectedSequenceGroup = new SequenceGroup();\r
-           av.alignment.addGroup( selectedSequenceGroup );\r
+           av.setRubberbandGroup( selectedSequenceGroup );\r
+          // av.alignment.addGroup( selectedSequenceGroup );\r
            selectedSequenceGroup.setStartRes(0);\r
            selectedSequenceGroup.setEndRes( pickedSeq.getSequence().length());\r
          }\r
@@ -114,7 +115,11 @@ public class IdPanel extends JPanel implements MouseListener, MouseMotionListene
 \r
       if( javax.swing.SwingUtilities.isRightMouseButton(e))\r
       {\r
-        String id = av.getAlignment().getSequenceAt(seq).getName();\r
+        jalview.gui.PopupMenu pop = new jalview.gui.PopupMenu( av , alignPanel.seqPanel);\r
+        pop.show(this, e.getX(), y);\r
+\r
+\r
+  /*      String id = av.getAlignment().getSequenceAt(seq).getName();\r
         String s = (String)JOptionPane.showInternalInputDialog(\r
                     this,\r
                     "Edit sequence name",\r
@@ -128,12 +133,23 @@ public class IdPanel extends JPanel implements MouseListener, MouseMotionListene
         {\r
           av.getAlignment().getSequenceAt(seq).setName(s);\r
           alignPanel.RefreshPanels();\r
-        }\r
+        }*/\r
 \r
       }\r
       else\r
       {\r
-        selectedSequenceGroup =  av.alignment.findGroup(seq);\r
+\r
+        selectedSequenceGroup = av.getRubberbandGroup();\r
+        if(selectedSequenceGroup==null)\r
+        {\r
+          selectedSequenceGroup = new SequenceGroup();\r
+          av.setRubberbandGroup(selectedSequenceGroup);\r
+        }\r
+\r
+        selectedSequenceGroup.setStartRes(0);\r
+        selectedSequenceGroup.setEndRes( av.getAlignment().getWidth()-1 );\r
+\r
+       // selectedSequenceGroup = av.alignment.findGroup(seq);\r
 \r
         if (seq != -1)\r
           selectSeqs(seq,seq);\r