X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FPDBEntry.java;h=8debacfbe1a23e7197bbbac25a0ab297ff6b1d1c;hb=136c0793b90b72b928c4d77dc109dd5c644e00d3;hp=3cba683f2342a16272322b8fbe3a53922a20824f;hpb=3ab582bfeeab1563bedf60e97994e63e672d2e31;p=jalview.git diff --git a/src/jalview/datamodel/PDBEntry.java b/src/jalview/datamodel/PDBEntry.java index 3cba683..8debacf 100755 --- a/src/jalview/datamodel/PDBEntry.java +++ b/src/jalview/datamodel/PDBEntry.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2) - * 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. * @@ -46,7 +46,38 @@ public class PDBEntry public enum Type { - PDB, MMCIF, FILE; + // TODO is FILE needed; if not is this enum needed, or can we + // use FileFormatI for PDB, MMCIF? + PDB("pdb", "pdb"), MMCIF("mmcif", "cif"), FILE("?", "?"); + + /* + * file extension for cached structure file; must be one that + * is recognised by Chimera 'open' command + * @see https://www.cgl.ucsf.edu/chimera/current/docs/UsersGuide/filetypes.html + */ + String ext; + + /* + * format specifier used in dbfetch request + * @see http://www.ebi.ac.uk/Tools/dbfetch/dbfetch/dbfetch.databases#pdb + */ + String format; + + private Type(String fmt, String ex) + { + format = fmt; + ext = ex; + } + + public String getFormat() + { + return format; + } + public String getExtension() + { + return ext; + } + /** * case insensitive matching for Type enum * @@ -77,7 +108,6 @@ public class PDBEntry } } - /** * Answers true if obj is a PDBEntry with the same id and chain code (both * ignoring case), file, type and properties @@ -121,16 +151,6 @@ public class PDBEntry { } - /** - * Constructor given file path and PDB id. - * - * @param filePath - */ - // public PDBEntry(String filePath, String pdbId) - // { - // this.file = filePath; - // this.id = pdbId; - // } public PDBEntry(String pdbId, String chain, PDBEntry.Type type, String filePath)