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
+ if(desc!=null || label2!=null)\r
+ {\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, title,\r
JMenu structureMenu = new JMenu();\r
JMenu viewStructureMenu = new JMenu();\r
JMenu colStructureMenu = new JMenu();\r
+ JMenuItem editSequence = new JMenuItem();\r
\r
/**\r
* Creates a new PopupMenu object.\r
structureMenu.setText("Structure");\r
viewStructureMenu.setText("View Structure");\r
colStructureMenu.setText("Colour By Structure");\r
+ editSequence.setText("Edit Sequence...");\r
+ editSequence.addActionListener(new ActionListener()\r
+ {\r
+ public void actionPerformed(ActionEvent actionEvent)\r
+ {\r
+ editSequence_actionPerformed(actionEvent);\r
+ }\r
+ });\r
\r
add(groupMenu);\r
\r
colourMenu.add(conservationMenuItem);\r
editMenu.add(copy);\r
editMenu.add(cut);\r
+ editMenu.add(editSequence);\r
editMenu.add(upperCase);\r
editMenu.add(lowerCase);\r
editMenu.add(toggle);\r
sequence.addAlignmentAnnotation(an);\r
\r
}\r
+\r
+ public void editSequence_actionPerformed(ActionEvent actionEvent)\r
+ {\r
+ SequenceGroup sg = ap.av.getSelectionGroup();\r
+\r
+ if(sg!=null)\r
+ {\r
+ if (sequence == null)\r
+ sequence = (Sequence) sg.getSequenceAt(0);\r
+\r
+ EditNameDialog dialog = new EditNameDialog(\r
+ sequence.getSequenceAsString(\r
+ sg.getStartRes(),\r
+ sg.getEndRes() + 1),\r
+ null,\r
+ "Edit Sequence ",\r
+ null,\r
+ "Edit Sequence");\r
+\r
+ if (dialog.accept)\r
+ {\r
+ EditCommand editCommand = new EditCommand(\r
+ "Edit Sequences", EditCommand.REPLACE,\r
+ dialog.getName(),\r
+ sg.getSequencesAsArray(ap.av.hiddenRepSequences),\r
+ sg.getStartRes(), sg.getEndRes() + 1, ap.av.alignment\r
+ );\r
+\r
+ ap.alignFrame.addHistoryItem(editCommand);\r
+\r
+ ap.av.firePropertyChange("alignment", null,\r
+ ap.av.getAlignment().getSequences());\r
+ }\r
+ }\r
+ }\r
}\r