No spaces allowed in sequence name
authoramwaterhouse <Andrew Waterhouse>
Tue, 14 Jun 2005 10:41:52 +0000 (10:41 +0000)
committeramwaterhouse <Andrew Waterhouse>
Tue, 14 Jun 2005 10:41:52 +0000 (10:41 +0000)
src/jalview/gui/PopupMenu.java

index d563e09..6a36fb3 100755 (executable)
@@ -96,6 +96,9 @@ public class PopupMenu
       e.printStackTrace();\r
     }\r
 \r
+    if(seq.getPDBId()==null)\r
+      pdbMenuItem.setVisible(false);\r
+\r
     SequenceGroup sg = ap.av.getSelectionGroup();\r
 \r
     if (sg != null)\r
@@ -624,8 +627,12 @@ public class PopupMenu
 \r
     if (s != null)\r
     {\r
-      sequence.setName(s);\r
-      ap.repaint();\r
+      if(s.indexOf(" ")>-1)\r
+        JOptionPane.showMessageDialog(ap, "Spaces have been converted to \"_\"",\r
+            "No spaces allowed in Sequence Name", JOptionPane.WARNING_MESSAGE);\r
+        s = s.replace(' ', '_');\r
+        sequence.setName(s);\r
+        ap.repaint();\r
     }\r
   }\r
 \r