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
JAL-4239 Using own id generation to avoid Random.nextLong() not implemented in jalviewjs
[jalview.git]
/
src
/
jalview
/
io
/
ModellerDescription.java
diff --git
a/src/jalview/io/ModellerDescription.java
b/src/jalview/io/ModellerDescription.java
index
a7a1efa
..
e184d74
100755
(executable)
--- a/
src/jalview/io/ModellerDescription.java
+++ b/
src/jalview/io/ModellerDescription.java
@@
-1,6
+1,6
@@
/*
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
- * Copyright (C) 2015 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
*
* This file is part of Jalview.
*
@@
-20,8
+20,14
@@
*/
package jalview.io;
*/
package jalview.io;
+import jalview.bin.Cache;
+import jalview.datamodel.DBRefEntry;
import jalview.datamodel.SequenceI;
import jalview.datamodel.SequenceI;
+import java.util.List;
+
+import com.stevesoft.pat.Regex;
+
public class ModellerDescription
{
/**
public class ModellerDescription
{
/**
@@
-61,7
+67,8
@@
public class ModellerDescription
*/
final int Types[] = { 0, 0, 1, 0, 1, 0, 0, 0, 0, 0 };
*/
final int Types[] = { 0, 0, 1, 0, 1, 0, 0, 0, 0, 0 };
- final char Padding[] = { ' ', ' ', ' ', '.', ' ', '.', '.', '.', '.', '.' };
+ final char Padding[] = { ' ', ' ', ' ', '.', ' ', '.', '.', '.', '.',
+ '.' };
java.util.Hashtable fields = new java.util.Hashtable();
java.util.Hashtable fields = new java.util.Hashtable();
@@
-84,7
+91,7
@@
public class ModellerDescription
resCode(int v)
{
resCode(int v)
{
- val = new Integer(v);
+ val = Integer.valueOf(v);
field = val.toString();
}
};
field = val.toString();
}
};
@@
-92,8
+99,7
@@
public class ModellerDescription
private resCode validResidueCode(String field)
{
Integer val = null;
private resCode validResidueCode(String field)
{
Integer val = null;
- com.stevesoft.pat.Regex r = new com.stevesoft.pat.Regex(
- "\\s*((([-0-9]+).?)|FIRST|LAST|@)");
+ Regex r = new Regex("\\s*((([-0-9]+).?)|FIRST|LAST|@)");
if (!r.search(field))
{
if (!r.search(field))
{
@@
-104,7
+110,7
@@
public class ModellerDescription
{
value = r.stringMatched(1);
}
{
value = r.stringMatched(1);
}
- // jalview.bin.Cache.log.debug("from '" + field + "' matched '" + value +
+ // Cache.debug("from '" + field + "' matched '" + value +
// "'");
try
{
// "'");
try
{
@@
-159,7
+165,7
@@
public class ModellerDescription
}
else
{
}
else
{
- // jalview.bin.Cache.log.debug(
+ // Cache.debug(
// "Ignoring non-Modeller description: invalid integer-like
// field '" + field + "'");
type = -1; /* invalid field! - throw the FieldSet away */
// "Ignoring non-Modeller description: invalid integer-like
// field '" + field + "'");
type = -1; /* invalid field! - throw the FieldSet away */
@@
-244,15
+250,15
@@
public class ModellerDescription
{
// Set start and end before we update the type (in the case of a
// synthesized field set)
{
// Set start and end before we update the type (in the case of a
// synthesized field set)
- if (getStartCode() == null
- || (getStartNum() != seq.getStart() && getStartCode().val != null))
+ if (getStartCode() == null || (getStartNum() != seq.getStart()
+ && getStartCode().val != null))
{
// unset or user updated sequence start position
setStartCode(seq.getStart());
}
{
// unset or user updated sequence start position
setStartCode(seq.getStart());
}
- if (getEndCode() == null
- || (getEndNum() != seq.getEnd() && getStartCode() != null && getStartCode().val != null))
+ if (getEndCode() == null || (getEndNum() != seq.getEnd()
+ && getStartCode() != null && getStartCode().val != null))
{
setEndCode(seq.getEnd());
}
{
setEndCode(seq.getEnd());
}
@@
-268,23
+274,21
@@
public class ModellerDescription
// sets the local reference field
int t = 0; // sequence
if (seq.getDatasetSequence() != null
// sets the local reference field
int t = 0; // sequence
if (seq.getDatasetSequence() != null
- && seq.getDatasetSequence().getDBRef() != null)
+ && seq.getDatasetSequence().getDBRefs() != null)
{
{
- jalview.datamodel.DBRefEntry[] dbr = seq.getDatasetSequence()
- .getDBRef();
- int i, j;
- for (i = 0, j = dbr.length; i < j; i++)
+ List<DBRefEntry> dbr = seq.getDatasetSequence().getDBRefs();
+ for (int i = 0, ni = dbr.size(); i < ni; i++)
{
{
- if (dbr[i] != null)
+ DBRefEntry dbri = dbr.get(i);
+ if (dbri != null)
{
// JBPNote PDB dbRefEntry needs properties to propagate onto
// ModellerField
// JBPNote Need to get info from the user about whether the sequence
// is the one being modelled, or if it is a template.
{
// JBPNote PDB dbRefEntry needs properties to propagate onto
// ModellerField
// JBPNote Need to get info from the user about whether the sequence
// is the one being modelled, or if it is a template.
- if (dbr[i].getSource()
- .equals(jalview.datamodel.DBRefSource.PDB))
+ if (dbri.getSource().equals(jalview.datamodel.DBRefSource.PDB))
{
{
- fields.put(Fields[LOCALID], dbr[i].getAccessionId());
+ fields.put(Fields[LOCALID], dbri.getAccessionId());
t = 2;
break;
}
t = 2;
break;
}