X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignFrame.java;h=f678915495c6a373d72a4a0913f171aae42d3ae2;hb=cab9f54d732ed7b127140efd5f3b923accd10eb4;hp=70752be30d4286c0764c90e4fa99359fc900e0f6;hpb=ec8b46fcbc994a7c3c0bb6e07235cdb564c3991d;p=jalview.git diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 70752be..f678915 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -59,9 +59,13 @@ public class AlignFrame Vector alignPanels = new Vector(); - /** DOCUMENT ME!! */ + /** + * Last format used to load or save alignments in this window + */ String currentFileFormat = null; - + /** + * Current filename for this alignment + */ String fileName = null; @@ -498,14 +502,17 @@ public class AlignFrame showTranslation.setVisible( nucleotide ); conservationMenuItem.setEnabled( !nucleotide ); modifyConservation.setEnabled( !nucleotide ); - + //Remember AlignFrame always starts as protein if(!nucleotide) { calculateMenu.remove(calculateMenu.getItemCount()-2); } + setShowProductsEnabled(); } + + /** * Need to call this method when tabs are selected for multiple views, * or when loading from Jalview2XML.java @@ -690,9 +697,9 @@ public class AlignFrame JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache. getProperty( "LAST_DIRECTORY"), new String[] - { "fa, fasta, fastq", "aln", "pfam", "msf", "pir", "blc","jar" }, + { "fa, fasta, fastq", "aln", "pfam", "msf", "pir", "blc","amsa","jar" }, new String[] - { "Fasta", "Clustal", "PFAM", "MSF", "PIR", "BLC", "Jalview" }, + { "Fasta", "Clustal", "PFAM", "MSF", "PIR", "BLC", "AMSA", "Jalview" }, currentFileFormat, false); @@ -722,7 +729,10 @@ public class AlignFrame currentFileFormat); jalview.bin.Cache.setProperty("LAST_DIRECTORY", fileName); - + if (currentFileFormat.indexOf(" ")>-1) + { + currentFileFormat = currentFileFormat.substring(0, currentFileFormat.indexOf(" ")); + } saveAlignment(fileName, currentFileFormat); } } @@ -766,11 +776,12 @@ public class AlignFrame omitHidden = viewport.getViewAsString(false); } } + FormatAdapter f = new FormatAdapter(); - String output = new FormatAdapter().formatSequences( + String output = f.formatSequences( format, - viewport.alignment.getSequencesArray(), - omitHidden); + (Alignment) viewport.alignment, // class cast exceptions will occur in the distant future + omitHidden, f.getCacheSuffixDefault(format)); if (output == null) { @@ -841,7 +852,7 @@ public class AlignFrame cap.setText(new FormatAdapter().formatSequences( e.getActionCommand(), - viewport.alignment.getSequencesArray(), + viewport.alignment, omitHidden)); } @@ -1619,19 +1630,17 @@ public class AlignFrame AlignmentAnnotation sann[] = sequences[i].getAnnotation(); if (sann == null) continue; - for (int avnum = 0; avnum < alview.length; avnum++) + for (int avnum=0;avnum