Class MySaveFileListener

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.util.EventListener

    public class MySaveFileListener
    extends java.lang.Object
    implements java.awt.event.ActionListener
    Save an alignment to a specified File by the user. The alignment to be saved depends on the constructor used to instantiate this class, so that AFPChains and MultipleAlignments can be saved.

    The format to save the alignment depends on the Frame that generated the Action: from a sequence alignment a FatCat or FASTA formats are saved, and from a Jmol view an XML format is saved.

    Version:
    2.0 - adapted for MultipleAligments
    Author:
    Aleix Lafita
    • Constructor Detail

      • MySaveFileListener

        public MySaveFileListener​(AFPChain afpChain)
      • MySaveFileListener

        public MySaveFileListener​(AFPChain afpChain,
                                  MultipleAlignment msa)
        Constructor to avoid checking which of the two is null before instantiating this class. One of the two, or both, have to be null. If both are different than null the MultipleAlignment will be saved only.
        Parameters:
        afpChain -
        msa -
    • Method Detail

      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent evt)
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
      • setTextOutput

        public void setTextOutput​(boolean text)
        If true, the alignment format saved will be a text output (FASTA for MultipleAlignments and FatCat for pairwise alignments)
        Parameters:
        text - if true the output will be text format