2 * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
3 * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
21 import jalview.bin.Cache;
22 import jalview.datamodel.AlignmentI;
23 import jalview.datamodel.ColumnSelection;
24 import jalview.datamodel.SequenceGroup;
25 import jalview.datamodel.SequenceI;
26 import jalview.io.VamsasAppDatastore;
27 import jalview.structure.SelectionListener;
28 import jalview.structure.SelectionSource;
29 import jalview.structure.StructureSelectionManager;
30 import jalview.structure.VamsasListener;
32 import java.beans.PropertyChangeEvent;
33 import java.beans.PropertyChangeListener;
35 import java.io.IOException;
36 import java.util.Enumeration;
37 import java.util.Hashtable;
38 import java.util.IdentityHashMap;
39 import java.util.Iterator;
41 import javax.swing.JInternalFrame;
42 import javax.swing.JOptionPane;
44 import uk.ac.vamsas.client.ClientHandle;
45 import uk.ac.vamsas.client.IClient;
46 import uk.ac.vamsas.client.IClientDocument;
47 import uk.ac.vamsas.client.InvalidSessionDocumentException;
48 import uk.ac.vamsas.client.NoDefaultSessionException;
49 import uk.ac.vamsas.client.UserHandle;
50 import uk.ac.vamsas.client.VorbaId;
51 import uk.ac.vamsas.client.picking.IMessageHandler;
52 import uk.ac.vamsas.client.picking.IPickManager;
53 import uk.ac.vamsas.client.picking.Message;
54 import uk.ac.vamsas.client.picking.MouseOverMessage;
55 import uk.ac.vamsas.client.picking.SelectionMessage;
56 import uk.ac.vamsas.objects.core.Entry;
57 import uk.ac.vamsas.objects.core.Input;
58 import uk.ac.vamsas.objects.core.Pos;
59 import uk.ac.vamsas.objects.core.Seg;
65 public class VamsasApplication implements SelectionSource
67 IClient vclient = null;
69 ClientHandle app = null;
71 UserHandle user = null;
73 Desktop jdesktop = null; // our jalview desktop reference
75 private boolean inInitialUpdate=true;
77 // Cache.preferences for vamsas client session arena
78 // preferences for check for default session at startup.
79 // user and organisation stuff.
80 public VamsasApplication(Desktop jdesktop, File sessionPath, String sessionName)
83 // we should create a session URI from the sessionPath and pass it to
84 // the clientFactory - but the vamsas api doesn't cope with that yet.
85 this.jdesktop = jdesktop;
86 initClientSession(null, sessionPath, sessionName);
90 private static uk.ac.vamsas.client.IClientFactory getClientFactory()
93 return new uk.ac.vamsas.client.simpleclient.SimpleClientFactory();
97 * Start a new vamsas session
101 public VamsasApplication(Desktop jdesktop)
103 this.jdesktop = jdesktop;
104 initClientSession(null, null);
108 * init a connection to the session at the given url
113 public VamsasApplication(Desktop jdesktop, String sessionUrl)
115 this.jdesktop = jdesktop;
116 initClientSession(sessionUrl, null);
120 * @throws IOException
121 * or other if clientfactory instantiation failed.
122 * @return list of current sessions or null if no session exists.
124 public static String[] getSessionList() throws Exception
126 return getClientFactory().getCurrentSessions();
130 * initialise, possibly with either a valid session url or a file for a new
134 * null or a valid session url
135 * @param vamsasDocument
136 * null or a valid vamsas document file
137 * @return false if no vamsas connection was made
139 private void initClientSession(String sess, File vamsasDocument)
141 initClientSession(sess,vamsasDocument,null);
144 private boolean initClientSession(String sess, File vamsasDocument, String newDocSessionName)
148 // Only need to tell the library what the application is here
149 app = getJalviewHandle();
150 uk.ac.vamsas.client.IClientFactory clientfactory = getClientFactory();
151 if (vamsasDocument != null)
156 "Implementation Error - cannot import existing vamsas document into an existing session, Yet!");
160 if (newDocSessionName!=null)
162 vclient = clientfactory.openAsNewSessionIClient(app,
163 vamsasDocument,newDocSessionName);
165 vclient = clientfactory.openAsNewSessionIClient(app,
168 } catch (InvalidSessionDocumentException e)
171 .showInternalMessageDialog(
174 "VAMSAS Document could not be opened as a new session - please choose another",
175 "VAMSAS Document Import Failed",
176 JOptionPane.ERROR_MESSAGE);
182 // join existing or create a new session
185 vclient = clientfactory.getNewSessionIClient(app);
189 vclient = clientfactory.getIClient(app, sess);
192 // set some properties for our VAMSAS interaction
194 user = vclient.getUserHandle();
196 } catch (Exception e)
198 jalview.bin.Cache.log
199 .error("Couldn't instantiate vamsas client !", e);
205 private void setVclientConfig()
213 if (vclient instanceof uk.ac.vamsas.client.simpleclient.SimpleClient)
215 uk.ac.vamsas.client.simpleclient.SimpleClientConfig cfg = ((uk.ac.vamsas.client.simpleclient.SimpleClient) vclient)
216 .getSimpleClientConfig();
217 cfg._validatemergedroots = false;
218 cfg._validateupdatedroots = true; // we may write rubbish otherwise.
224 "Probable SERIOUS VAMSAS client incompatibility - carrying on regardless",
226 } catch (Exception e)
230 "Probable VAMSAS client incompatibility - carrying on regardless",
236 * make the appHandle for Jalview
240 private ClientHandle getJalviewHandle()
242 return new ClientHandle("jalview.bin.Jalview", jalview.bin.Cache
243 .getProperty("VERSION"));
248 * @return true if we are registered in a vamsas session
250 public boolean inSession()
252 return (vclient != null);
256 * called to connect to session inits handlers, does an initial document
259 public void initial_update()
264 "Impementation error! Vamsas Operations when client not initialised and connected.");
266 addDocumentUpdateHandler();
267 addStoreDocumentHandler();
269 inInitialUpdate = true;
271 .debug("Jalview loading the Vamsas Session for the first time.");
272 dealWithDocumentUpdate(false); // we don't push an update out to the
273 inInitialUpdate = false;
275 Cache.log.debug("... finished update for the first time.");
279 * Update all windows after a vamsas datamodel change. this could go on the
283 protected void updateJalviewGui()
285 JInternalFrame[] frames = jdesktop.getAllFrames();
295 for (int i = frames.length - 1; i > -1; i--)
297 if (frames[i] instanceof AlignFrame)
299 AlignFrame af = (AlignFrame) frames[i];
300 af.alignPanel.alignmentChanged();
303 } catch (Exception e)
307 "Exception whilst refreshing jalview windows after a vamsas document update.",
312 public void push_update()
314 Thread udthread = new Thread(new Runnable()
319 Cache.log.info("Jalview updating to the Vamsas Session.");
322 dealWithDocumentUpdate(true);
323 Cache.log.info("Jalview finished updating to the Vamsas Session.");
331 * leave a session, prompting the user to save if necessary
333 public void end_session()
338 private boolean promptUser = true;
341 * leave a session, optionally prompting the user to save if necessary
344 * when true enable prompting by this application
347 public void end_session(boolean promptUser)
350 throw new Error("Jalview not connected to Vamsas session.");
351 Cache.log.info("Jalview disconnecting from the Vamsas Session.");
356 boolean ourprompt = this.promptUser;
357 this.promptUser = promptUser;
358 vclient.finalizeClient();
359 Cache.log.info("Jalview has left the session.");
360 this.promptUser = ourprompt; // restore default value
365 .warn("JV Client leaving a session that's its not joined yet.");
367 joinedSession = false;
373 } catch (Exception e)
375 Cache.log.error("Vamsas Session finalization threw exceptions!", e);
379 public void updateJalview(IClientDocument cdoc)
381 Cache.log.debug("Jalview updating from sesion document ..");
383 VamsasAppDatastore vds = new VamsasAppDatastore(cdoc, vobj2jv, jv2vobj,
384 baseProvEntry(), alRedoState);
387 vds.updateToJalview();
388 } catch (Exception e)
390 Cache.log.error("Failed to update Jalview from vamsas document.", e);
396 vds.updateJalviewFromAppdata();
397 // Comment this out to repeatedly read in data from JalviewAppData
398 // firstUpdate=false;
400 } catch (Exception e)
403 "Exception when updating Jalview settings from Appdata.", e);
405 Cache.log.debug(".. finished updating from sesion document.");
409 boolean firstUpdate = false;
411 private void ensureJvVamsas()
415 jv2vobj = new IdentityHashMap();
416 vobj2jv = new Hashtable();
417 alRedoState = new Hashtable();
423 * jalview object binding to VorbaIds
425 IdentityHashMap jv2vobj = null;
427 Hashtable vobj2jv = null;
429 Hashtable alRedoState = null;
431 boolean errorsDuringUpdate = false;
433 boolean errorsDuringAppUpdate = false;
436 * update the document accessed through doc. A backup of the current object
440 * @return number of views stored in document (updated and new views)
442 public int updateVamsasDocument(IClientDocument doc)
446 errorsDuringUpdate = false;
447 errorsDuringAppUpdate = false;
448 backup_objectMapping();
449 VamsasAppDatastore vds = new VamsasAppDatastore(doc, vobj2jv, jv2vobj,
450 baseProvEntry(), alRedoState);
451 // wander through frames
452 JInternalFrame[] frames = Desktop.desktop.getAllFrames();
458 Hashtable skipList = new Hashtable();
459 Hashtable viewset = new Hashtable();
464 for (int i = frames.length - 1; i > -1; i--)
466 if (frames[i] instanceof AlignFrame)
468 AlignFrame af = (AlignFrame) frames[i];
469 if (!viewset.containsKey(af.getViewport().getSequenceSetId()))
471 // update alignment and root from frame.
472 boolean stored = false;
475 stored = vds.storeVAMSAS(af.getViewport(), af.getTitle());
476 } catch (Exception e)
478 errorsDuringUpdate = true;
479 Cache.log.error("Exception synchronizing "
482 + (af.getViewport().viewName == null ? "" : " view "
483 + af.getViewport().viewName)
484 + " to document.", e);
488 { // record skip in skipList
489 skipList.put(af.getViewport().getSequenceSetId(), af);
494 // could try to eliminate sequenceSetId from skiplist ..
495 // (skipList.containsKey(af.getViewport().getSequenceSetId()))
496 // remember sequenceSetId so we can skip all the other views on
498 viewset.put(af.getViewport().getSequenceSetId(), af);
504 // for (int i = frames.length - 1; i > -1; i--)
506 // if (frames[i] instanceof AlignFrame)
508 // AlignFrame af = (AlignFrame) frames[i];
509 Iterator aframes = viewset.values().iterator();
510 while (aframes.hasNext())
512 AlignFrame af = (AlignFrame) aframes.next();
513 // add any AlignedCodonFrame mappings on this alignment to any other.
514 vds.storeSequenceMappings(af.getViewport(), af.getTitle());
516 } catch (Exception e)
518 Cache.log.error("Exception synchronizing Views to Document :", e);
519 errorsDuringUpdate = true;
524 if (viewset.size() > 0)
526 // Alignment views were synchronized, so store their state in the
528 // The skipList ensures we don't write out any alignments not actually
530 vds.setSkipList(skipList);
531 vds.updateJalviewClientAppdata();
533 } catch (Exception e)
535 Cache.log.error("Client Appdata Write exception", e);
536 errorsDuringAppUpdate = true;
542 private Entry baseProvEntry()
544 uk.ac.vamsas.objects.core.Entry pentry = new uk.ac.vamsas.objects.core.Entry();
545 pentry.setUser(user.getFullName());
546 pentry.setApp(app.getClientUrn());
547 pentry.setDate(new java.util.Date());
548 pentry.setAction("created");
553 * do a vamsas document update or update jalview from the vamsas document
556 * true to update from jalview to the vamsas document
557 * @return total number of stored alignments in the document after the update
559 protected int dealWithDocumentUpdate(boolean fromJalview)
562 // called by update handler for document update.
563 Cache.log.debug("Updating jalview from changed vamsas document.");
567 long time = System.currentTimeMillis();
568 IClientDocument cdoc = vclient.getClientDocument();
569 if (Cache.log.isDebugEnabled())
571 Cache.log.debug("Time taken to get ClientDocument = "
572 + (System.currentTimeMillis() - time));
573 time = System.currentTimeMillis();
577 storedviews+=updateVamsasDocument(cdoc);
578 if (Cache.log.isDebugEnabled())
581 .debug("Time taken to update Vamsas Document from jalview\t= "
582 + (System.currentTimeMillis() - time));
583 time = System.currentTimeMillis();
585 cdoc.setVamsasRoots(cdoc.getVamsasRoots());
586 if (Cache.log.isDebugEnabled())
588 Cache.log.debug("Time taken to set Document Roots\t\t= "
589 + (System.currentTimeMillis() - time));
590 time = System.currentTimeMillis();
596 if (Cache.log.isDebugEnabled())
599 .debug("Time taken to update Jalview from vamsas document Roots\t= "
600 + (System.currentTimeMillis() - time));
601 time = System.currentTimeMillis();
605 vclient.updateDocument(cdoc);
606 if (Cache.log.isDebugEnabled())
608 Cache.log.debug("Time taken to update Session Document\t= "
609 + (System.currentTimeMillis() - time));
610 time = System.currentTimeMillis();
613 } catch (Exception ee)
615 System.err.println("Exception whilst updating :");
616 ee.printStackTrace(System.err);
617 // recover object map backup, since its probably corrupted with references
618 // to Vobjects that don't exist anymore.
619 recover_objectMappingBackup();
622 Cache.log.debug("Finished updating from document change.");
627 private void addDocumentUpdateHandler()
629 final VamsasApplication client = this;
630 vclient.addDocumentUpdateHandler(new PropertyChangeListener()
632 public void propertyChange(PropertyChangeEvent evt)
634 Cache.log.debug("Dealing with document update event.");
635 client.dealWithDocumentUpdate(false);
636 Cache.log.debug("finished dealing with event.");
639 Cache.log.debug("Added Jalview handler for vamsas document updates.");
642 private void addStoreDocumentHandler()
644 final VamsasApplication client = this;
645 vclient.addVorbaEventHandler(
646 uk.ac.vamsas.client.Events.DOCUMENT_REQUESTTOCLOSE,
647 new PropertyChangeListener()
649 public void propertyChange(PropertyChangeEvent evt)
651 if (client.promptUser)
654 .debug("Asking user if the vamsas session should be stored.");
655 int reply = JOptionPane
656 .showInternalConfirmDialog(
658 "The current VAMSAS session has unsaved data - do you want to save it ?",
659 "VAMSAS Session Shutdown",
660 JOptionPane.YES_NO_OPTION,
661 JOptionPane.QUESTION_MESSAGE);
663 if (reply == JOptionPane.YES_OPTION)
665 Cache.log.debug("Prompting for vamsas store filename.");
666 Desktop.instance.vamsasSave_actionPerformed(null);
668 .debug("Finished attempt at storing document.");
671 .debug("finished dealing with REQUESTTOCLOSE event.");
676 .debug("Ignoring store document request (promptUser==false)");
680 Cache.log.debug("Added Jalview handler for vamsas document updates.");
683 public void disableGui(boolean b)
685 Desktop.instance.setVamsasUpdate(b);
688 Hashtable _backup_vobj2jv;
690 IdentityHashMap _backup_jv2vobj;
693 * make a backup of the object mappings (vobj2jv and jv2vobj)
695 public void backup_objectMapping()
697 _backup_vobj2jv = new Hashtable(vobj2jv);
698 _backup_jv2vobj = new IdentityHashMap(jv2vobj);
702 * recover original object mappings from the object mapping backup if document
706 * if backup_objectMapping was not called.
708 public void recover_objectMappingBackup()
710 if (_backup_vobj2jv == null)
712 if (inInitialUpdate) {
713 // nothing to recover so just
718 "IMPLEMENTATION ERROR: Cannot recover vamsas object mappings - no backup was made.");
721 Iterator el = _backup_jv2vobj.entrySet().iterator();
724 java.util.Map.Entry mp = (java.util.Map.Entry) el.next();
725 jv2vobj.put(mp.getKey(), mp.getValue());
727 el = _backup_vobj2jv.entrySet().iterator();
730 java.util.Map.Entry mp = (java.util.Map.Entry) el.next();
731 vobj2jv.put(mp.getKey(), mp.getValue());
735 private boolean joinedSession = false;
737 private VamsasListener picker = null;
739 private SelectionListener selecter;
741 private void startSession()
747 vclient.joinSession();
748 joinedSession = true;
749 } catch (Exception e)
752 Cache.log.error("Failed to join vamsas session.", e);
757 final IPickManager pm = vclient.getPickManager();
758 final StructureSelectionManager ssm = StructureSelectionManager
759 .getStructureSelectionManager();
760 final SelectionSource me = this;
761 pm.registerMessageHandler(new IMessageHandler()
765 public void handleMessage(Message message)
769 // we are not in a session yet.
772 if (message instanceof MouseOverMessage)
774 MouseOverMessage mm = (MouseOverMessage) message;
775 String mstring = mm.getVorbaID() + " " + mm.getPosition();
776 if (last != null && mstring.equals(last))
780 // if (Cache.log.isDebugEnabled())
782 // Cache.log.debug("Received MouseOverMessage "+mm.getVorbaID()+"
783 // "+mm.getPosition());
785 Object jvobj = vobj2jv.get(mm.getVorbaID());
786 if (jvobj != null && jvobj instanceof SequenceI)
789 // Cache.log.debug("Handling Mouse over "+mm.getVorbaID()+"
790 // bound to "+jvobj+" at "+mm.getPosition());
791 // position is character position in aligned sequence
792 ssm.mouseOverVamsasSequence((SequenceI) jvobj, mm
796 if (message instanceof uk.ac.vamsas.client.picking.SelectionMessage)
798 // we only care about AlignmentSequence selections
799 SelectionMessage sm = (SelectionMessage) message;
801 System.err.println("Received\n" + sm.getRawMessage());
802 Object[] jvobjs = sm.getVorbaIDs() == null ? null
803 : new Object[sm.getVorbaIDs().length];
806 // TODO: rationalise : can only clear a selection over a
807 // referred to object
808 ssm.sendSelection(null, null, me);
813 for (int o = 0; o < jvobjs.length; o++)
815 jvobjs[o] = vobj2jv.get(sm.getVorbaIDs()[o]);
816 if (jvobjs[o] == null)
818 // can't cope with selections for unmapped objects
823 type = jvobjs[o].getClass();
826 if (type != jvobjs[o].getClass())
829 // discard - can't cope with selections over mixed objects
833 SequenceGroup jselection = null;
834 ColumnSelection colsel = null;
835 if (type == jalview.datamodel.Alignment.class)
837 if (jvobjs.length == 1)
839 // TODO if (sm.isNone())// send a message to select the
840 // specified columns over the
847 if (type == jalview.datamodel.Sequence.class)
851 boolean aligned = ((jalview.datamodel.Sequence) jvobjs[0])
852 .getDatasetSequence() != null;
856 jselection = new SequenceGroup();
857 jselection.addSequence(
858 seq = (jalview.datamodel.Sequence) jvobjs[0],
860 maxWidth = seq.getLength();
862 for (int c = 1; aligned && jvobjs.length > 1
863 && c < jvobjs.length; c++)
865 if (((jalview.datamodel.Sequence) jvobjs[c])
866 .getDatasetSequence() == null)
873 jselection.addSequence(
874 seq = (jalview.datamodel.Sequence) jvobjs[c],
876 if (maxWidth < seq.getLength())
878 maxWidth = seq.getLength();
886 // if cardinality is greater than one then verify all
887 // sequences are alignment sequences.
888 if (jvobjs.length == 1)
890 // find all instances of this dataset sequence in the
891 // displayed alignments containing the associated range and
897 jselection.setStartRes(0);
898 jselection.setEndRes(maxWidth);
899 // locate the alignment containing the given sequences and
900 // select the associated ranges on them.
901 if (sm.getRanges() != null)
903 int[] prange = uk.ac.vamsas.objects.utils.Range
904 .getBounds(sm.getRanges());
905 jselection.setStartRes(prange[0] - 1);
906 jselection.setEndRes(prange[1] - 1);
907 prange = uk.ac.vamsas.objects.utils.Range
908 .getIntervals(sm.getRanges());
909 colsel = new ColumnSelection();
910 for (int p = 0; p < prange.length; p += 2)
912 int d = (prange[p] <= prange[p + 1]) ? 1 : -1;
913 // try to join up adjacent columns to make a larger
915 // lower and upper bounds
916 int l = (d < 0) ? 1 : 0;
917 int u = (d > 0) ? 1 : 0;
919 if (jselection.getStartRes() > 0
920 && prange[p + l] == jselection
923 jselection.setStartRes(prange[p + l] - 1);
925 if (jselection.getEndRes() <= maxWidth
926 && prange[p + u] == (jselection.getEndRes() + 2))
928 jselection.setEndRes(prange[p + u] - 1);
930 // mark all the columns in the range.
931 for (int sr = prange[p], er = prange[p + 1], de = er
932 + d; sr != de; sr += d)
934 colsel.addElement(sr - 1);
943 ssm.sendSelection(jselection, colsel, me);
946 for (int c = 0; c < jvobjs.length; c++)
956 picker = new VamsasListener()
958 SequenceI last = null;
962 public void mouseOver(SequenceI seq, int index)
966 if (seq != last || i != index)
968 VorbaId v = (VorbaId) jv2vobj.get(seq);
971 // this should really be a trace message.
972 // Cache.log.debug("Mouse over " + v.getId() + " bound to "
973 // + seq + " at " + index);
976 MouseOverMessage message = new MouseOverMessage(v.getId(),
978 pm.sendMessage(message);
983 selecter = new SelectionListener()
986 public void selection(SequenceGroup seqsel,
987 ColumnSelection colsel, SelectionSource source)
992 .warn("Selection listener still active for dead session.");
998 AlignmentI visal = null;
999 if (source instanceof AlignViewport)
1001 visal = ((AlignViewport) source).getAlignment();
1003 SelectionMessage sm = null;
1004 if ((seqsel == null || seqsel.getSize() == 0)
1005 && (colsel == null || colsel.getSelected() == null || colsel
1006 .getSelected().size() == 0))
1008 if (source instanceof AlignViewport)
1010 // the empty selection.
1011 sm = new SelectionMessage("jalview", new String[]
1012 { ((AlignViewport) source).getSequenceSetId() }, null,
1017 // the empty selection.
1018 sm = new SelectionMessage("jalview", null, null, true);
1023 String[] vobj = new String[seqsel.getSize()];
1025 Enumeration sels = seqsel.getSequences(null).elements();
1026 while (sels.hasMoreElements())
1028 SequenceI sel = (SequenceI) sels.nextElement();
1029 VorbaId v = (VorbaId) jv2vobj.get(sel);
1032 vobj[o++] = v.toString();
1035 if (o < vobj.length)
1038 vobj = new String[o];
1039 System.arraycopy(t, 0, vobj, 0, o);
1043 if (seqsel != null && colsel != null)
1045 // deparse the colsel into positions on the vamsas alignment
1047 range = new Input();
1048 if (colsel.getSelected() != null
1049 && colsel.getSelected().size() > 0
1051 && seqsel.getSize() == visal.getHeight())
1053 // gather selected columns outwith the sequence positions
1055 Enumeration cols = colsel.getSelected().elements();
1056 while (cols.hasMoreElements())
1058 int ival = ((Integer) cols.nextElement()).intValue();
1066 int[] intervals = colsel.getVisibleContigs(seqsel
1067 .getStartRes(), seqsel.getEndRes() + 1);
1068 for (int iv = 0; iv < intervals.length; iv += 2)
1071 s.setStart(intervals[iv] + 1); // vamsas indices begin at
1073 s.setEnd(intervals[iv + 1] + 1);
1074 s.setInclusive(true);
1079 if (vobj.length > 0)
1081 sm = new SelectionMessage("jalview", vobj, range);
1090 sm.validate(); // debug
1091 Cache.log.debug("Selection Message\n" + sm.getRawMessage());
1098 ssm.addStructureViewerListener(picker); // better method here
1099 ssm.addSelectionListener(selecter);
1100 } catch (Exception e)
1102 Cache.log.error("Failed to init Vamsas Picking", e);
1107 public String getCurrentSession()
1109 if (vclient != null)
1111 return (vclient.getSessionUrn());