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 JvOptionPane.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()
327 Cache.log.info("Jalview updating to the Vamsas Session.");
329 dealWithDocumentUpdate(true);
330 Cache.log.info("Jalview finished updating to the Vamsas Session.");
338 * leave a session, prompting the user to save if necessary
340 public void end_session()
345 private boolean promptUser = true;
348 * leave a session, optionally prompting the user to save if necessary
351 * when true enable prompting by this application
354 public void end_session(boolean promptUser)
360 .getString("error.jalview_no_connected_vamsas_session"));
362 Cache.log.info("Jalview disconnecting from the Vamsas Session.");
367 boolean ourprompt = this.promptUser;
368 this.promptUser = promptUser;
369 vclient.finalizeClient();
370 Cache.log.info("Jalview has left the session.");
371 this.promptUser = ourprompt; // restore default value
376 .warn("JV Client leaving a session that's its not joined yet.");
378 joinedSession = false;
384 } catch (Exception e)
386 Cache.log.error("Vamsas Session finalization threw exceptions!", e);
390 public void updateJalview(IClientDocument cdoc)
392 Cache.log.debug("Jalview updating from sesion document ..");
394 VamsasAppDatastore vds = new VamsasAppDatastore(cdoc, vobj2jv, jv2vobj,
395 baseProvEntry(), alRedoState);
398 vds.updateToJalview();
399 } catch (Exception e)
401 Cache.log.error("Failed to update Jalview from vamsas document.", e);
407 vds.updateJalviewFromAppdata();
408 // Comment this out to repeatedly read in data from JalviewAppData
409 // firstUpdate=false;
411 } catch (Exception e)
414 "Exception when updating Jalview settings from Appdata.", e);
416 Cache.log.debug(".. finished updating from sesion document.");
420 boolean firstUpdate = false;
422 private void ensureJvVamsas()
426 jv2vobj = new IdentityHashMap();
427 vobj2jv = new Hashtable();
428 alRedoState = new Hashtable();
434 * jalview object binding to VorbaIds
436 IdentityHashMap jv2vobj = null;
438 Hashtable vobj2jv = null;
440 Hashtable alRedoState = null;
442 boolean errorsDuringUpdate = false;
444 boolean errorsDuringAppUpdate = false;
447 * update the document accessed through doc. A backup of the current object
451 * @return number of views stored in document (updated and new views)
453 public int updateVamsasDocument(IClientDocument doc)
457 errorsDuringUpdate = false;
458 errorsDuringAppUpdate = false;
459 backup_objectMapping();
460 VamsasAppDatastore vds = new VamsasAppDatastore(doc, vobj2jv, jv2vobj,
461 baseProvEntry(), alRedoState);
462 // wander through frames
463 JInternalFrame[] frames = Desktop.desktop.getAllFrames();
469 Hashtable skipList = new Hashtable();
470 Hashtable viewset = new Hashtable();
475 for (int i = frames.length - 1; i > -1; i--)
477 if (frames[i] instanceof AlignFrame)
479 AlignFrame af = (AlignFrame) frames[i];
480 if (!viewset.containsKey(af.getViewport().getSequenceSetId()))
482 // update alignment and root from frame.
483 boolean stored = false;
486 stored = vds.storeVAMSAS(af.getViewport(), af.getTitle());
487 } catch (Exception e)
489 errorsDuringUpdate = true;
490 Cache.log.error("Exception synchronizing "
493 + (af.getViewport().viewName == null ? "" : " view "
494 + af.getViewport().viewName)
495 + " to document.", e);
499 { // record skip in skipList
500 skipList.put(af.getViewport().getSequenceSetId(), af);
505 // could try to eliminate sequenceSetId from skiplist ..
506 // (skipList.containsKey(af.getViewport().getSequenceSetId()))
507 // remember sequenceSetId so we can skip all the other views on
509 viewset.put(af.getViewport().getSequenceSetId(), af);
515 // for (int i = frames.length - 1; i > -1; i--)
517 // if (frames[i] instanceof AlignFrame)
519 // AlignFrame af = (AlignFrame) frames[i];
520 Iterator aframes = viewset.values().iterator();
521 while (aframes.hasNext())
523 AlignFrame af = (AlignFrame) aframes.next();
524 // add any AlignedCodonFrame mappings on this alignment to any other.
525 vds.storeSequenceMappings(af.getViewport(), af.getTitle());
527 } catch (Exception e)
529 Cache.log.error("Exception synchronizing Views to Document :", e);
530 errorsDuringUpdate = true;
535 if (viewset.size() > 0)
537 // Alignment views were synchronized, so store their state in the
539 // The skipList ensures we don't write out any alignments not actually
541 vds.setSkipList(skipList);
542 vds.updateJalviewClientAppdata();
544 } catch (Exception e)
546 Cache.log.error("Client Appdata Write exception", e);
547 errorsDuringAppUpdate = true;
553 private Entry baseProvEntry()
555 uk.ac.vamsas.objects.core.Entry pentry = new uk.ac.vamsas.objects.core.Entry();
556 pentry.setUser(user.getFullName());
557 pentry.setApp(app.getClientUrn());
558 pentry.setDate(new java.util.Date());
559 pentry.setAction("created");
564 * do a vamsas document update or update jalview from the vamsas document
567 * true to update from jalview to the vamsas document
568 * @return total number of stored alignments in the document after the update
570 protected int dealWithDocumentUpdate(boolean fromJalview)
573 // called by update handler for document update.
574 Cache.log.debug("Updating jalview from changed vamsas document.");
578 long time = System.currentTimeMillis();
579 IClientDocument cdoc = vclient.getClientDocument();
580 if (Cache.log.isDebugEnabled())
582 Cache.log.debug("Time taken to get ClientDocument = "
583 + (System.currentTimeMillis() - time));
584 time = System.currentTimeMillis();
588 storedviews += updateVamsasDocument(cdoc);
589 if (Cache.log.isDebugEnabled())
592 .debug("Time taken to update Vamsas Document from jalview\t= "
593 + (System.currentTimeMillis() - time));
594 time = System.currentTimeMillis();
596 cdoc.setVamsasRoots(cdoc.getVamsasRoots());
597 if (Cache.log.isDebugEnabled())
599 Cache.log.debug("Time taken to set Document Roots\t\t= "
600 + (System.currentTimeMillis() - time));
601 time = System.currentTimeMillis();
607 if (Cache.log.isDebugEnabled())
610 .debug("Time taken to update Jalview from vamsas document Roots\t= "
611 + (System.currentTimeMillis() - time));
612 time = System.currentTimeMillis();
616 vclient.updateDocument(cdoc);
617 if (Cache.log.isDebugEnabled())
619 Cache.log.debug("Time taken to update Session Document\t= "
620 + (System.currentTimeMillis() - time));
621 time = System.currentTimeMillis();
624 } catch (Exception ee)
626 System.err.println("Exception whilst updating :");
627 ee.printStackTrace(System.err);
628 // recover object map backup, since its probably corrupted with references
629 // to Vobjects that don't exist anymore.
630 recover_objectMappingBackup();
633 Cache.log.debug("Finished updating from document change.");
638 private void addDocumentUpdateHandler()
640 final VamsasApplication client = this;
641 vclient.addDocumentUpdateHandler(new PropertyChangeListener()
644 public void propertyChange(PropertyChangeEvent evt)
646 Cache.log.debug("Dealing with document update event.");
647 client.dealWithDocumentUpdate(false);
648 Cache.log.debug("finished dealing with event.");
651 Cache.log.debug("Added Jalview handler for vamsas document updates.");
654 private void addStoreDocumentHandler()
656 final VamsasApplication client = this;
657 vclient.addVorbaEventHandler(
658 uk.ac.vamsas.client.Events.DOCUMENT_REQUESTTOCLOSE,
659 new PropertyChangeListener()
662 public void propertyChange(PropertyChangeEvent evt)
664 if (client.promptUser)
667 .debug("Asking user if the vamsas session should be stored.");
668 int reply = JvOptionPane
669 .showInternalConfirmDialog(
671 "The current VAMSAS session has unsaved data - do you want to save it ?",
672 "VAMSAS Session Shutdown",
673 JvOptionPane.YES_NO_OPTION,
674 JvOptionPane.QUESTION_MESSAGE);
676 if (reply == JvOptionPane.YES_OPTION)
678 Cache.log.debug("Prompting for vamsas store filename.");
679 Desktop.instance.vamsasSave_actionPerformed(null);
681 .debug("Finished attempt at storing document.");
684 .debug("finished dealing with REQUESTTOCLOSE event.");
689 .debug("Ignoring store document request (promptUser==false)");
693 Cache.log.debug("Added Jalview handler for vamsas document updates.");
696 public void disableGui(boolean b)
698 Desktop.instance.setVamsasUpdate(b);
701 Hashtable _backup_vobj2jv;
703 IdentityHashMap _backup_jv2vobj;
706 * make a backup of the object mappings (vobj2jv and jv2vobj)
708 public void backup_objectMapping()
710 _backup_vobj2jv = new Hashtable(vobj2jv);
711 _backup_jv2vobj = new IdentityHashMap(jv2vobj);
715 * recover original object mappings from the object mapping backup if document
719 * if backup_objectMapping was not called.
721 public void recover_objectMappingBackup()
723 if (_backup_vobj2jv == null)
727 // nothing to recover so just
733 .getString("error.implementation_error_cannot_recover_vamsas_object_mappings"));
736 Iterator el = _backup_jv2vobj.entrySet().iterator();
739 java.util.Map.Entry mp = (java.util.Map.Entry) el.next();
740 jv2vobj.put(mp.getKey(), mp.getValue());
742 el = _backup_vobj2jv.entrySet().iterator();
745 java.util.Map.Entry mp = (java.util.Map.Entry) el.next();
746 vobj2jv.put(mp.getKey(), mp.getValue());
750 private boolean joinedSession = false;
752 private VamsasListener picker = null;
754 private SelectionListener selecter;
756 private void startSession()
762 vclient.joinSession();
763 joinedSession = true;
764 } catch (Exception e)
767 Cache.log.error("Failed to join vamsas session.", e);
772 final IPickManager pm = vclient.getPickManager();
773 final StructureSelectionManager ssm = StructureSelectionManager
774 .getStructureSelectionManager(Desktop.instance);
775 final VamsasApplication me = this;
776 pm.registerMessageHandler(new IMessageHandler()
781 public void handleMessage(Message message)
785 // we are not in a session yet.
788 if (message instanceof MouseOverMessage)
790 MouseOverMessage mm = (MouseOverMessage) message;
791 String mstring = mm.getVorbaID() + " " + mm.getPosition();
792 if (last != null && mstring.equals(last))
796 // if (Cache.log.isDebugEnabled())
798 // Cache.log.debug("Received MouseOverMessage "+mm.getVorbaID()+"
799 // "+mm.getPosition());
801 Object jvobj = vobj2jv.get(mm.getVorbaID());
802 if (jvobj != null && jvobj instanceof SequenceI)
805 // Cache.log.debug("Handling Mouse over "+mm.getVorbaID()+"
806 // bound to "+jvobj+" at "+mm.getPosition());
807 // position is character position in aligned sequence
808 ssm.mouseOverVamsasSequence((SequenceI) jvobj,
809 mm.getPosition(), me);
812 if (message instanceof uk.ac.vamsas.client.picking.SelectionMessage)
814 // we only care about AlignmentSequence selections
815 SelectionMessage sm = (SelectionMessage) message;
817 System.err.println("Received\n" + sm.getRawMessage());
818 Object[] jvobjs = sm.getVorbaIDs() == null ? null
819 : new Object[sm.getVorbaIDs().length];
822 // TODO: rationalise : can only clear a selection over a
823 // referred to object
824 ssm.sendSelection(null, null, me);
829 for (int o = 0; o < jvobjs.length; o++)
831 jvobjs[o] = vobj2jv.get(sm.getVorbaIDs()[o]);
832 if (jvobjs[o] == null)
834 // can't cope with selections for unmapped objects
839 type = jvobjs[o].getClass();
842 if (type != jvobjs[o].getClass())
845 // discard - can't cope with selections over mixed objects
849 SequenceGroup jselection = null;
850 ColumnSelection colsel = null;
851 if (type == jalview.datamodel.Alignment.class)
853 if (jvobjs.length == 1)
855 // TODO if (sm.isNone())// send a message to select the
856 // specified columns over the
863 if (type == jalview.datamodel.Sequence.class)
867 boolean aligned = ((jalview.datamodel.Sequence) jvobjs[0])
868 .getDatasetSequence() != null;
872 jselection = new SequenceGroup();
873 jselection.addSequence(
874 seq = (jalview.datamodel.Sequence) jvobjs[0],
876 maxWidth = seq.getLength();
878 for (int c = 1; aligned && jvobjs.length > 1
879 && c < jvobjs.length; c++)
881 if (((jalview.datamodel.Sequence) jvobjs[c])
882 .getDatasetSequence() == null)
889 jselection.addSequence(
890 seq = (jalview.datamodel.Sequence) jvobjs[c],
892 if (maxWidth < seq.getLength())
894 maxWidth = seq.getLength();
902 // if cardinality is greater than one then verify all
903 // sequences are alignment sequences.
904 if (jvobjs.length == 1)
906 // find all instances of this dataset sequence in the
907 // displayed alignments containing the associated range and
913 jselection.setStartRes(0);
914 jselection.setEndRes(maxWidth);
915 // locate the alignment containing the given sequences and
916 // select the associated ranges on them.
917 if (sm.getRanges() != null)
919 int[] prange = uk.ac.vamsas.objects.utils.Range
920 .getBounds(sm.getRanges());
921 jselection.setStartRes(prange[0] - 1);
922 jselection.setEndRes(prange[1] - 1);
923 prange = uk.ac.vamsas.objects.utils.Range
924 .getIntervals(sm.getRanges());
925 colsel = new ColumnSelection();
926 for (int p = 0; p < prange.length; p += 2)
928 int d = (prange[p] <= prange[p + 1]) ? 1 : -1;
929 // try to join up adjacent columns to make a larger
931 // lower and upper bounds
932 int l = (d < 0) ? 1 : 0;
933 int u = (d > 0) ? 1 : 0;
935 if (jselection.getStartRes() > 0
936 && prange[p + l] == jselection.getStartRes())
938 jselection.setStartRes(prange[p + l] - 1);
940 if (jselection.getEndRes() <= maxWidth
941 && prange[p + u] == (jselection.getEndRes() + 2))
943 jselection.setEndRes(prange[p + u] - 1);
945 // mark all the columns in the range.
946 for (int sr = prange[p], er = prange[p + 1], de = er
947 + d; sr != de; sr += d)
949 colsel.addElement(sr - 1);
958 ssm.sendSelection(jselection, colsel, me);
961 for (int c = 0; c < jvobjs.length; c++)
971 picker = new VamsasListener()
973 SequenceI last = null;
978 public void mouseOverSequence(SequenceI seq, int index,
985 if (seq != last || i != index)
987 VorbaId v = (VorbaId) jv2vobj.get(seq);
990 // this should really be a trace message.
991 // Cache.log.debug("Mouse over " + v.getId() + " bound to "
992 // + seq + " at " + index);
995 MouseOverMessage message = new MouseOverMessage(v.getId(),
997 pm.sendMessage(message);
1002 selecter = new SelectionListener()
1006 public void selection(SequenceGroup seqsel,
1007 ColumnSelection colsel, SelectionSource source)
1009 if (vobj2jv == null)
1012 .warn("Selection listener still active for dead session.");
1013 // not in a session.
1018 AlignmentI visal = null;
1019 if (source instanceof AlignViewport)
1021 visal = ((AlignmentViewport) source).getAlignment();
1023 SelectionMessage sm = null;
1024 if ((seqsel == null || seqsel.getSize() == 0)
1025 && (colsel == null || colsel.getSelected() == null || colsel
1026 .getSelected().size() == 0))
1028 if (source instanceof AlignViewport)
1030 // the empty selection.
1031 sm = new SelectionMessage("jalview",
1032 new String[] { ((AlignmentViewport) source)
1033 .getSequenceSetId() }, null, true);
1037 // the empty selection.
1038 sm = new SelectionMessage("jalview", null, null, true);
1043 String[] vobj = new String[seqsel.getSize()];
1045 for (SequenceI sel : seqsel.getSequences(null))
1047 VorbaId v = (VorbaId) jv2vobj.get(sel);
1050 vobj[o++] = v.toString();
1053 if (o < vobj.length)
1056 vobj = new String[o];
1057 System.arraycopy(t, 0, vobj, 0, o);
1061 if (seqsel != null && colsel != null)
1063 // deparse the colsel into positions on the vamsas alignment
1065 range = new Input();
1066 if (colsel.getSelected() != null
1067 && colsel.getSelected().size() > 0
1069 && seqsel.getSize() == visal.getHeight())
1071 // gather selected columns outwith the sequence positions
1073 for (Integer ival : colsel.getSelected())
1076 p.setI(ival.intValue() + 1);
1082 int[] intervals = colsel.getVisibleContigs(
1083 seqsel.getStartRes(), seqsel.getEndRes() + 1);
1084 for (int iv = 0; iv < intervals.length; iv += 2)
1087 s.setStart(intervals[iv] + 1); // vamsas indices begin at
1089 s.setEnd(intervals[iv + 1] + 1);
1090 s.setInclusive(true);
1095 if (vobj.length > 0)
1097 sm = new SelectionMessage("jalview", vobj, range);
1106 sm.validate(); // debug
1107 Cache.log.debug("Selection Message\n" + sm.getRawMessage());
1114 ssm.addStructureViewerListener(picker); // better method here
1115 ssm.addSelectionListener(selecter);
1116 } catch (Exception e)
1118 Cache.log.error("Failed to init Vamsas Picking", e);
1123 public String getCurrentSession()
1125 if (vclient != null)
1127 return (vclient.getSessionUrn());