X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FFormatAdapter.java;h=4d8794f5326f6654d651418bf081ba4937cd5e38;hb=121a4b153bdd56b15ff2c528e6b84219affc09d5;hp=ce584f2ca44b1441b32514a0e539261f344af912;hpb=95ebbef7b78bf266a8252bd479510be3c80cd234;p=jalview.git diff --git a/src/jalview/io/FormatAdapter.java b/src/jalview/io/FormatAdapter.java index ce584f2..4d8794f 100755 --- a/src/jalview/io/FormatAdapter.java +++ b/src/jalview/io/FormatAdapter.java @@ -26,13 +26,14 @@ import jalview.bin.Cache; import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; -import jalview.datamodel.ColumnSelection; +import jalview.datamodel.HiddenColumns; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; import jalview.util.Comparison; import java.io.IOException; +import java.util.Locale; /** * Additional formatting methods used by the application in a number of places. @@ -116,8 +117,8 @@ public class FormatAdapter extends AppletFormatAdapter startIndex = startEnd[0]; endIndex = startEnd[1]; // get first non-gaped residue start position - while (Comparison.isGap(seqs[i] - .getCharAt(startIndex)) && startIndex < endIndex) + while (Comparison.isGap(seqs[i].getCharAt(startIndex)) + && startIndex < endIndex) { startIndex++; } @@ -161,18 +162,19 @@ public class FormatAdapter extends AppletFormatAdapter public boolean getCacheSuffixDefault(FileFormatI format) { - return Cache.getDefault(format.getName() + "_JVSUFFIX", true); + return Cache.getDefault(format.getName().toUpperCase(Locale.ROOT) + "_JVSUFFIX", + true); } public String formatSequences(FileFormatI format, AlignmentI alignment, - String[] omitHidden, int[] exportRange, ColumnSelection colSel) + String[] omitHidden, int[] exportRange, HiddenColumns hidden) { return formatSequences(format, alignment, omitHidden, exportRange, - getCacheSuffixDefault(format), colSel, null); + getCacheSuffixDefault(format), hidden, null); } /** - * hack function to replace seuqences with visible sequence strings before + * hack function to replace sequences with visible sequence strings before * generating a string of the alignment in the given format. * * @param format @@ -185,15 +187,15 @@ public class FormatAdapter extends AppletFormatAdapter */ public String formatSequences(FileFormatI format, AlignmentI alignment, String[] omitHidden, int[] exportRange, boolean suffix, - ColumnSelection colSel) + HiddenColumns hidden) { return formatSequences(format, alignment, omitHidden, exportRange, - suffix, colSel, null); + suffix, hidden, null); } public String formatSequences(FileFormatI format, AlignmentI alignment, String[] omitHidden, int[] exportRange, boolean suffix, - ColumnSelection colSel, SequenceGroup selgp) + HiddenColumns hidden, SequenceGroup selgp) { if (omitHidden != null) { @@ -211,12 +213,12 @@ public class FormatAdapter extends AppletFormatAdapter AlignmentAnnotation na = new AlignmentAnnotation(ala[i]); if (selgp != null) { - colSel.makeVisibleAnnotation(selgp.getStartRes(), - selgp.getEndRes(), na); + na.makeVisibleAnnotation(selgp.getStartRes(), selgp.getEndRes(), + hidden); } else { - colSel.makeVisibleAnnotation(na); + na.makeVisibleAnnotation(hidden); } alv.addAnnotation(na); } @@ -258,8 +260,8 @@ public class FormatAdapter extends AppletFormatAdapter selectedOnly); } - public AlignmentI readFromFile(AlignmentFileI source, FileFormatI format) - throws IOException + public AlignmentI readFromFile(AlignmentFileReaderI source, + FileFormatI format) throws IOException { FileParse fp = new FileParse(source.getInFile(), source.getDataSourceType());