import jalview.datamodel.*;\r
import jalview.io.*;\r
\r
+/**\r
+ * \r
+ * GUI dialog for exporting features or alignment annotations depending upon which method is called.\r
+ * \r
+ * @author AMW\r
+ *\r
+ */\r
public class AnnotationExporter\r
extends JPanel\r
{\r
{\r
this.ap = ap;\r
features = true;\r
+ CSVFormat.setVisible(false);\r
frame.setTitle("Export Features");\r
}\r
\r
this.ap = ap;\r
features = false;\r
GFFFormat.setVisible(false);\r
+ CSVFormat.setVisible(true);\r
this.annotations = annotations;\r
this.sequenceGroups = sequenceGroups;\r
this.alignmentProperties = alProperties;\r
}\r
else\r
{\r
- text = new AnnotationFile().printAnnotations(\r
+ if (CSVFormat.isSelected())\r
+ {\r
+ text = new AnnotationFile().printCSVAnnotations(annotations);\r
+ } else {\r
+ text = new AnnotationFile().printAnnotations(\r
annotations,\r
sequenceGroups,\r
alignmentProperties);\r
+ }\r
}\r
\r
try\r
}\r
else if (!features)\r
{\r
- text = new AnnotationFile().printAnnotations(\r
+ if (CSVFormat.isSelected())\r
+ {\r
+ text = new AnnotationFile().printCSVAnnotations(annotations);\r
+ } else {\r
+ text = new AnnotationFile().printAnnotations(\r
annotations,\r
sequenceGroups,\r
alignmentProperties);\r
+ }\r
}\r
\r
CutAndPasteTransfer cap = new CutAndPasteTransfer();\r
jalviewFormat.setText("Jalview");\r
GFFFormat.setOpaque(false);\r
GFFFormat.setText("GFF");\r
+ CSVFormat.setOpaque(false);\r
+ CSVFormat.setText("CSV(Spreadsheet)");\r
jLabel1.setHorizontalAlignment(SwingConstants.TRAILING);\r
jLabel1.setText("Format: ");\r
this.setBackground(Color.white);\r
jPanel3.add(jLabel1);\r
jPanel3.add(jalviewFormat);\r
jPanel3.add(GFFFormat);\r
+ jPanel3.add(CSVFormat);\r
buttonGroup.add(jalviewFormat);\r
buttonGroup.add(GFFFormat);\r
+ buttonGroup.add(CSVFormat);\r
this.add(jPanel3, null);\r
this.add(jPanel1, null);\r
}\r
ButtonGroup buttonGroup = new ButtonGroup();\r
JRadioButton jalviewFormat = new JRadioButton();\r
JRadioButton GFFFormat = new JRadioButton();\r
+ JRadioButton CSVFormat = new JRadioButton();\r
JLabel jLabel1 = new JLabel();\r
JPanel jPanel3 = new JPanel();\r
FlowLayout flowLayout1 = new FlowLayout();\r