}
},
- Pileup("PileUp", "pileup", false, true)
+ Pileup("PileUp", "pileup", true, true)
{
@Override
public AlignmentFileI getAlignmentFile(String inFile,
}
},
- Features("GFF or Jalview features", "gff2,gff3", false, false)
+ Features("GFF or Jalview features", "gff2,gff3", true, false)
{
@Override
public AlignmentFileI getAlignmentFile(String inFile,
return new FeaturesFile();
}
},
- PDB("PDB", "", false, false)
+ PDB("PDB", "pdb,ent", true, false)
{
@Override
return new JmolParser(); // todo or null?
}
},
- MMCif("mmCIF", "cif", false, false)
+ MMCif("mmCIF", "cif", true, false)
{
@Override
return new JmolParser(); // todo or null?
}
},
- Jalview("Jalview", "jar,jvp", true, false)
+ Jalview("Jalview", "jar,jvp", true, true)
{
@Override
{
return null;
}
+
+ @Override
+ public boolean isTextFormat()
+ {
+ return false;
+ }
};
/**
*
* @return
*/
- public static List<String> getWritableFormats()
+ public static List<String> getWritableFormats(boolean textOnly)
{
List<String> l = new ArrayList<String>();
for (FileFormatI ff : values())
{
- if (ff.isWritable())
+ if (ff.isWritable() && (!textOnly || ff.isTextFormat()))
{
l.add(ff.toString());
}
{
return getAlignmentFile((AlignmentI) null);
}
+
+ @Override
+ public boolean isTextFormat()
+ {
+ return true;
+ }
}
AlignmentFileI getAlignmentFile(String inFile, DataSourceType sourceType)
throws IOException;
+ // TODO can we get rid of one of these methods?
AlignmentFileI getAlignmentFile(FileParse source) throws IOException;
AlignmentFileI getAlignmentFile(AlignmentI al);
*/
String getExtensions();
+ /**
+ * Answers true if the format is one that Jalview can read. This implies that
+ * the format provides implementations for getAlignmentFile(FileParse) and
+ * getAlignmentFile(String, DataSourceType) which parse the data source for
+ * sequence data.
+ *
+ * @return
+ */
boolean isReadable();
+ /**
+ * Answers true if the format is one that Jalview can write. This implies that
+ * the object returned by getAlignmentFile provides an implementation of the
+ * print() method.
+ *
+ * @return
+ */
boolean isWritable();
+
+ /**
+ * Answers true if the format is one that Jalview can output as text, e.g. to
+ * a text box
+ *
+ * @return
+ */
+ boolean isTextFormat();
}