X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fext%2Fjmol%2FJmolParser.java;h=d37975d59cc071bfa90a912c981edf3df468ed25;hb=f14ab8c56014768bb0f94df591e83511aa506bdd;hp=c73657f8e3e1fc2e9f007f8a426b81eb1be30d73;hpb=e97cd6659f6bcac55dc030e770192b0044960dc5;p=jalview.git diff --git a/src/jalview/ext/jmol/JmolParser.java b/src/jalview/ext/jmol/JmolParser.java index c73657f..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 @@ -124,12 +124,11 @@ public class JmolParser extends StructureFile implements JmolStatusListener try { /* - * params -o (output to sysout) -i (no info logging, less verbose) - * -n (nodisplay) -x (exit when finished) + * params -o (output to sysout) -n (nodisplay) -x (exit when finished) * see http://wiki.jmol.org/index.php/Jmol_Application */ viewer = (Viewer) JmolViewer.allocateViewer(null, null, null, null, - null, "-x -o -n -i", this); + null, "-x -o -n", this); // ensure the 'new' (DSSP) not 'old' (Ramachandran) SS method is used viewer.setBooleanProperty("defaultStructureDSSP", true); } catch (ClassCastException x) @@ -155,10 +154,12 @@ public class JmolParser extends StructureFile implements JmolStatusListener if (pdbId == null) { setId(safeName(getDataName())); + setPDBIdAvailable(false); } else { setId(pdbId); + setPDBIdAvailable(true); } List significantAtoms = convertSignificantAtoms(ms); for (Atom tmpatom : significantAtoms) @@ -185,6 +186,14 @@ public class JmolParser extends StructureFile implements JmolStatusListener makeResidueList(); makeCaBondList(); + if (getId() == null) + { + // 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); @@ -471,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; } @@ -625,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; }