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)
159 throw new Error(MessageManager.getString("error.implementation_error_cannot_import_vamsas_doc"));
163 if (newDocSessionName != null)
165 vclient = clientfactory.openAsNewSessionIClient(app,
166 vamsasDocument, newDocSessionName);
170 vclient = clientfactory.openAsNewSessionIClient(app,
173 } catch (InvalidSessionDocumentException e)
176 .showInternalMessageDialog(
179 MessageManager.getString("label.vamsas_doc_couldnt_be_opened_as_new_session"),
180 MessageManager.getString("label.vamsas_document_import_failed"),
181 JOptionPane.ERROR_MESSAGE);
187 // join existing or create a new session
190 vclient = clientfactory.getNewSessionIClient(app);
194 vclient = clientfactory.getIClient(app, sess);
197 // set some properties for our VAMSAS interaction
199 user = vclient.getUserHandle();
201 } catch (Exception e)
203 jalview.bin.Cache.log
204 .error("Couldn't instantiate vamsas client !", e);
210 private void setVclientConfig()
218 if (vclient instanceof uk.ac.vamsas.client.simpleclient.SimpleClient)
220 uk.ac.vamsas.client.simpleclient.SimpleClientConfig cfg = ((uk.ac.vamsas.client.simpleclient.SimpleClient) vclient)
221 .getSimpleClientConfig();
222 cfg._validatemergedroots = false;
223 cfg._validateupdatedroots = true; // we may write rubbish otherwise.
228 .warn("Probable SERIOUS VAMSAS client incompatibility - carrying on regardless",
230 } catch (Exception e)
233 .warn("Probable VAMSAS client incompatibility - carrying on regardless",
239 * make the appHandle for Jalview
243 private ClientHandle getJalviewHandle()
245 return new ClientHandle("jalview.bin.Jalview",
246 jalview.bin.Cache.getProperty("VERSION"));
251 * @return true if we are registered in a vamsas session
253 public boolean inSession()
255 return (vclient != null);
259 * called to connect to session inits handlers, does an initial document
262 public void initial_update()
266 throw new Error(MessageManager.getString("error.implementation_error_vamsas_operation_not_init"));
268 addDocumentUpdateHandler();
269 addStoreDocumentHandler();
271 inInitialUpdate = true;
273 .debug("Jalview loading the Vamsas Session for the first time.");
274 dealWithDocumentUpdate(false); // we don't push an update out to the
275 inInitialUpdate = false;
277 Cache.log.debug("... finished update for the first time.");
281 * Update all windows after a vamsas datamodel change. this could go on the
285 protected void updateJalviewGui()
287 JInternalFrame[] frames = jdesktop.getAllFrames();
297 for (int i = frames.length - 1; i > -1; i--)
299 if (frames[i] instanceof AlignFrame)
301 AlignFrame af = (AlignFrame) frames[i];
302 af.alignPanel.alignmentChanged();
305 } catch (Exception e)
308 .warn("Exception whilst refreshing jalview windows after a vamsas document update.",
313 public void push_update()
315 Thread udthread = new Thread(new Runnable()
320 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)
351 throw new Error(MessageManager.getString("error.jalview_no_connected_vamsas_session"));
353 Cache.log.info("Jalview disconnecting from the Vamsas Session.");
358 boolean ourprompt = this.promptUser;
359 this.promptUser = promptUser;
360 vclient.finalizeClient();
361 Cache.log.info("Jalview has left the session.");
362 this.promptUser = ourprompt; // restore default value
367 .warn("JV Client leaving a session that's its not joined yet.");
369 joinedSession = false;
375 } catch (Exception e)
377 Cache.log.error("Vamsas Session finalization threw exceptions!", e);
381 public void updateJalview(IClientDocument cdoc)
383 Cache.log.debug("Jalview updating from sesion document ..");
385 VamsasAppDatastore vds = new VamsasAppDatastore(cdoc, vobj2jv, jv2vobj,
386 baseProvEntry(), alRedoState);
389 vds.updateToJalview();
390 } catch (Exception e)
392 Cache.log.error("Failed to update Jalview from vamsas document.", e);
398 vds.updateJalviewFromAppdata();
399 // Comment this out to repeatedly read in data from JalviewAppData
400 // firstUpdate=false;
402 } catch (Exception e)
405 "Exception when updating Jalview settings from Appdata.", e);
407 Cache.log.debug(".. finished updating from sesion document.");
411 boolean firstUpdate = false;
413 private void ensureJvVamsas()
417 jv2vobj = new IdentityHashMap();
418 vobj2jv = new Hashtable();
419 alRedoState = new Hashtable();
425 * jalview object binding to VorbaIds
427 IdentityHashMap jv2vobj = null;
429 Hashtable vobj2jv = null;
431 Hashtable alRedoState = null;
433 boolean errorsDuringUpdate = false;
435 boolean errorsDuringAppUpdate = false;
438 * update the document accessed through doc. A backup of the current object
442 * @return number of views stored in document (updated and new views)
444 public int updateVamsasDocument(IClientDocument doc)
448 errorsDuringUpdate = false;
449 errorsDuringAppUpdate = false;
450 backup_objectMapping();
451 VamsasAppDatastore vds = new VamsasAppDatastore(doc, vobj2jv, jv2vobj,
452 baseProvEntry(), alRedoState);
453 // wander through frames
454 JInternalFrame[] frames = Desktop.desktop.getAllFrames();
460 Hashtable skipList = new Hashtable();
461 Hashtable viewset = new Hashtable();
466 for (int i = frames.length - 1; i > -1; i--)
468 if (frames[i] instanceof AlignFrame)
470 AlignFrame af = (AlignFrame) frames[i];
471 if (!viewset.containsKey(af.getViewport().getSequenceSetId()))
473 // update alignment and root from frame.
474 boolean stored = false;
477 stored = vds.storeVAMSAS(af.getViewport(), af.getTitle());
478 } catch (Exception e)
480 errorsDuringUpdate = true;
481 Cache.log.error("Exception synchronizing "
484 + (af.getViewport().viewName == null ? "" : " view "
485 + af.getViewport().viewName)
486 + " to document.", e);
490 { // record skip in skipList
491 skipList.put(af.getViewport().getSequenceSetId(), af);
496 // could try to eliminate sequenceSetId from skiplist ..
497 // (skipList.containsKey(af.getViewport().getSequenceSetId()))
498 // remember sequenceSetId so we can skip all the other views on
500 viewset.put(af.getViewport().getSequenceSetId(), af);
506 // for (int i = frames.length - 1; i > -1; i--)
508 // if (frames[i] instanceof AlignFrame)
510 // AlignFrame af = (AlignFrame) frames[i];
511 Iterator aframes = viewset.values().iterator();
512 while (aframes.hasNext())
514 AlignFrame af = (AlignFrame) aframes.next();
515 // add any AlignedCodonFrame mappings on this alignment to any other.
516 vds.storeSequenceMappings(af.getViewport(), af.getTitle());
518 } catch (Exception e)
520 Cache.log.error("Exception synchronizing Views to Document :", e);
521 errorsDuringUpdate = true;
526 if (viewset.size() > 0)
528 // Alignment views were synchronized, so store their state in the
530 // The skipList ensures we don't write out any alignments not actually
532 vds.setSkipList(skipList);
533 vds.updateJalviewClientAppdata();
535 } catch (Exception e)
537 Cache.log.error("Client Appdata Write exception", e);
538 errorsDuringAppUpdate = true;
544 private Entry baseProvEntry()
546 uk.ac.vamsas.objects.core.Entry pentry = new uk.ac.vamsas.objects.core.Entry();
547 pentry.setUser(user.getFullName());
548 pentry.setApp(app.getClientUrn());
549 pentry.setDate(new java.util.Date());
550 pentry.setAction("created");
555 * do a vamsas document update or update jalview from the vamsas document
558 * true to update from jalview to the vamsas document
559 * @return total number of stored alignments in the document after the update
561 protected int dealWithDocumentUpdate(boolean fromJalview)
564 // called by update handler for document update.
565 Cache.log.debug("Updating jalview from changed vamsas document.");
569 long time = System.currentTimeMillis();
570 IClientDocument cdoc = vclient.getClientDocument();
571 if (Cache.log.isDebugEnabled())
573 Cache.log.debug("Time taken to get ClientDocument = "
574 + (System.currentTimeMillis() - time));
575 time = System.currentTimeMillis();
579 storedviews += updateVamsasDocument(cdoc);
580 if (Cache.log.isDebugEnabled())
583 .debug("Time taken to update Vamsas Document from jalview\t= "
584 + (System.currentTimeMillis() - time));
585 time = System.currentTimeMillis();
587 cdoc.setVamsasRoots(cdoc.getVamsasRoots());
588 if (Cache.log.isDebugEnabled())
590 Cache.log.debug("Time taken to set Document Roots\t\t= "
591 + (System.currentTimeMillis() - time));
592 time = System.currentTimeMillis();
598 if (Cache.log.isDebugEnabled())
601 .debug("Time taken to update Jalview from vamsas document Roots\t= "
602 + (System.currentTimeMillis() - time));
603 time = System.currentTimeMillis();
607 vclient.updateDocument(cdoc);
608 if (Cache.log.isDebugEnabled())
610 Cache.log.debug("Time taken to update Session Document\t= "
611 + (System.currentTimeMillis() - time));
612 time = System.currentTimeMillis();
615 } catch (Exception ee)
617 System.err.println("Exception whilst updating :");
618 ee.printStackTrace(System.err);
619 // recover object map backup, since its probably corrupted with references
620 // to Vobjects that don't exist anymore.
621 recover_objectMappingBackup();
624 Cache.log.debug("Finished updating from document change.");
629 private void addDocumentUpdateHandler()
631 final VamsasApplication client = this;
632 vclient.addDocumentUpdateHandler(new PropertyChangeListener()
634 public void propertyChange(PropertyChangeEvent evt)
636 Cache.log.debug("Dealing with document update event.");
637 client.dealWithDocumentUpdate(false);
638 Cache.log.debug("finished dealing with event.");
641 Cache.log.debug("Added Jalview handler for vamsas document updates.");
644 private void addStoreDocumentHandler()
646 final VamsasApplication client = this;
647 vclient.addVorbaEventHandler(
648 uk.ac.vamsas.client.Events.DOCUMENT_REQUESTTOCLOSE,
649 new PropertyChangeListener()
651 public void propertyChange(PropertyChangeEvent evt)
653 if (client.promptUser)
656 .debug("Asking user if the vamsas session should be stored.");
657 int reply = JOptionPane
658 .showInternalConfirmDialog(
660 "The current VAMSAS session has unsaved data - do you want to save it ?",
661 "VAMSAS Session Shutdown",
662 JOptionPane.YES_NO_OPTION,
663 JOptionPane.QUESTION_MESSAGE);
665 if (reply == JOptionPane.YES_OPTION)
667 Cache.log.debug("Prompting for vamsas store filename.");
668 Desktop.instance.vamsasSave_actionPerformed(null);
670 .debug("Finished attempt at storing document.");
673 .debug("finished dealing with REQUESTTOCLOSE event.");
678 .debug("Ignoring store document request (promptUser==false)");
682 Cache.log.debug("Added Jalview handler for vamsas document updates.");
685 public void disableGui(boolean b)
687 Desktop.instance.setVamsasUpdate(b);
690 Hashtable _backup_vobj2jv;
692 IdentityHashMap _backup_jv2vobj;
695 * make a backup of the object mappings (vobj2jv and jv2vobj)
697 public void backup_objectMapping()
699 _backup_vobj2jv = new Hashtable(vobj2jv);
700 _backup_jv2vobj = new IdentityHashMap(jv2vobj);
704 * recover original object mappings from the object mapping backup if document
708 * if backup_objectMapping was not called.
710 public void recover_objectMappingBackup()
712 if (_backup_vobj2jv == null)
716 // nothing to recover so just
720 throw new Error(MessageManager.getString("error.implementation_error_cannot_recover_vamsas_object_mappings"));
723 Iterator el = _backup_jv2vobj.entrySet().iterator();
726 java.util.Map.Entry mp = (java.util.Map.Entry) el.next();
727 jv2vobj.put(mp.getKey(), mp.getValue());
729 el = _backup_vobj2jv.entrySet().iterator();
732 java.util.Map.Entry mp = (java.util.Map.Entry) el.next();
733 vobj2jv.put(mp.getKey(), mp.getValue());
737 private boolean joinedSession = false;
739 private VamsasListener picker = null;
741 private SelectionListener selecter;
743 private void startSession()
749 vclient.joinSession();
750 joinedSession = true;
751 } catch (Exception e)
754 Cache.log.error("Failed to join vamsas session.", e);
759 final IPickManager pm = vclient.getPickManager();
760 final StructureSelectionManager ssm = StructureSelectionManager
761 .getStructureSelectionManager(Desktop.instance);
762 final VamsasApplication me = this;
763 pm.registerMessageHandler(new IMessageHandler()
767 public void handleMessage(Message message)
771 // we are not in a session yet.
774 if (message instanceof MouseOverMessage)
776 MouseOverMessage mm = (MouseOverMessage) message;
777 String mstring = mm.getVorbaID() + " " + mm.getPosition();
778 if (last != null && mstring.equals(last))
782 // if (Cache.log.isDebugEnabled())
784 // Cache.log.debug("Received MouseOverMessage "+mm.getVorbaID()+"
785 // "+mm.getPosition());
787 Object jvobj = vobj2jv.get(mm.getVorbaID());
788 if (jvobj != null && jvobj instanceof SequenceI)
791 // Cache.log.debug("Handling Mouse over "+mm.getVorbaID()+"
792 // bound to "+jvobj+" at "+mm.getPosition());
793 // position is character position in aligned sequence
794 ssm.mouseOverVamsasSequence((SequenceI) jvobj,
795 mm.getPosition(), me);
798 if (message instanceof uk.ac.vamsas.client.picking.SelectionMessage)
800 // we only care about AlignmentSequence selections
801 SelectionMessage sm = (SelectionMessage) message;
803 System.err.println("Received\n" + sm.getRawMessage());
804 Object[] jvobjs = sm.getVorbaIDs() == null ? null
805 : new Object[sm.getVorbaIDs().length];
808 // TODO: rationalise : can only clear a selection over a
809 // referred to object
810 ssm.sendSelection(null, null, me);
815 for (int o = 0; o < jvobjs.length; o++)
817 jvobjs[o] = vobj2jv.get(sm.getVorbaIDs()[o]);
818 if (jvobjs[o] == null)
820 // can't cope with selections for unmapped objects
825 type = jvobjs[o].getClass();
828 if (type != jvobjs[o].getClass())
831 // discard - can't cope with selections over mixed objects
835 SequenceGroup jselection = null;
836 ColumnSelection colsel = null;
837 if (type == jalview.datamodel.Alignment.class)
839 if (jvobjs.length == 1)
841 // TODO if (sm.isNone())// send a message to select the
842 // specified columns over the
849 if (type == jalview.datamodel.Sequence.class)
853 boolean aligned = ((jalview.datamodel.Sequence) jvobjs[0])
854 .getDatasetSequence() != null;
858 jselection = new SequenceGroup();
859 jselection.addSequence(
860 seq = (jalview.datamodel.Sequence) jvobjs[0],
862 maxWidth = seq.getLength();
864 for (int c = 1; aligned && jvobjs.length > 1
865 && c < jvobjs.length; c++)
867 if (((jalview.datamodel.Sequence) jvobjs[c])
868 .getDatasetSequence() == null)
875 jselection.addSequence(
876 seq = (jalview.datamodel.Sequence) jvobjs[c],
878 if (maxWidth < seq.getLength())
880 maxWidth = seq.getLength();
888 // if cardinality is greater than one then verify all
889 // sequences are alignment sequences.
890 if (jvobjs.length == 1)
892 // find all instances of this dataset sequence in the
893 // displayed alignments containing the associated range and
899 jselection.setStartRes(0);
900 jselection.setEndRes(maxWidth);
901 // locate the alignment containing the given sequences and
902 // select the associated ranges on them.
903 if (sm.getRanges() != null)
905 int[] prange = uk.ac.vamsas.objects.utils.Range
906 .getBounds(sm.getRanges());
907 jselection.setStartRes(prange[0] - 1);
908 jselection.setEndRes(prange[1] - 1);
909 prange = uk.ac.vamsas.objects.utils.Range
910 .getIntervals(sm.getRanges());
911 colsel = new ColumnSelection();
912 for (int p = 0; p < prange.length; p += 2)
914 int d = (prange[p] <= prange[p + 1]) ? 1 : -1;
915 // try to join up adjacent columns to make a larger
917 // lower and upper bounds
918 int l = (d < 0) ? 1 : 0;
919 int u = (d > 0) ? 1 : 0;
921 if (jselection.getStartRes() > 0
922 && prange[p + l] == jselection.getStartRes())
924 jselection.setStartRes(prange[p + l] - 1);
926 if (jselection.getEndRes() <= maxWidth
927 && prange[p + u] == (jselection.getEndRes() + 2))
929 jselection.setEndRes(prange[p + u] - 1);
931 // mark all the columns in the range.
932 for (int sr = prange[p], er = prange[p + 1], de = er
933 + d; sr != de; sr += d)
935 colsel.addElement(sr - 1);
944 ssm.sendSelection(jselection, colsel, me);
947 for (int c = 0; c < jvobjs.length; c++)
957 picker = new VamsasListener()
959 SequenceI last = null;
964 public void mouseOverSequence(SequenceI seq, int index,
971 if (seq != last || i != index)
973 VorbaId v = (VorbaId) jv2vobj.get(seq);
976 // this should really be a trace message.
977 // Cache.log.debug("Mouse over " + v.getId() + " bound to "
978 // + seq + " at " + index);
981 MouseOverMessage message = new MouseOverMessage(v.getId(),
983 pm.sendMessage(message);
988 selecter = new SelectionListener()
991 public void selection(SequenceGroup seqsel,
992 ColumnSelection colsel, SelectionSource source)
997 .warn("Selection listener still active for dead session.");
1003 AlignmentI visal = null;
1004 if (source instanceof AlignViewport)
1006 visal = ((AlignmentViewport) source).getAlignment();
1008 SelectionMessage sm = null;
1009 if ((seqsel == null || seqsel.getSize() == 0)
1010 && (colsel == null || colsel.getSelected() == null || colsel
1011 .getSelected().size() == 0))
1013 if (source instanceof AlignViewport)
1015 // the empty selection.
1016 sm = new SelectionMessage("jalview", new String[]
1017 { ((AlignmentViewport) source).getSequenceSetId() }, null,
1022 // the empty selection.
1023 sm = new SelectionMessage("jalview", null, null, true);
1028 String[] vobj = new String[seqsel.getSize()];
1030 for (SequenceI sel : seqsel.getSequences(null))
1032 VorbaId v = (VorbaId) jv2vobj.get(sel);
1035 vobj[o++] = v.toString();
1038 if (o < vobj.length)
1041 vobj = new String[o];
1042 System.arraycopy(t, 0, vobj, 0, o);
1046 if (seqsel != null && colsel != null)
1048 // deparse the colsel into positions on the vamsas alignment
1050 range = new Input();
1051 if (colsel.getSelected() != null
1052 && colsel.getSelected().size() > 0
1054 && seqsel.getSize() == visal.getHeight())
1056 // gather selected columns outwith the sequence positions
1058 for (Object obj : colsel.getSelected())
1060 int ival = ((Integer) obj).intValue();
1068 int[] intervals = colsel.getVisibleContigs(
1069 seqsel.getStartRes(), seqsel.getEndRes() + 1);
1070 for (int iv = 0; iv < intervals.length; iv += 2)
1073 s.setStart(intervals[iv] + 1); // vamsas indices begin at
1075 s.setEnd(intervals[iv + 1] + 1);
1076 s.setInclusive(true);
1081 if (vobj.length > 0)
1083 sm = new SelectionMessage("jalview", vobj, range);
1092 sm.validate(); // debug
1093 Cache.log.debug("Selection Message\n" + sm.getRawMessage());
1100 ssm.addStructureViewerListener(picker); // better method here
1101 ssm.addSelectionListener(selecter);
1102 } catch (Exception e)
1104 Cache.log.error("Failed to init Vamsas Picking", e);
1109 public String getCurrentSession()
1111 if (vclient != null)
1113 return (vclient.getSessionUrn());