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
boolean features = true;\r
AlignmentAnnotation[] annotations;\r
Vector sequenceGroups;\r
+ Hashtable alignmentProperties;\r
\r
public AnnotationExporter()\r
{\r
{\r
this.ap = ap;\r
features = true;\r
+ CSVFormat.setVisible(false);\r
frame.setTitle("Export Features");\r
}\r
\r
public void exportAnnotations(AlignmentPanel ap,\r
AlignmentAnnotation[] annotations,\r
- Vector sequenceGroups)\r
+ Vector sequenceGroups,\r
+ Hashtable alProperties)\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
frame.setTitle("Export Annotations");\r
}\r
\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
+ sequenceGroups,\r
+ alignmentProperties);\r
+ }\r
}\r
\r
try\r
ex.printStackTrace();\r
}\r
}\r
+\r
+ close_actionPerformed(null);\r
}\r
\r
public void toTextbox_actionPerformed(ActionEvent e)\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
+ sequenceGroups,\r
+ alignmentProperties);\r
+ }\r
}\r
\r
CutAndPasteTransfer cap = new CutAndPasteTransfer();\r
600,\r
500);\r
\r
+ close_actionPerformed(null);\r
}\r
\r
public void close_actionPerformed(ActionEvent e)\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