*/
package jalview.gui;
-import java.util.*;
-
-import java.awt.*;
-import java.awt.event.*;
-
-import javax.swing.*;
-
-import jalview.analysis.*;
-import jalview.commands.*;
-import jalview.datamodel.*;
-import jalview.io.*;
-import jalview.schemes.*;
+import jalview.analysis.AAFrequency;
+import jalview.analysis.Conservation;
+import jalview.commands.ChangeCaseCommand;
+import jalview.commands.EditCommand;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.AlignmentView;
+import jalview.datamodel.Annotation;
+import jalview.datamodel.DBRefEntry;
+import jalview.datamodel.PDBEntry;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceFeature;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+import jalview.io.FormatAdapter;
+import jalview.io.SequenceAnnotationReport;
+import jalview.schemes.AnnotationColourGradient;
+import jalview.schemes.Blosum62ColourScheme;
+import jalview.schemes.BuriedColourScheme;
+import jalview.schemes.ClustalxColourScheme;
+import jalview.schemes.HelixColourScheme;
+import jalview.schemes.HydrophobicColourScheme;
+import jalview.schemes.NucleotideColourScheme;
+import jalview.schemes.PIDColourScheme;
+import jalview.schemes.PurinePyrimidineColourScheme;
+import jalview.schemes.ResidueProperties;
+import jalview.schemes.StrandColourScheme;
+import jalview.schemes.TaylorColourScheme;
+import jalview.schemes.TurnColourScheme;
+import jalview.schemes.UserColourScheme;
+import jalview.schemes.ZappoColourScheme;
import jalview.util.GroupUrlLink;
import jalview.util.GroupUrlLink.UrlStringTooLongException;
import jalview.util.MessageManager;
import jalview.util.UrlLink;
+import java.awt.Color;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Vector;
+
+import javax.swing.ButtonGroup;
+import javax.swing.JCheckBoxMenuItem;
+import javax.swing.JColorChooser;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPopupMenu;
+import javax.swing.JRadioButtonMenuItem;
+
/**
* DOCUMENT ME!
*
{
// TODO re JAL-860: optionally open dialog or provide a menu entry
// allowing user to open just one structure per sequence
- //new AppJmol(pdb, ap.av.collateForPDB(new PDBEntry[]
- //{ pdb })[0], null, ap);
+ // new AppJmol(pdb, ap.av.collateForPDB(new PDBEntry[]
+ // { pdb })[0], null, ap);
new StructureViewer(ap.getStructureSelectionManager())
.viewStructures(pdb,
ap.av.collateForPDB(new PDBEntry[]
{
Vector<PDBEntry> pes = (Vector<PDBEntry>) sq.getDatasetSequence()
.getPDBId();
- if (pes != null && pes.size()>0)
+ if (pes != null && pes.size() > 0)
{
reppdb.put(pes.get(0).getId(), pes.get(0));
for (PDBEntry pe : pes)
@Override
public void actionPerformed(ActionEvent e)
{
- new StructureViewer(ap.getStructureSelectionManager()).viewStructures(ap, pe, ap.av.collateForPDB(pe));
+ new StructureViewer(ap.getStructureSelectionManager())
+ .viewStructures(ap, pe, ap.av.collateForPDB(pe));
}
});
if (reppdb.size() > 1 && reppdb.size() < pdbe.size())
@Override
public void actionPerformed(ActionEvent e)
{
- new StructureViewer(ap.getStructureSelectionManager()).viewStructures(ap, pr, ap.av.collateForPDB(pr));
+ new StructureViewer(ap.getStructureSelectionManager())
+ .viewStructures(ap, pr, ap.av.collateForPDB(pr));
}
});
}
System.out.println("PROMPT USER HERE"); // TODO: decide if a prompt happens
// or we simply trust the user wants
// wysiwig behaviour
- SequenceGroup sg = ap.av.getSelectionGroup();
- ColumnSelection csel = new ColumnSelection(ap.av.getColumnSelection());
- omitHidden = ap.av.getViewAsString(true);
- Alignment oal = new Alignment(ap.av.getSequenceSelection());
- AlignmentAnnotation[] nala = ap.av.getAlignment()
- .getAlignmentAnnotation();
- if (nala != null)
- {
- for (int i = 0; i < nala.length; i++)
- {
- AlignmentAnnotation na = nala[i];
- oal.addAnnotation(na);
- }
- }
- cap.setText(new FormatAdapter().formatSequences(e.getActionCommand(),
- oal, omitHidden, csel, sg));
- oal = null;
+
+ cap.setText(new FormatAdapter().formatSequences(e.getActionCommand(), ap.av, true));
}
public void pdbFromFile_actionPerformed()
import java.io.File;
import java.io.InputStream;
+import java.util.List;
+import jalview.api.AlignViewportI;
import jalview.datamodel.*;
/**
* method
*/
public static final String[] WRITEABLE_FORMATS = new String[]
- { "BLC", "CLUSTAL", "FASTA", "MSF", "PileUp", "PIR", "PFAM", "AMSA" };
+ { "BLC", "CLUSTAL", "FASTA", "MSF", "PileUp", "PIR", "PFAM", "AMSA", "STH" };
/**
* List of extensions corresponding to file format types in WRITABLE_FNAMES
}
}
+
+ /**
+ * create an alignment flatfile from a Jalview alignment view
+ * @param format
+ * @param jvsuffix
+ * @param av
+ * @param selectedOnly
+ * @return flatfile in a string
+ */
+ public String formatSequences(String format, boolean jvsuffix,
+ AlignViewportI av, boolean selectedOnly)
+ {
+
+ AlignmentView selvew = av.getAlignmentView(selectedOnly, false);
+ AlignmentI aselview = selvew.getVisibleAlignment(av
+ .getGapCharacter());
+ List<AlignmentAnnotation> ala = (av
+ .getVisibleAlignmentAnnotation(selectedOnly));
+ if (ala != null)
+ {
+ for (AlignmentAnnotation aa : ala)
+ {
+ aselview.addAnnotation(aa);
+ }
+ }
+
+ return formatSequences(format, aselview, jvsuffix);
+ }
+
/**
* Construct an output class for an alignment in a particular filetype TODO:
* allow caller to detect errors and warnings encountered when generating