*/
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;
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
}
frame = new JInternalFrame();
+ frame.setFrameIcon(null);
frame.setContentPane(this);
frame.setLayer(JLayeredPane.PALETTE_LAYER);
Dimension preferredSize = frame.getPreferredSize();
}
/**
- * Configures the dialog for options to export visible features. If from a split
- * frame panel showing linked features, make the option to include these in the
- * export visible.
+ * Configures the dialog for options to export visible features. If from a
+ * split frame panel showing linked features, make the option to include these
+ * in the export visible.
*/
public void exportFeatures()
{
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
}
/**
- * Answers the text to output for either Features (in GFF or Jalview format) or
- * Annotations (in CSV or Jalview format)
+ * Answers the text to output for either Features (in GFF or Jalview format)
+ * or Annotations (in CSV or Jalview format)
*
* @return
*/
- private String getText()
+ public String getText()
{
return exportFeatures ? getFeaturesText() : getAnnotationsText();
}
/**
- * Returns the text contents for output of annotations in either CSV or Jalview
- * format
+ * Returns the text contents for output of annotations in either CSV or
+ * Jalview format
*
* @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
{
*
* @return
*/
- private String getFeaturesText()
+ public String getFeaturesText()
{
String text;
SequenceI[] sequences = ap.av.getAlignment().getSequencesArray();
}
/**
- * Builds a panel with a checkbox for the option to export linked (CDS/peptide)
- * features. This is hidden by default, and only made visible if exporting
- * features from a split frame panel which is configured to show linked
- * features.
+ * Builds a panel with a checkbox for the option to export linked
+ * (CDS/peptide) features. This is hidden by default, and only made visible if
+ * exporting features from a split frame panel which is configured to show
+ * linked features.
*
* @return
*/
linkedFeaturesPanel.setOpaque(false);
boolean nucleotide = ap.av.isNucleotide();
- String complement = nucleotide
- ? MessageManager.getString("label.protein").toLowerCase(Locale.ROOT)
- : "CDS";
- JLabel label = new JLabel(
- MessageManager.formatMessage("label.include_linked_features",
- complement));
+ String complement = nucleotide ? MessageManager
+ .getString("label.protein").toLowerCase(Locale.ROOT) : "CDS";
+ JLabel label = new JLabel(MessageManager
+ .formatMessage("label.include_linked_features", complement));
label.setHorizontalAlignment(SwingConstants.TRAILING);
String tooltip = MessageManager
.formatMessage("label.include_linked_tooltip", complement);
- label.setToolTipText(
- JvSwingUtils.wrapTooltip(true, tooltip));
+ label.setToolTipText(JvSwingUtils.wrapTooltip(true, tooltip));
includeLinkedFeatures = new JCheckBox();
linkedFeaturesPanel.add(label);
}
/**
- * Builds the panel with options to output in Jalview, GFF or CSV format. GFF is
- * only made visible when exporting features, CSV only when exporting
+ * Builds the panel with options to output in Jalview, GFF or CSV format. GFF
+ * is only made visible when exporting features, CSV only when exporting
* annotation.
*
* @return