X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationExporter.java;h=ab3f0d1006903cc74bc1024c64ff6e2bf55970cf;hb=ea7870f9bf9ae81876afbe3fdd4d9bd9022b4014;hp=41689c566a8004d98c270efe34489e887f90c764;hpb=808dbc924232872460e7bee1ce6374ff1292bfe6;p=jalview.git diff --git a/src/jalview/gui/AnnotationExporter.java b/src/jalview/gui/AnnotationExporter.java index 41689c5..ab3f0d1 100755 --- a/src/jalview/gui/AnnotationExporter.java +++ b/src/jalview/gui/AnnotationExporter.java @@ -28,6 +28,13 @@ import javax.swing.*; import jalview.datamodel.*; import jalview.io.*; +/** + * + * GUI dialog for exporting features or alignment annotations depending upon which method is called. + * + * @author AMW + * + */ public class AnnotationExporter extends JPanel { @@ -61,6 +68,7 @@ public class AnnotationExporter { this.ap = ap; features = true; + CSVFormat.setVisible(false); frame.setTitle("Export Features"); } @@ -72,6 +80,7 @@ public class AnnotationExporter this.ap = ap; features = false; GFFFormat.setVisible(false); + CSVFormat.setVisible(true); this.annotations = annotations; this.sequenceGroups = sequenceGroups; this.alignmentProperties = alProperties; @@ -110,10 +119,15 @@ public class AnnotationExporter } else { - text = new AnnotationFile().printAnnotations( + if (CSVFormat.isSelected()) + { + text = new AnnotationFile().printCSVAnnotations(annotations); + } else { + text = new AnnotationFile().printAnnotations( annotations, sequenceGroups, alignmentProperties); + } } try @@ -153,10 +167,15 @@ public class AnnotationExporter } else if (!features) { - text = new AnnotationFile().printAnnotations( + if (CSVFormat.isSelected()) + { + text = new AnnotationFile().printCSVAnnotations(annotations); + } else { + text = new AnnotationFile().printAnnotations( annotations, sequenceGroups, alignmentProperties); + } } CutAndPasteTransfer cap = new CutAndPasteTransfer(); @@ -214,6 +233,8 @@ public class AnnotationExporter jalviewFormat.setText("Jalview"); GFFFormat.setOpaque(false); GFFFormat.setText("GFF"); + CSVFormat.setOpaque(false); + CSVFormat.setText("CSV(Spreadsheet)"); jLabel1.setHorizontalAlignment(SwingConstants.TRAILING); jLabel1.setText("Format: "); this.setBackground(Color.white); @@ -226,8 +247,10 @@ public class AnnotationExporter jPanel3.add(jLabel1); jPanel3.add(jalviewFormat); jPanel3.add(GFFFormat); + jPanel3.add(CSVFormat); buttonGroup.add(jalviewFormat); buttonGroup.add(GFFFormat); + buttonGroup.add(CSVFormat); this.add(jPanel3, null); this.add(jPanel1, null); } @@ -239,6 +262,7 @@ public class AnnotationExporter ButtonGroup buttonGroup = new ButtonGroup(); JRadioButton jalviewFormat = new JRadioButton(); JRadioButton GFFFormat = new JRadioButton(); + JRadioButton CSVFormat = new JRadioButton(); JLabel jLabel1 = new JLabel(); JPanel jPanel3 = new JPanel(); FlowLayout flowLayout1 = new FlowLayout();