From: Jim Procter Date: Fri, 15 Nov 2024 11:42:31 +0000 (+0000) Subject: JAL-3914 tidy up convenience methods for get/set PDBEntry metadata X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=9d9daa8ff97976f3b2bb6dacb17717cbc189f21e;p=jalview.git JAL-3914 tidy up convenience methods for get/set PDBEntry metadata --- diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index b77ee85..8d19518 100644 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -4086,7 +4086,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, } if (needtoadd) { - pdbentry.setProperty("protocol", protocol); + pdbentry.setProtocol(protocol); toaddpdb.addPDBId(pdbentry); alignPanel.getStructureSelectionManager() .registerPDBEntry(pdbentry); diff --git a/src/jalview/appletgui/AppletJmol.java b/src/jalview/appletgui/AppletJmol.java index cca9aff..8172569 100644 --- a/src/jalview/appletgui/AppletJmol.java +++ b/src/jalview/appletgui/AppletJmol.java @@ -293,7 +293,7 @@ public class AppletJmol extends EmbmenuFrame implements closeViewer(); } }); - pdbentry.setProperty("protocol", protocol); + pdbentry.setProtocol(protocol); if (pdbentry.getFile() != null) { diff --git a/src/jalview/datamodel/PDBEntry.java b/src/jalview/datamodel/PDBEntry.java index 9246744..6385210 100755 --- a/src/jalview/datamodel/PDBEntry.java +++ b/src/jalview/datamodel/PDBEntry.java @@ -24,6 +24,7 @@ import java.util.Collections; import java.util.Enumeration; import java.util.Hashtable; +import jalview.io.DataSourceType; import jalview.io.StructureFile; import jalview.structure.StructureImportSettings.TFType; import jalview.util.CaseInsensitiveString; @@ -563,7 +564,6 @@ public class PDBEntry private static final String PROVIDERCATEGORY = "PROVIDERCATEGORY"; - private static final String TEMPFACTYPE = "TEMPFACTYPE"; private static final String MODELCONFIDENCE = "MODELCONFIDENCE"; @@ -571,6 +571,10 @@ public class PDBEntry private static final String MODELCONFVER = "MODELCONFVER"; + // Pre 2.11.4 properties - case preserved + private static final String TEMPFACTYPE = "TFType"; + private static final String PAEFILE = "PAEFile"; + private final static String PROTOCOL="protocol"; /** * Permanent URI for retrieving the original structure data @@ -739,5 +743,30 @@ public class PDBEntry { return (Double) getProperty(MODELCONFIDENCE); } + + public void setPAEFile(String paeFilename) + { + setProperty(PAEFILE,paeFilename); + } + public String getPAEFile() + { + return (String) getProperty(PAEFILE); + } + public boolean hasPAEFile() + { + return _hasProperty(PAEFILE); + } -} + public void setProtocol(DataSourceType protocol) + { + setProperty(PROTOCOL, protocol.name()); + } + public boolean hasProtocol() + { + return _hasProperty(PROTOCOL); + } + public DataSourceType getProtocol() + { + return DataSourceType.valueOf((String) getProperty(PROTOCOL)); + } +} \ No newline at end of file diff --git a/src/jalview/gui/AssociatePdbFileWithSeq.java b/src/jalview/gui/AssociatePdbFileWithSeq.java index b2689be..0a57cf1 100644 --- a/src/jalview/gui/AssociatePdbFileWithSeq.java +++ b/src/jalview/gui/AssociatePdbFileWithSeq.java @@ -58,6 +58,7 @@ public class AssociatePdbFileWithSeq String paeFilename, boolean doXferSettings) { PDBEntry entry = new PDBEntry(); + StructureFile pdbfile = StructureSelectionManager .getStructureSelectionManager(ssmp) .setMapping(false, new SequenceI[] @@ -102,9 +103,9 @@ public class AssociatePdbFileWithSeq .registerPDBEntry(entry); } if (tft != null) - entry.setProperty("TFType", tft.name()); + entry.setTempFacType(tft); if (paeFilename != null) - entry.setProperty("PAEFile", paeFilename); + entry.setPAEFile(paeFilename); return entry; } }