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-4380 Added information to annotation tooltips when description is not present
[jalview.git]
/
src
/
jalview
/
datamodel
/
PDBEntry.java
diff --git
a/src/jalview/datamodel/PDBEntry.java
b/src/jalview/datamodel/PDBEntry.java
index
741ef07
..
ae8523d
100755
(executable)
--- a/
src/jalview/datamodel/PDBEntry.java
+++ b/
src/jalview/datamodel/PDBEntry.java
@@
-20,12
+20,13
@@
*/
package jalview.datamodel;
*/
package jalview.datamodel;
-import jalview.util.CaseInsensitiveString;
-
import java.util.Collections;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Hashtable;
+import jalview.io.StructureFile;
+import jalview.util.CaseInsensitiveString;
+
public class PDBEntry
{
public class PDBEntry
{
@@
-39,11
+40,14
@@
public class PDBEntry
private static final int PDB_ID_LENGTH = 4;
/**
private static final int PDB_ID_LENGTH = 4;
/**
- * property set when id is a 'manufactured' identifier from the structure data's filename
+ * property set when id is a 'manufactured' identifier from the structure
+ * data's filename
*/
private static final String FAKED_ID = "faked_pdbid";
*/
private static final String FAKED_ID = "faked_pdbid";
+
/**
/**
- * property set when the id is authoritative, and should be used in preference to any identifiers in the structure data
+ * property set when the id is authoritative, and should be used in preference
+ * to any identifiers in the structure data
*/
private static final String AUTHORITATIVE_ID = "authoritative_pdbid";
*/
private static final String AUTHORITATIVE_ID = "authoritative_pdbid";
@@
-53,11
+57,14
@@
public class PDBEntry
private String id;
private String id;
+ private StructureFile sf = null;
+
public enum Type
{
// TODO is FILE needed; if not is this enum needed, or can we
// use FileFormatI for PDB, MMCIF?
public enum Type
{
// TODO is FILE needed; if not is this enum needed, or can we
// use FileFormatI for PDB, MMCIF?
- PDB("pdb", "pdb"), MMCIF("mmcif", "cif"), BCIF("bcif","bcif"),FILE("?", "?");
+ PDB("pdb", "pdb"), MMCIF("mmcif", "cif"), BCIF("bcif", "bcif"),
+ FILE("?", "?");
/*
* file extension for cached structure file; must be one that
/*
* file extension for cached structure file; must be one that
@@
-493,12
+500,12
@@
public class PDBEntry
}
return true;
}
}
return true;
}
-
+
public void setAuthoritative(boolean isAuthoritative)
{
setProperty(AUTHORITATIVE_ID, Boolean.valueOf(isAuthoritative));
}
public void setAuthoritative(boolean isAuthoritative)
{
setProperty(AUTHORITATIVE_ID, Boolean.valueOf(isAuthoritative));
}
-
+
/**
*
* @return true if the identifier should be preferred over any identifiers
/**
*
* @return true if the identifier should be preferred over any identifiers
@@
-508,13
+515,14
@@
public class PDBEntry
{
if (_hasProperty(AUTHORITATIVE_ID))
{
{
if (_hasProperty(AUTHORITATIVE_ID))
{
- return ((Boolean)getProperty(AUTHORITATIVE_ID));
+ return ((Boolean) getProperty(AUTHORITATIVE_ID));
}
return false;
}
/**
* set when Jalview has manufactured the ID using a local filename
}
return false;
}
/**
* set when Jalview has manufactured the ID using a local filename
+ *
* @return
*/
public boolean fakedPDBId()
* @return
*/
public boolean fakedPDBId()
@@
-525,15
+533,17
@@
public class PDBEntry
}
return false;
}
}
return false;
}
+
public void setFakedPDBId(boolean faked)
{
if (faked)
{
setProperty(FAKED_ID, Boolean.TRUE);
}
public void setFakedPDBId(boolean faked)
{
if (faked)
{
setProperty(FAKED_ID, Boolean.TRUE);
}
- else
+ else
{
{
- if (properties!=null) {
+ if (properties != null)
+ {
properties.remove(FAKED_ID);
}
}
properties.remove(FAKED_ID);
}
}
@@
-619,4
+629,19
@@
public class PDBEntry
{
return _hasProperty(PROVIDER);
}
{
return _hasProperty(PROVIDER);
}
+
+ public StructureFile getStructureFile()
+ {
+ return sf;
+ }
+
+ public void setStructureFile(StructureFile f)
+ {
+ sf = f;
+ }
+
+ public boolean hasStructureFile()
+ {
+ return sf != null && sf.inFile != null && sf.inFile.exists();
+ }
}
}