From 113a10be0f01e898644fba0e6a6ba854c9d8e671 Mon Sep 17 00:00:00 2001 From: jprocter Date: Wed, 25 Aug 2010 14:12:10 +0000 Subject: [PATCH] excluded methods related to broken Jmol applet binding mechanism (JAL-621) and implemented default 'search all alignment' mode when opening a new PDB structure view --- src/jalview/appletgui/AlignFrame.java | 42 ++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index 388d20f..adb0da5 100755 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -3195,21 +3195,26 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, * create a new binding between structures in an existing jmol viewer instance * and an alignpanel with sequences that have existing PDBFile entries. Note, * this does not open a new Jmol window, or modify the display of the - * structures in the original jmol window. + * structures in the original jmol window. Note * * @param viewer JmolViewer instance * @param sequenceIds * - sequence Ids to search for associations - */ + * This method doesn't work. See http://issues.jalview.org/browse/JAL-621 + * public SequenceStructureBinding addStructureViewInstance(Object jmolviewer, String[] sequenceIds) { - org.jmol.api.JmolViewer viewer; - if (jmolviewer instanceof JmolViewer) - { + org.jmol.api.JmolViewer viewer=null; + try { + viewer = (org.jmol.api.JmolViewer) jmolviewer; + } + catch (ClassCastException ex) { System.err.println("Unsupported viewer object :"+jmolviewer.getClass()); + } + if (viewer==null) + { + System.err.println("Can't use this object as a structure viewer:"+jmolviewer.getClass()); return null; - } else { - viewer = (JmolViewer) jmolviewer; } SequenceI[] seqs=null; if (sequenceIds==null || sequenceIds.length==0) @@ -3230,6 +3235,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, { seqs[sid] = (SequenceI) sqi.elementAt(sid); } + } else { + return null; } } ExtJmol jmv=null; @@ -3241,7 +3248,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, return jmv; } - + **/ public boolean addPdbFile(String sequenceId, String pdbEntryString, String pdbFile) { @@ -3293,6 +3300,25 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, public void newStructureView(JalviewLite applet, PDBEntry pdb, SequenceI[] seqs, String[] chains, String protocol) { + if (seqs!=null) + { + Vector sequences=new Vector(); + for (int i=0;i