From: jprocter Date: Mon, 15 Aug 2011 13:55:34 +0000 (+0100) Subject: JAL-747 - warning dialog if Jalview can't resolve filename for a structure in a Jmol... X-Git-Tag: Release_2_7~110 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=cd38270d99eb947976778b39f218a4072e9e393b;p=jalview.git JAL-747 - warning dialog if Jalview can't resolve filename for a structure in a Jmol view. --- diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index e639844..1a9bc03 100644 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -2602,22 +2602,32 @@ public class Jalview2XML jmoldat[1] = ids[p].getStructureState(s).getContent(); } } - Object[] seqstrmaps = (Object[]) ((Hashtable) jmoldat[2]) - .get(ids[p].getFile()); - if (seqstrmaps == null) + if (ids[p].getFile() != null) { - ((Hashtable) jmoldat[2]).put( - new File(ids[p].getFile()).toString(), - seqstrmaps = new Object[] - { pdbFile, ids[p].getId(), new Vector(), - new Vector() }); + Object[] seqstrmaps = (Object[]) ((Hashtable) jmoldat[2]) + .get(ids[p].getFile()); + if (seqstrmaps == null) + { + ((Hashtable) jmoldat[2]).put( + new File(ids[p].getFile()).toString(), + seqstrmaps = new Object[] + { pdbFile, ids[p].getId(), new Vector(), + new Vector() }); + } + if (!((Vector) seqstrmaps[2]).contains(seq)) + { + ((Vector) seqstrmaps[2]).addElement(seq); + // ((Vector)seqstrmaps[3]).addElement(n) : + // in principle, chains + // should be stored here : do we need to + // TODO: store and recover seq/pdb_id : + // chain mappings + } } - if (!((Vector) seqstrmaps[2]).contains(seq)) + else { - ((Vector) seqstrmaps[2]).addElement(seq); - // ((Vector)seqstrmaps[3]).addElement(n) : in principle, chains - // should be stored here : do we need to - // TODO: store and recover seq/pdb_id : chain mappings + errorMessage=("The Jmol views in the Jalview 2 project may\nnot be correctly bound to sequences in the alignment.\nIn the case of problems, see note at\nhttp://issues.jalview.org/browse/JAL-747"); + warn(errorMessage); } } }