X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FPDBEntry.java;h=fc4ee46b5439fe587c5135d464c02f03185e27eb;hb=cf02a7088e2835fa4764d034e662f4319073c8a9;hp=b3e17bf43e29fc6c30786639e931cfada239d8a9;hpb=00c42e936827790e689ecd5ff7d7781ecabe2313;p=jalview.git diff --git a/src/jalview/datamodel/PDBEntry.java b/src/jalview/datamodel/PDBEntry.java index b3e17bf..fc4ee46 100755 --- a/src/jalview/datamodel/PDBEntry.java +++ b/src/jalview/datamodel/PDBEntry.java @@ -38,6 +38,8 @@ public class PDBEntry private static final int PDB_ID_LENGTH = 4; + private static final String FAKED_ID = "faked_pdbid"; + private String file; private String type; @@ -404,7 +406,10 @@ public class PDBEntry // this shouldn't happen, but could do if the id from the // file is not the same as the id from the authority that provided // the file - return false; + if (!newEntry.fakedPDBId()) + { + return false; + } // otherwise we can update } } } @@ -469,6 +474,11 @@ public class PDBEntry */ String key = newProps.nextElement(); Object value = newEntry.getProperty(key); + if (FAKED_ID.equals(key)) + { + // we never update the fake ID property + continue; + } if (!value.equals(getProperty(key))) { setProperty(key, value); @@ -477,6 +487,32 @@ public class PDBEntry return true; } + /** + * set when Jalview has manufactured the ID using a local filename + * @return + */ + public boolean fakedPDBId() + { + if (_hasProperty(FAKED_ID)) + { + return true; + } + return false; + } + public void setFakedPDBId(boolean faked) + { + if (faked) + { + setProperty(FAKED_ID, Boolean.TRUE); + } + else + { + if (properties!=null) { + properties.remove(FAKED_ID); + } + } + } + private boolean _hasProperty(final String key) { return (properties != null && properties.containsKey(key));