X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fext%2Fjmol%2FJmolParser.java;h=d37975d59cc071bfa90a912c981edf3df468ed25;hb=f14ab8c56014768bb0f94df591e83511aa506bdd;hp=ca45d7b0ea02b0a590b9e64558ebba809672df40;hpb=9c66e390c2195d640a50bb645655c12158454f1e;p=jalview.git diff --git a/src/jalview/ext/jmol/JmolParser.java b/src/jalview/ext/jmol/JmolParser.java index ca45d7b..d37975d 100644 --- a/src/jalview/ext/jmol/JmolParser.java +++ b/src/jalview/ext/jmol/JmolParser.java @@ -24,6 +24,7 @@ import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.Annotation; import jalview.datamodel.PDBEntry; import jalview.datamodel.SequenceI; +import jalview.io.DataSourceType; import jalview.io.FileParse; import jalview.io.StructureFile; import jalview.schemes.ResidueProperties; @@ -38,8 +39,6 @@ import java.util.List; import java.util.Map; import java.util.Vector; -import javajs.awt.Dimension; - import org.jmol.api.JmolStatusListener; import org.jmol.api.JmolViewer; import org.jmol.c.CBK; @@ -61,9 +60,10 @@ public class JmolParser extends StructureFile implements JmolStatusListener { Viewer viewer = null; - public JmolParser(String inFile, String type) throws IOException + public JmolParser(String inFile, DataSourceType sourceType) + throws IOException { - super(inFile, type); + super(inFile, sourceType); } public JmolParser(FileParse fp) throws IOException @@ -150,7 +150,17 @@ public class JmolParser extends StructureFile implements JmolStatusListener List prot = new ArrayList(); PDBChain tmpchain; String pdbId = (String) ms.getInfo(0, "title"); - setId(pdbId); + + if (pdbId == null) + { + setId(safeName(getDataName())); + setPDBIdAvailable(false); + } + else + { + setId(pdbId); + setPDBIdAvailable(true); + } List significantAtoms = convertSignificantAtoms(ms); for (Atom tmpatom : significantAtoms) { @@ -165,7 +175,7 @@ public class JmolParser extends StructureFile implements JmolStatusListener tmpchain.atoms.addElement(tmpatom); } catch (Exception e) { - tmpchain = new PDBChain(pdbId, tmpatom.chain); + tmpchain = new PDBChain(getId(), tmpatom.chain); getChains().add(tmpchain); tmpchain.atoms.addElement(tmpatom); } @@ -178,8 +188,12 @@ public class JmolParser extends StructureFile implements JmolStatusListener if (getId() == null) { - setId(safeName(getDataName())); + // always use resource name, not the hardwired file + // Does the value of ID get used ? Behaviour needs to be + // documented and tested + setId(getDataName()); } + for (PDBChain chain : getChains()) { SequenceI chainseq = postProcessChain(chain); @@ -466,7 +480,7 @@ public class JmolParser extends StructureFile implements JmolStatusListener * Not implemented - returns null */ @Override - public String print() + public String print(SequenceI[] seqs, boolean jvSuffix) { return null; } @@ -620,7 +634,7 @@ public class JmolParser extends StructureFile implements JmolStatusListener * Not implemented - returns null */ @Override - public Dimension resizeInnerPanel(String data) + public int[] resizeInnerPanel(String data) { return null; }