2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
23 import jalview.bin.Cache;
24 import jalview.datamodel.AlignmentI;
25 import jalview.datamodel.ColumnSelection;
26 import jalview.datamodel.SequenceGroup;
27 import jalview.datamodel.SequenceI;
28 import jalview.io.VamsasAppDatastore;
29 import jalview.structure.SelectionListener;
30 import jalview.structure.SelectionSource;
31 import jalview.structure.StructureSelectionManager;
32 import jalview.structure.VamsasListener;
33 import jalview.structure.VamsasSource;
34 import jalview.util.MessageManager;
35 import jalview.viewmodel.AlignmentViewport;
37 import java.beans.PropertyChangeEvent;
38 import java.beans.PropertyChangeListener;
40 import java.io.IOException;
41 import java.util.Hashtable;
42 import java.util.IdentityHashMap;
43 import java.util.Iterator;
45 import javax.swing.JInternalFrame;
46 import javax.swing.JOptionPane;
48 import uk.ac.vamsas.client.ClientHandle;
49 import uk.ac.vamsas.client.IClient;
50 import uk.ac.vamsas.client.IClientDocument;
51 import uk.ac.vamsas.client.InvalidSessionDocumentException;
52 import uk.ac.vamsas.client.UserHandle;
53 import uk.ac.vamsas.client.VorbaId;
54 import uk.ac.vamsas.client.picking.IMessageHandler;
55 import uk.ac.vamsas.client.picking.IPickManager;
56 import uk.ac.vamsas.client.picking.Message;
57 import uk.ac.vamsas.client.picking.MouseOverMessage;
58 import uk.ac.vamsas.client.picking.SelectionMessage;
59 import uk.ac.vamsas.objects.core.Entry;
60 import uk.ac.vamsas.objects.core.Input;
61 import uk.ac.vamsas.objects.core.Pos;
62 import uk.ac.vamsas.objects.core.Seg;
68 public class VamsasApplication implements SelectionSource, VamsasSource
70 IClient vclient = null;
72 ClientHandle app = null;
74 UserHandle user = null;
76 Desktop jdesktop = null; // our jalview desktop reference
78 private boolean inInitialUpdate = true;
80 // Cache.preferences for vamsas client session arena
81 // preferences for check for default session at startup.
82 // user and organisation stuff.
83 public VamsasApplication(Desktop jdesktop, File sessionPath,
87 // we should create a session URI from the sessionPath and pass it to
88 // the clientFactory - but the vamsas api doesn't cope with that yet.
89 this.jdesktop = jdesktop;
90 initClientSession(null, sessionPath, sessionName);
93 private static uk.ac.vamsas.client.IClientFactory getClientFactory()
96 return new uk.ac.vamsas.client.simpleclient.SimpleClientFactory();
100 * Start a new vamsas session
104 public VamsasApplication(Desktop jdesktop)
106 this.jdesktop = jdesktop;
107 initClientSession(null, null);
111 * init a connection to the session at the given url
116 public VamsasApplication(Desktop jdesktop, String sessionUrl)
118 this.jdesktop = jdesktop;
119 initClientSession(sessionUrl, null);
123 * @throws IOException
124 * or other if clientfactory instantiation failed.
125 * @return list of current sessions or null if no session exists.
127 public static String[] getSessionList() throws Exception
129 return getClientFactory().getCurrentSessions();
133 * initialise, possibly with either a valid session url or a file for a new
137 * null or a valid session url
138 * @param vamsasDocument
139 * null or a valid vamsas document file
140 * @return false if no vamsas connection was made
142 private void initClientSession(String sess, File vamsasDocument)
144 initClientSession(sess, vamsasDocument, null);
147 private boolean initClientSession(String sess, File vamsasDocument,
148 String newDocSessionName)
152 // Only need to tell the library what the application is here
153 app = getJalviewHandle();
154 uk.ac.vamsas.client.IClientFactory clientfactory = getClientFactory();
155 if (vamsasDocument != null)
161 .getString("error.implementation_error_cannot_import_vamsas_doc"));
165 if (newDocSessionName != null)
167 vclient = clientfactory.openAsNewSessionIClient(app,
168 vamsasDocument, newDocSessionName);
172 vclient = clientfactory.openAsNewSessionIClient(app,
175 } catch (InvalidSessionDocumentException e)
178 .showInternalMessageDialog(
182 .getString("label.vamsas_doc_couldnt_be_opened_as_new_session"),
184 .getString("label.vamsas_document_import_failed"),
185 JOptionPane.ERROR_MESSAGE);
191 // join existing or create a new session
194 vclient = clientfactory.getNewSessionIClient(app);
198 vclient = clientfactory.getIClient(app, sess);
201 // set some properties for our VAMSAS interaction
203 user = vclient.getUserHandle();
205 } catch (Exception e)
207 jalview.bin.Cache.log
208 .error("Couldn't instantiate vamsas client !", e);
214 private void setVclientConfig()
222 if (vclient instanceof uk.ac.vamsas.client.simpleclient.SimpleClient)
224 uk.ac.vamsas.client.simpleclient.SimpleClientConfig cfg = ((uk.ac.vamsas.client.simpleclient.SimpleClient) vclient)
225 .getSimpleClientConfig();
226 cfg._validatemergedroots = false;
227 cfg._validateupdatedroots = true; // we may write rubbish otherwise.
232 .warn("Probable SERIOUS VAMSAS client incompatibility - carrying on regardless",
234 } catch (Exception e)
237 .warn("Probable VAMSAS client incompatibility - carrying on regardless",
243 * make the appHandle for Jalview
247 private ClientHandle getJalviewHandle()
249 return new ClientHandle("jalview.bin.Jalview",
250 jalview.bin.Cache.getProperty("VERSION"));
255 * @return true if we are registered in a vamsas session
257 public boolean inSession()
259 return (vclient != null);
263 * called to connect to session inits handlers, does an initial document
266 public void initial_update()
272 .getString("error.implementation_error_vamsas_operation_not_init"));
274 addDocumentUpdateHandler();
275 addStoreDocumentHandler();
277 inInitialUpdate = true;
279 .debug("Jalview loading the Vamsas Session for the first time.");
280 dealWithDocumentUpdate(false); // we don't push an update out to the
281 inInitialUpdate = false;
283 Cache.log.debug("... finished update for the first time.");
287 * Update all windows after a vamsas datamodel change. this could go on the
291 protected void updateJalviewGui()
293 JInternalFrame[] frames = jdesktop.getAllFrames();
303 for (int i = frames.length - 1; i > -1; i--)
305 if (frames[i] instanceof AlignFrame)
307 AlignFrame af = (AlignFrame) frames[i];
308 af.alignPanel.alignmentChanged();
311 } catch (Exception e)
314 .warn("Exception whilst refreshing jalview windows after a vamsas document update.",
319 public void push_update()
321 Thread udthread = new Thread(new Runnable()
326 Cache.log.info("Jalview updating to the Vamsas Session.");
328 dealWithDocumentUpdate(true);
329 Cache.log.info("Jalview finished updating to the Vamsas Session.");
337 * leave a session, prompting the user to save if necessary
339 public void end_session()
344 private boolean promptUser = true;
347 * leave a session, optionally prompting the user to save if necessary
350 * when true enable prompting by this application
353 public void end_session(boolean promptUser)
359 .getString("error.jalview_no_connected_vamsas_session"));
361 Cache.log.info("Jalview disconnecting from the Vamsas Session.");
366 boolean ourprompt = this.promptUser;
367 this.promptUser = promptUser;
368 vclient.finalizeClient();
369 Cache.log.info("Jalview has left the session.");
370 this.promptUser = ourprompt; // restore default value
375 .warn("JV Client leaving a session that's its not joined yet.");
377 joinedSession = false;
383 } catch (Exception e)
385 Cache.log.error("Vamsas Session finalization threw exceptions!", e);
389 public void updateJalview(IClientDocument cdoc)
391 Cache.log.debug("Jalview updating from sesion document ..");
393 VamsasAppDatastore vds = new VamsasAppDatastore(cdoc, vobj2jv, jv2vobj,
394 baseProvEntry(), alRedoState);
397 vds.updateToJalview();
398 } catch (Exception e)
400 Cache.log.error("Failed to update Jalview from vamsas document.", e);
406 vds.updateJalviewFromAppdata();
407 // Comment this out to repeatedly read in data from JalviewAppData
408 // firstUpdate=false;
410 } catch (Exception e)
413 "Exception when updating Jalview settings from Appdata.", e);
415 Cache.log.debug(".. finished updating from sesion document.");
419 boolean firstUpdate = false;
421 private void ensureJvVamsas()
425 jv2vobj = new IdentityHashMap();
426 vobj2jv = new Hashtable();
427 alRedoState = new Hashtable();
433 * jalview object binding to VorbaIds
435 IdentityHashMap jv2vobj = null;
437 Hashtable vobj2jv = null;
439 Hashtable alRedoState = null;
441 boolean errorsDuringUpdate = false;
443 boolean errorsDuringAppUpdate = false;
446 * update the document accessed through doc. A backup of the current object
450 * @return number of views stored in document (updated and new views)
452 public int updateVamsasDocument(IClientDocument doc)
456 errorsDuringUpdate = false;
457 errorsDuringAppUpdate = false;
458 backup_objectMapping();
459 VamsasAppDatastore vds = new VamsasAppDatastore(doc, vobj2jv, jv2vobj,
460 baseProvEntry(), alRedoState);
461 // wander through frames
462 JInternalFrame[] frames = Desktop.desktop.getAllFrames();
468 Hashtable skipList = new Hashtable();
469 Hashtable viewset = new Hashtable();
474 for (int i = frames.length - 1; i > -1; i--)
476 if (frames[i] instanceof AlignFrame)
478 AlignFrame af = (AlignFrame) frames[i];
479 if (!viewset.containsKey(af.getViewport().getSequenceSetId()))
481 // update alignment and root from frame.
482 boolean stored = false;
485 stored = vds.storeVAMSAS(af.getViewport(), af.getTitle());
486 } catch (Exception e)
488 errorsDuringUpdate = true;
489 Cache.log.error("Exception synchronizing "
492 + (af.getViewport().viewName == null ? "" : " view "
493 + af.getViewport().viewName)
494 + " to document.", e);
498 { // record skip in skipList
499 skipList.put(af.getViewport().getSequenceSetId(), af);
504 // could try to eliminate sequenceSetId from skiplist ..
505 // (skipList.containsKey(af.getViewport().getSequenceSetId()))
506 // remember sequenceSetId so we can skip all the other views on
508 viewset.put(af.getViewport().getSequenceSetId(), af);
514 // for (int i = frames.length - 1; i > -1; i--)
516 // if (frames[i] instanceof AlignFrame)
518 // AlignFrame af = (AlignFrame) frames[i];
519 Iterator aframes = viewset.values().iterator();
520 while (aframes.hasNext())
522 AlignFrame af = (AlignFrame) aframes.next();
523 // add any AlignedCodonFrame mappings on this alignment to any other.
524 vds.storeSequenceMappings(af.getViewport(), af.getTitle());
526 } catch (Exception e)
528 Cache.log.error("Exception synchronizing Views to Document :", e);
529 errorsDuringUpdate = true;
534 if (viewset.size() > 0)
536 // Alignment views were synchronized, so store their state in the
538 // The skipList ensures we don't write out any alignments not actually
540 vds.setSkipList(skipList);
541 vds.updateJalviewClientAppdata();
543 } catch (Exception e)
545 Cache.log.error("Client Appdata Write exception", e);
546 errorsDuringAppUpdate = true;
552 private Entry baseProvEntry()
554 uk.ac.vamsas.objects.core.Entry pentry = new uk.ac.vamsas.objects.core.Entry();
555 pentry.setUser(user.getFullName());
556 pentry.setApp(app.getClientUrn());
557 pentry.setDate(new java.util.Date());
558 pentry.setAction("created");
563 * do a vamsas document update or update jalview from the vamsas document
566 * true to update from jalview to the vamsas document
567 * @return total number of stored alignments in the document after the update
569 protected int dealWithDocumentUpdate(boolean fromJalview)
572 // called by update handler for document update.
573 Cache.log.debug("Updating jalview from changed vamsas document.");
577 long time = System.currentTimeMillis();
578 IClientDocument cdoc = vclient.getClientDocument();
579 if (Cache.log.isDebugEnabled())
581 Cache.log.debug("Time taken to get ClientDocument = "
582 + (System.currentTimeMillis() - time));
583 time = System.currentTimeMillis();
587 storedviews += updateVamsasDocument(cdoc);
588 if (Cache.log.isDebugEnabled())
591 .debug("Time taken to update Vamsas Document from jalview\t= "
592 + (System.currentTimeMillis() - time));
593 time = System.currentTimeMillis();
595 cdoc.setVamsasRoots(cdoc.getVamsasRoots());
596 if (Cache.log.isDebugEnabled())
598 Cache.log.debug("Time taken to set Document Roots\t\t= "
599 + (System.currentTimeMillis() - time));
600 time = System.currentTimeMillis();
606 if (Cache.log.isDebugEnabled())
609 .debug("Time taken to update Jalview from vamsas document Roots\t= "
610 + (System.currentTimeMillis() - time));
611 time = System.currentTimeMillis();
615 vclient.updateDocument(cdoc);
616 if (Cache.log.isDebugEnabled())
618 Cache.log.debug("Time taken to update Session Document\t= "
619 + (System.currentTimeMillis() - time));
620 time = System.currentTimeMillis();
623 } catch (Exception ee)
625 System.err.println("Exception whilst updating :");
626 ee.printStackTrace(System.err);
627 // recover object map backup, since its probably corrupted with references
628 // to Vobjects that don't exist anymore.
629 recover_objectMappingBackup();
632 Cache.log.debug("Finished updating from document change.");
637 private void addDocumentUpdateHandler()
639 final VamsasApplication client = this;
640 vclient.addDocumentUpdateHandler(new PropertyChangeListener()
642 public void propertyChange(PropertyChangeEvent evt)
644 Cache.log.debug("Dealing with document update event.");
645 client.dealWithDocumentUpdate(false);
646 Cache.log.debug("finished dealing with event.");
649 Cache.log.debug("Added Jalview handler for vamsas document updates.");
652 private void addStoreDocumentHandler()
654 final VamsasApplication client = this;
655 vclient.addVorbaEventHandler(
656 uk.ac.vamsas.client.Events.DOCUMENT_REQUESTTOCLOSE,
657 new PropertyChangeListener()
659 public void propertyChange(PropertyChangeEvent evt)
661 if (client.promptUser)
664 .debug("Asking user if the vamsas session should be stored.");
665 int reply = JOptionPane
666 .showInternalConfirmDialog(
668 "The current VAMSAS session has unsaved data - do you want to save it ?",
669 "VAMSAS Session Shutdown",
670 JOptionPane.YES_NO_OPTION,
671 JOptionPane.QUESTION_MESSAGE);
673 if (reply == JOptionPane.YES_OPTION)
675 Cache.log.debug("Prompting for vamsas store filename.");
676 Desktop.instance.vamsasSave_actionPerformed(null);
678 .debug("Finished attempt at storing document.");
681 .debug("finished dealing with REQUESTTOCLOSE event.");
686 .debug("Ignoring store document request (promptUser==false)");
690 Cache.log.debug("Added Jalview handler for vamsas document updates.");
693 public void disableGui(boolean b)
695 Desktop.instance.setVamsasUpdate(b);
698 Hashtable _backup_vobj2jv;
700 IdentityHashMap _backup_jv2vobj;
703 * make a backup of the object mappings (vobj2jv and jv2vobj)
705 public void backup_objectMapping()
707 _backup_vobj2jv = new Hashtable(vobj2jv);
708 _backup_jv2vobj = new IdentityHashMap(jv2vobj);
712 * recover original object mappings from the object mapping backup if document
716 * if backup_objectMapping was not called.
718 public void recover_objectMappingBackup()
720 if (_backup_vobj2jv == null)
724 // nothing to recover so just
730 .getString("error.implementation_error_cannot_recover_vamsas_object_mappings"));
733 Iterator el = _backup_jv2vobj.entrySet().iterator();
736 java.util.Map.Entry mp = (java.util.Map.Entry) el.next();
737 jv2vobj.put(mp.getKey(), mp.getValue());
739 el = _backup_vobj2jv.entrySet().iterator();
742 java.util.Map.Entry mp = (java.util.Map.Entry) el.next();
743 vobj2jv.put(mp.getKey(), mp.getValue());
747 private boolean joinedSession = false;
749 private VamsasListener picker = null;
751 private SelectionListener selecter;
753 private void startSession()
759 vclient.joinSession();
760 joinedSession = true;
761 } catch (Exception e)
764 Cache.log.error("Failed to join vamsas session.", e);
769 final IPickManager pm = vclient.getPickManager();
770 final StructureSelectionManager ssm = StructureSelectionManager
771 .getStructureSelectionManager(Desktop.instance);
772 final VamsasApplication me = this;
773 pm.registerMessageHandler(new IMessageHandler()
777 public void handleMessage(Message message)
781 // we are not in a session yet.
784 if (message instanceof MouseOverMessage)
786 MouseOverMessage mm = (MouseOverMessage) message;
787 String mstring = mm.getVorbaID() + " " + mm.getPosition();
788 if (last != null && mstring.equals(last))
792 // if (Cache.log.isDebugEnabled())
794 // Cache.log.debug("Received MouseOverMessage "+mm.getVorbaID()+"
795 // "+mm.getPosition());
797 Object jvobj = vobj2jv.get(mm.getVorbaID());
798 if (jvobj != null && jvobj instanceof SequenceI)
801 // Cache.log.debug("Handling Mouse over "+mm.getVorbaID()+"
802 // bound to "+jvobj+" at "+mm.getPosition());
803 // position is character position in aligned sequence
804 ssm.mouseOverVamsasSequence((SequenceI) jvobj,
805 mm.getPosition(), me);
808 if (message instanceof uk.ac.vamsas.client.picking.SelectionMessage)
810 // we only care about AlignmentSequence selections
811 SelectionMessage sm = (SelectionMessage) message;
813 System.err.println("Received\n" + sm.getRawMessage());
814 Object[] jvobjs = sm.getVorbaIDs() == null ? null
815 : new Object[sm.getVorbaIDs().length];
818 // TODO: rationalise : can only clear a selection over a
819 // referred to object
820 ssm.sendSelection(null, null, me);
825 for (int o = 0; o < jvobjs.length; o++)
827 jvobjs[o] = vobj2jv.get(sm.getVorbaIDs()[o]);
828 if (jvobjs[o] == null)
830 // can't cope with selections for unmapped objects
835 type = jvobjs[o].getClass();
838 if (type != jvobjs[o].getClass())
841 // discard - can't cope with selections over mixed objects
845 SequenceGroup jselection = null;
846 ColumnSelection colsel = null;
847 if (type == jalview.datamodel.Alignment.class)
849 if (jvobjs.length == 1)
851 // TODO if (sm.isNone())// send a message to select the
852 // specified columns over the
859 if (type == jalview.datamodel.Sequence.class)
863 boolean aligned = ((jalview.datamodel.Sequence) jvobjs[0])
864 .getDatasetSequence() != null;
868 jselection = new SequenceGroup();
869 jselection.addSequence(
870 seq = (jalview.datamodel.Sequence) jvobjs[0],
872 maxWidth = seq.getLength();
874 for (int c = 1; aligned && jvobjs.length > 1
875 && c < jvobjs.length; c++)
877 if (((jalview.datamodel.Sequence) jvobjs[c])
878 .getDatasetSequence() == null)
885 jselection.addSequence(
886 seq = (jalview.datamodel.Sequence) jvobjs[c],
888 if (maxWidth < seq.getLength())
890 maxWidth = seq.getLength();
898 // if cardinality is greater than one then verify all
899 // sequences are alignment sequences.
900 if (jvobjs.length == 1)
902 // find all instances of this dataset sequence in the
903 // displayed alignments containing the associated range and
909 jselection.setStartRes(0);
910 jselection.setEndRes(maxWidth);
911 // locate the alignment containing the given sequences and
912 // select the associated ranges on them.
913 if (sm.getRanges() != null)
915 int[] prange = uk.ac.vamsas.objects.utils.Range
916 .getBounds(sm.getRanges());
917 jselection.setStartRes(prange[0] - 1);
918 jselection.setEndRes(prange[1] - 1);
919 prange = uk.ac.vamsas.objects.utils.Range
920 .getIntervals(sm.getRanges());
921 colsel = new ColumnSelection();
922 for (int p = 0; p < prange.length; p += 2)
924 int d = (prange[p] <= prange[p + 1]) ? 1 : -1;
925 // try to join up adjacent columns to make a larger
927 // lower and upper bounds
928 int l = (d < 0) ? 1 : 0;
929 int u = (d > 0) ? 1 : 0;
931 if (jselection.getStartRes() > 0
932 && prange[p + l] == jselection.getStartRes())
934 jselection.setStartRes(prange[p + l] - 1);
936 if (jselection.getEndRes() <= maxWidth
937 && prange[p + u] == (jselection.getEndRes() + 2))
939 jselection.setEndRes(prange[p + u] - 1);
941 // mark all the columns in the range.
942 for (int sr = prange[p], er = prange[p + 1], de = er
943 + d; sr != de; sr += d)
945 colsel.addElement(sr - 1);
954 ssm.sendSelection(jselection, colsel, me);
957 for (int c = 0; c < jvobjs.length; c++)
967 picker = new VamsasListener()
969 SequenceI last = null;
974 public void mouseOverSequence(SequenceI seq, int index,
981 if (seq != last || i != index)
983 VorbaId v = (VorbaId) jv2vobj.get(seq);
986 // this should really be a trace message.
987 // Cache.log.debug("Mouse over " + v.getId() + " bound to "
988 // + seq + " at " + index);
991 MouseOverMessage message = new MouseOverMessage(v.getId(),
993 pm.sendMessage(message);
998 selecter = new SelectionListener()
1001 public void selection(SequenceGroup seqsel,
1002 ColumnSelection colsel, SelectionSource source)
1004 if (vobj2jv == null)
1007 .warn("Selection listener still active for dead session.");
1008 // not in a session.
1013 AlignmentI visal = null;
1014 if (source instanceof AlignViewport)
1016 visal = ((AlignmentViewport) source).getAlignment();
1018 SelectionMessage sm = null;
1019 if ((seqsel == null || seqsel.getSize() == 0)
1020 && (colsel == null || colsel.getSelected() == null || colsel
1021 .getSelected().size() == 0))
1023 if (source instanceof AlignViewport)
1025 // the empty selection.
1026 sm = new SelectionMessage("jalview",
1027 new String[] { ((AlignmentViewport) source)
1028 .getSequenceSetId() }, null, true);
1032 // the empty selection.
1033 sm = new SelectionMessage("jalview", null, null, true);
1038 String[] vobj = new String[seqsel.getSize()];
1040 for (SequenceI sel : seqsel.getSequences(null))
1042 VorbaId v = (VorbaId) jv2vobj.get(sel);
1045 vobj[o++] = v.toString();
1048 if (o < vobj.length)
1051 vobj = new String[o];
1052 System.arraycopy(t, 0, vobj, 0, o);
1056 if (seqsel != null && colsel != null)
1058 // deparse the colsel into positions on the vamsas alignment
1060 range = new Input();
1061 if (colsel.getSelected() != null
1062 && colsel.getSelected().size() > 0
1064 && seqsel.getSize() == visal.getHeight())
1066 // gather selected columns outwith the sequence positions
1068 for (Object obj : colsel.getSelected())
1070 int ival = ((Integer) obj).intValue();
1078 int[] intervals = colsel.getVisibleContigs(
1079 seqsel.getStartRes(), seqsel.getEndRes() + 1);
1080 for (int iv = 0; iv < intervals.length; iv += 2)
1083 s.setStart(intervals[iv] + 1); // vamsas indices begin at
1085 s.setEnd(intervals[iv + 1] + 1);
1086 s.setInclusive(true);
1091 if (vobj.length > 0)
1093 sm = new SelectionMessage("jalview", vobj, range);
1102 sm.validate(); // debug
1103 Cache.log.debug("Selection Message\n" + sm.getRawMessage());
1110 ssm.addStructureViewerListener(picker); // better method here
1111 ssm.addSelectionListener(selecter);
1112 } catch (Exception e)
1114 Cache.log.error("Failed to init Vamsas Picking", e);
1119 public String getCurrentSession()
1121 if (vclient != null)
1123 return (vclient.getSessionUrn());