No more supergroup, set Sequence name / Description
authoramwaterhouse <Andrew Waterhouse>
Wed, 15 Feb 2006 15:23:03 +0000 (15:23 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 15 Feb 2006 15:23:03 +0000 (15:23 +0000)
src/jalview/gui/PopupMenu.java

index 07b9fec..3114211 100755 (executable)
@@ -263,7 +263,7 @@ public class PopupMenu extends JPopupMenu
                 }\r
             });\r
         sequenceMenu.setText("Sequence");\r
-        sequenceName.setText("Edit name");\r
+        sequenceName.setText("Edit Name/Desciption");\r
         sequenceName.addActionListener(new java.awt.event.ActionListener()\r
             {\r
                 public void actionPerformed(ActionEvent e)\r
@@ -495,16 +495,6 @@ public class PopupMenu extends JPopupMenu
      */\r
     void refresh()\r
     {\r
-        SequenceGroup sg = getGroup();\r
-        if(sg!=null)\r
-        {\r
-          SuperGroup superG = ap.av.alignment.getSuperGroup(sg);\r
-\r
-          if (superG != null)\r
-          {\r
-            superG.setSuperGroupProperties(sg);\r
-          }\r
-        }\r
         if (ap.overviewPanel != null)\r
           ap.overviewPanel.updateOverviewImage();\r
 \r
@@ -806,11 +796,34 @@ public class PopupMenu extends JPopupMenu
      */\r
     void sequenceName_actionPerformed(ActionEvent e)\r
     {\r
-        String id = sequence.getName();\r
-        String s = (String) JOptionPane.showInternalInputDialog(ap,\r
-                "Edit sequence name",\r
-                "Edit sequence name (" + sequence.getName() + ")",\r
-                JOptionPane.PLAIN_MESSAGE, null, null, id);\r
+      JLabel idlabel = new JLabel(  "       Sequence Name ");\r
+      JLabel desclabel = new JLabel("Sequence Description ");\r
+      idlabel.setFont(new Font("Courier", Font.PLAIN, 12));\r
+      desclabel.setFont(new Font("Courier", Font.PLAIN, 12));\r
+      JTextField id = new JTextField(sequence.getName(), 40);\r
+      JTextField description = new JTextField(sequence.getDescription(), 40);\r
+      JPanel panel = new JPanel(new BorderLayout());\r
+      JPanel panel2 = new JPanel(new BorderLayout());\r
+      panel2.add(idlabel, BorderLayout.WEST);\r
+      panel2.add(id, BorderLayout.CENTER);\r
+      panel.add(panel2, BorderLayout.NORTH);\r
+      panel2 = new JPanel(new BorderLayout());\r
+      panel2.add(desclabel, BorderLayout.WEST);\r
+      panel2.add(description, BorderLayout.CENTER);\r
+      panel.add(panel2, BorderLayout.SOUTH);\r
+\r
+\r
+       int reply = JOptionPane.showInternalConfirmDialog(Desktop.desktop,\r
+          panel, "Edit Sequence Name/Description",\r
+          JOptionPane.OK_CANCEL_OPTION );\r
+\r
+\r
+        if (reply != JOptionPane.OK_OPTION )\r
+        {\r
+            return;\r
+        }\r
+\r
+        String s = id.getText();\r
 \r
         if (s != null)\r
         {\r
@@ -827,6 +840,9 @@ public class PopupMenu extends JPopupMenu
             sequence.setName(s);\r
             ap.repaint();\r
         }\r
+\r
+        sequence.getDatasetSequence().setDescription(description.getText());\r
+        sequence.setDescription(description.getText());\r
     }\r
 \r
     /**\r