git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' into feature/JAL-3416_update_to_flatlaf_3.1.1_with_unpacked_na...
[jalview.git]
/
src
/
jalview
/
io
/
AlignFile.java
diff --git
a/src/jalview/io/AlignFile.java
b/src/jalview/io/AlignFile.java
index
3202ac9
..
b2cf262
100755
(executable)
--- a/
src/jalview/io/AlignFile.java
+++ b/
src/jalview/io/AlignFile.java
@@
-33,6
+33,7
@@
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
import jalview.util.MessageManager;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
import jalview.util.MessageManager;
+import jalview.util.StringUtils;
/**
* DOCUMENT ME!
/**
* DOCUMENT ME!
@@
-81,6
+82,8
@@
public abstract class AlignFile extends FileParse
private boolean dataClosed = false;
private boolean dataClosed = false;
+ private boolean doXferSettings = true;
+
/**
* @return if doParse() was called at construction time
*/
/**
* @return if doParse() was called at construction time
*/
@@
-151,6
+154,12
@@
public abstract class AlignFile extends FileParse
* @param source
* @throws IOException
*/
* @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(FileParse source) throws IOException
{
this(true, source);
@@
-173,12
+182,19
@@
public abstract class AlignFile extends FileParse
public AlignFile(boolean parseImmediately, FileParse source,
boolean closeData) throws IOException
{
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;
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)
{
if (parseImmediately)
{
@@
-205,7
+221,7
@@
public abstract class AlignFile extends FileParse
+ "Need to call initData() again before parsing can be reattempted.");
}
parseCalled = true;
+ "Need to call initData() again before parsing can be reattempted.");
}
parseCalled = true;
- parse();
+ parse(this.doXferSettings);
if (closeData && !dataClosed)
{
dataIn.close();
if (closeData && !dataClosed)
{
dataIn.close();
@@
-370,6
+386,18
@@
public abstract class AlignFile extends FileParse
public abstract void parse() throws IOException;
/**
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
* A general parser for ids.
*
* @String id Id to be parsed
@@
-378,7
+406,7
@@
public abstract class AlignFile extends FileParse
{
Sequence seq = null;
id = id.trim();
{
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), "");
if (space > -1)
{
seq = new Sequence(id.substring(0, space), "");
@@
-451,4
+479,14
@@
public abstract class AlignFile extends FileParse
{
seqs.add(seq);
}
{
seqs.add(seq);
}
+
+ public void setDoXferSettings(boolean b)
+ {
+ doXferSettings = b;
+ }
+
+ public boolean getDoXferSettings()
+ {
+ return doXferSettings;
+ }
}
}