X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=blobdiff_plain;f=src%2Fjalview%2Fio%2FAlignFile.java;fp=src%2Fjalview%2Fio%2FAlignFile.java;h=b2cf26206199ccfa2f02206d224fa3528f1eca27;hp=123394034e3d60dd058ec6ec4231deabac1ca7e0;hb=f680b9a507cc1643c9eead990e15026c1eca4e6e;hpb=265e81c0b3599a09c312f17188e3a892e9d96c4e diff --git a/src/jalview/io/AlignFile.java b/src/jalview/io/AlignFile.java index 1233940..b2cf262 100755 --- a/src/jalview/io/AlignFile.java +++ b/src/jalview/io/AlignFile.java @@ -82,6 +82,8 @@ public abstract class AlignFile extends FileParse private boolean dataClosed = false; + private boolean doXferSettings = true; + /** * @return if doParse() was called at construction time */ @@ -152,6 +154,12 @@ public abstract class AlignFile extends FileParse * @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); @@ -174,12 +182,19 @@ public abstract class AlignFile extends FileParse 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) { @@ -206,7 +221,7 @@ public abstract class AlignFile extends FileParse + "Need to call initData() again before parsing can be reattempted."); } parseCalled = true; - parse(); + parse(this.doXferSettings); if (closeData && !dataClosed) { dataIn.close(); @@ -371,6 +386,18 @@ public abstract class AlignFile extends FileParse 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 @@ -452,4 +479,14 @@ public abstract class AlignFile extends FileParse { seqs.add(seq); } + + public void setDoXferSettings(boolean b) + { + doXferSettings = b; + } + + public boolean getDoXferSettings() + { + return doXferSettings; + } }