import java.util.Vector;
import jalview.datamodel.AlignmentAnnotation;
-import jalview.datamodel.AlignmentAnnotation.TFType;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
import jalview.util.MessageManager;
+import jalview.util.StringUtils;
/**
* DOCUMENT ME!
private boolean dataClosed = false;
- private AlignmentAnnotation.TFType temperatureFactorType = null;
-
- public AlignmentAnnotation.TFType getTemperatureFactorType()
- {
- return this.temperatureFactorType;
- }
+ private boolean doXferSettings = true;
/**
* @return if doParse() was called at construction time
public AlignFile(Object dataObject, DataSourceType sourceType)
throws IOException
{
- this(dataObject, sourceType, null);
- }
-
- public AlignFile(Object dataObject, DataSourceType sourceType,
- AlignmentAnnotation.TFType tempfacType) throws IOException
- {
- this(true, dataObject, sourceType, tempfacType);
+ this(true, dataObject, sourceType);
}
/**
public AlignFile(boolean parseImmediately, Object dataObject,
DataSourceType sourceType) throws IOException
{
- this(parseImmediately, dataObject, sourceType, null);
- }
-
- public AlignFile(boolean parseImmediately, Object dataObject,
- DataSourceType sourceType, AlignmentAnnotation.TFType tempfacType) throws IOException
- {
// BH allows File or String
super(dataObject, sourceType);
initData();
- this.temperatureFactorType = tempfacType;
if (parseImmediately)
{
doParse();
* @param source
* @throws IOException
*/
+ public AlignFile(FileParse source, boolean doXferSettings)
+ throws IOException
+ {
+ this(true, source, true, doXferSettings);
+ }
+
public AlignFile(FileParse source) throws IOException
{
this(true, source);
public AlignFile(boolean parseImmediately, FileParse source,
boolean closeData) throws IOException
{
+ this(parseImmediately, source, closeData, true);
+ }
+
+ public AlignFile(boolean parseImmediately, FileParse source,
+ boolean closeData, boolean doXferSettings) throws IOException
+ {
super(source);
initData();
// stash flag in case parse needs to know if it has to autoconfigure or was
// configured after construction
this.parseImmediately = parseImmediately;
+ this.doXferSettings = doXferSettings;
if (parseImmediately)
{
+ "Need to call initData() again before parsing can be reattempted.");
}
parseCalled = true;
- parse();
+ parse(this.doXferSettings);
if (closeData && !dataClosed)
{
dataIn.close();
public abstract void parse() throws IOException;
/**
+ * This method is only overridden by JmolParser because of its use in
+ * StructureFile to parse annotations
+ *
+ * @param doXferSettings
+ * @throws IOException
+ */
+ public void parse(boolean doXferSettings) throws IOException
+ {
+ parse();
+ }
+
+ /**
* A general parser for ids.
*
* @String id Id to be parsed
{
Sequence seq = null;
id = id.trim();
- int space = id.indexOf(" ");
+ int space = StringUtils.indexOfFirstWhitespace(id);
if (space > -1)
{
seq = new Sequence(id.substring(0, space), "");
{
seqs.add(seq);
}
+
+ public void setDoXferSettings(boolean b)
+ {
+ doXferSettings = b;
+ }
+
+ public boolean getDoXferSettings()
+ {
+ return doXferSettings;
+ }
}