Right mouse brings up Popupmenu
authoramwaterhouse <Andrew Waterhouse>
Wed, 15 Dec 2004 17:17:51 +0000 (17:17 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 15 Dec 2004 17:17:51 +0000 (17:17 +0000)
src/jalview/gui/IdPanel.java

index 644d2ce..ff175aa 100755 (executable)
@@ -33,7 +33,8 @@ public class IdPanel extends JPanel implements MouseListener, MouseMotionListene
   public void mouseMoved(MouseEvent e) {}\r
 \r
   public void selectSeqs(int start, int end) {\r
-     if (end < start) {\r
+     if (end < start)\r
+     {\r
        int tmp = start;\r
        start = end;\r
        end   = tmp;\r
@@ -74,9 +75,6 @@ public class IdPanel extends JPanel implements MouseListener, MouseMotionListene
     int y = e.getY();\r
     int seq = av.getIndex(y);\r
 \r
-\r
-\r
-\r
     if (seq < lastid)\r
       selectSeqs(lastid - 1, seq);\r
     else if (seq > lastid)\r
@@ -112,50 +110,28 @@ 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 (selectedSequenceGroup == null)\r
+    {\r
+      selectedSequenceGroup = new SequenceGroup();\r
+      av.setRubberbandGroup(selectedSequenceGroup);\r
+    }\r
 \r
-      if( javax.swing.SwingUtilities.isRightMouseButton(e))\r
-      {\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
-                    "Edit sequence name",\r
-                    JOptionPane.PLAIN_MESSAGE,\r
-                    null,\r
-                    null,\r
-                    id);\r
-\r
-        if(s!=null)\r
-        {\r
-          av.getAlignment().getSequenceAt(seq).setName(s);\r
-          alignPanel.RefreshPanels();\r
-        }*/\r
-\r
-      }\r
-      else\r
-      {\r
+    selectedSequenceGroup.setStartRes(0);\r
+    selectedSequenceGroup.setEndRes(av.getAlignment().getWidth() - 1);\r
 \r
-        selectedSequenceGroup = av.getRubberbandGroup();\r
-        if(selectedSequenceGroup==null)\r
-        {\r
-          selectedSequenceGroup = new SequenceGroup();\r
-          av.setRubberbandGroup(selectedSequenceGroup);\r
-        }\r
+    if (seq != -1)\r
+      selectSeqs(seq, seq);\r
 \r
-        selectedSequenceGroup.setStartRes(0);\r
-        selectedSequenceGroup.setEndRes( av.getAlignment().getWidth()-1 );\r
+    lastid = seq;\r
 \r
-       // selectedSequenceGroup = av.alignment.findGroup(seq);\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
-        if (seq != -1)\r
-          selectSeqs(seq,seq);\r
 \r
-        lastid = seq;\r
-      }\r
     return;\r
   }\r
 \r