X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationExporter.java;h=a23496d3b38fb25e70fc163418e650c18fade4f4;hb=0ebbad305e982eeda562a1842362dc415c36cc8d;hp=1efd100bc9543709b44061634bfeb2c5a71e1771;hpb=57738a1f3c19b1c3a00bd3ac5108f8cd0af32f99;p=jalview.git diff --git a/src/jalview/gui/AnnotationExporter.java b/src/jalview/gui/AnnotationExporter.java index 1efd100..a23496d 100644 --- a/src/jalview/gui/AnnotationExporter.java +++ b/src/jalview/gui/AnnotationExporter.java @@ -20,24 +20,13 @@ */ package jalview.gui; -import java.util.Locale; - -import jalview.api.FeatureRenderer; -import jalview.bin.Cache; -import jalview.datamodel.AlignmentAnnotation; -import jalview.datamodel.SequenceI; -import jalview.io.AnnotationFile; -import jalview.io.FeaturesFile; -import jalview.io.JalviewFileChooser; -import jalview.io.JalviewFileView; -import jalview.util.MessageManager; - import java.awt.Color; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.FileWriter; import java.io.PrintWriter; +import java.util.Locale; import javax.swing.BoxLayout; import javax.swing.ButtonGroup; @@ -50,6 +39,16 @@ import javax.swing.JPanel; import javax.swing.JRadioButton; import javax.swing.SwingConstants; +import jalview.api.FeatureRenderer; +import jalview.bin.Cache; +import jalview.datamodel.AlignmentAnnotation; +import jalview.datamodel.SequenceI; +import jalview.io.AnnotationFile; +import jalview.io.FeaturesFile; +import jalview.io.JalviewFileChooser; +import jalview.io.JalviewFileView; +import jalview.util.MessageManager; + /** * * GUI dialog for exporting features or alignment annotations depending upon @@ -108,6 +107,7 @@ public class AnnotationExporter extends JPanel } frame = new JInternalFrame(); + frame.setFrameIcon(null); frame.setContentPane(this); frame.setLayer(JLayeredPane.PALETTE_LAYER); Dimension preferredSize = frame.getPreferredSize(); @@ -163,6 +163,14 @@ public class AnnotationExporter extends JPanel frame.setTitle(MessageManager.getString("label.export_annotations")); } + public void setExportAsCSV() + { + if (CSVFormat != null) + { + CSVFormat.setSelected(true); + } + } + private void toFile_actionPerformed() { // TODO: JAL-3048 JalviewFileChooser - Save option @@ -202,7 +210,7 @@ public class AnnotationExporter extends JPanel * * @return */ - private String getText() + public String getText() { return exportFeatures ? getFeaturesText() : getAnnotationsText(); } @@ -213,12 +221,14 @@ public class AnnotationExporter extends JPanel * * @return */ - private String getAnnotationsText() + public String getAnnotationsText() { String text; if (CSVFormat.isSelected()) { - text = new AnnotationFile().printCSVAnnotations(annotations); + text = new AnnotationFile().printCSVAnnotations( + wholeView ? ap.av.getAlignment().getAlignmentAnnotation() + : annotations); } else { @@ -241,7 +251,7 @@ public class AnnotationExporter extends JPanel * * @return */ - private String getFeaturesText() + public String getFeaturesText() { String text; SequenceI[] sequences = ap.av.getAlignment().getSequencesArray();